fit_models {manymodelr} | R Documentation |
Fit several models with different response variables
Description
Fit several models with different response variables
Usage
fit_models(
df = NULL,
yname = NULL,
xname = NULL,
modeltype = NULL,
drop_non_numeric = FALSE,
...
)
Arguments
df |
A data.frame object |
yname |
The outcome variable |
xname |
The predictor variable(s) |
modeltype |
A character specifying the model type e.g lm for linear model |
drop_non_numeric |
Should non numeric columns be dropped? Defaults to FALSE |
... |
Other arguments to specific model types. |
Value
A list of model objects that can be used later.
Examples
data("yields", package="manymodelr")
fit_models(df=yields,yname=c("height","yield"),xname="weight",modeltype="lm")
#many model types
fit_models(df=yields,yname=c("height","yield"),xname="weight",
modeltype=c("lm", "glm"))
[Package manymodelr version 0.3.7 Index]