% Generated by roxygen2: do not edit by hand % Please edit documentation in R/regression_model.R \name{regression_model} \alias{regression_model} \title{Create a regression model programatically} \usage{ regression_model( data, outcome.str, auto.mode = TRUE, formula.str = NULL, args.list = NULL, fun = NULL, vars = NULL, ... ) } \arguments{ \item{data}{data set} \item{outcome.str}{Name of outcome variable. Character vector.} \item{auto.mode}{Make assumptions on function dependent on outcome data format. Overwrites other arguments.} \item{formula.str}{Formula as string. Passed through 'glue::glue'. If given, 'outcome.str' and 'vars' are ignored. Optional.} \item{args.list}{List of arguments passed to 'fun' with 'do.call'.} \item{fun}{Name of function as character vector or function to use for model creation.} \item{vars}{character vector of variables to include} \item{...}{ignored for now} } \value{ object of standard class for fun } \description{ Create a regression model programatically } \examples{ gtsummary::trial |> regression_model(outcome.str = "age") gtsummary::trial |> regression_model( outcome.str = "age", auto.mode = FALSE, fun = "stats::lm", formula.str = "{outcome.str}~.", args.list = NULL ) gtsummary::trial |> regression_model( outcome.str = "trt", auto.mode = FALSE, fun = "stats::glm", args.list = list(family = binomial(link = "logit")) ) }