modelsum {arsenal} | R Documentation |
Fit models over each of a set of independent variables with a response variable
Description
Fit and summarize models for each independent (x) variable with a response variable (y), with options to adjust by variables for each model.
Usage
modelsum(
formula,
family = "gaussian",
data,
adjust = NULL,
na.action = NULL,
subset = NULL,
weights = NULL,
id,
strata,
control = NULL,
...
)
Arguments
formula |
an object of class |
family |
similar mechanism to |
data |
an optional data.frame, list or environment (or object coercible by |
adjust |
an object of class |
na.action |
a function which indicates what should happen when the data contain |
subset |
an optional vector specifying a subset of observations (rows of |
weights |
an optional vector specifying the weights to apply to each data observation (rows of |
id |
A vector to identify clusters. Only used for |
strata |
a vector of strata to separate model summaries by an additional group. Note that for families like "clog",
the "usual" strata term to indicate subject groupings should be given in the |
control |
control parameters to handle optional settings within |
... |
additional arguments to be passed to internal |
Value
An object with class c("modelsum", "arsenal_table")
Author(s)
Jason Sinnwell, Patrick Votruba, Beth Atkinson, Gregory Dougherty, and Ethan Heinzen, adapted from SAS Macro of the same name
See Also
arsenal_table
, modelsum.control
, summary.modelsum
,
modelsum.internal
, formulize
Examples
data(mockstudy)
tab1 <- modelsum(bmi ~ sex + age, data = mockstudy)
summary(tab1, text = TRUE)
tab2 <- modelsum(alk.phos ~ arm + ps + hgb, adjust = ~ age + sex,
family = "gaussian", data = mockstudy)
summary(tab2, text = TRUE)
summary(tab2, show.intercept = FALSE, text = TRUE)
tab2.df <- as.data.frame(tab2)
tab2.df[1:5,]