Description Usage Arguments Details Value See Also Examples
Fit many regression models based on a vector of formulas
1 2 3 4 5 6 7 8 |
formulas |
A vector of |
fitter |
fitting function or vector of fitting functions (default: |
... |
other arguments passed to fitting function. |
output |
Return estimated models in a list? |
print |
Print a regression table? |
texreg |
A named list with arguments passed to |
This simple function estimates a series of regression models based on a vector of formulas.
The argument fitter
allows to call any formula-based fitting function in R (e.g., lm, glm).
The function provides options to summarize the regressions in a regression table and/or to store
the fit objects in a named list which can passed on.
either NULL
or the list of fitted model objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(mtcars)
f_lm <- c(
mpg ~ vs,
hp ~ vs,
disp ~ vs * am)
fit_models(f_lm, fitter=lm, data=mtcars,
output=FALSE, print=TRUE)
f_glm <- c(
vs ~ mpg,
am ~ mpg)
mods <- fit_models(f_glm, fitter=glm, data=mtcars,
family=binomial('logit'),
output=TRUE, print=TRUE,
texreg=list(stars=NULL))
lapply(mods, nobs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.