powered by
Fit and predict in a single function.
fit_model( df = NULL, yname = NULL, xname = NULL, modeltype = NULL, drop_non_numeric = FALSE, ... )
A data.frame object
The outcome variable
The predictor variable(s)
A character specifying the model type e.g lm for linear model
Should non numeric columns be dropped? Defaults to FALSE
Other arguments to specific model types.
data("yields", package="manymodelr") fit_model(yields,"height","weight","lm") fit_model(yields, "weight","height + I(yield)**2","lm")
Run the code above in your browser using DataLab