Using finalfit conventions, produces a multivariable binomial logistic regression model for a set of explanatory variables against a binary dependent.

glmmulti(.data, dependent, explanatory, family = "binomial", ...)

Arguments

.data

Data frame.

dependent

Character vector of length 1: name of depdendent variable (must have 2 levels).

explanatory

Character vector of any length: name(s) of explanatory variables.

family

Character vector quoted or unquoted of the error distribution and link function to be used in the model, see glm.

...

Other arguments to pass to glm.

Value

A multivariable glm fitted model.

Details

Uses glm with finalfit modelling conventions. Output can be passed to fit2df.

See also

Examples

library(finalfit) library(dplyr) explanatory = c("age.factor", "sex.factor", "obstruct.factor", "perfor.factor") dependent = "mort_5yr" colon_s %>% glmmulti(dependent, explanatory) %>% fit2df(estimate_suffix=" (univariable)")
#> Waiting for profiling to be done...
#> explanatory OR (univariable) #> 1 age.factor40-59 years 0.57 (0.34-0.98, p=0.041) #> 2 age.factor60+ years 0.81 (0.48-1.36, p=0.426) #> 3 sex.factorMale 0.98 (0.75-1.28, p=0.902) #> 4 obstruct.factorYes 1.25 (0.90-1.76, p=0.186) #> 5 perfor.factorYes 1.12 (0.51-2.44, p=0.770)