powered by
Fit and predict in a single function.
fit_model(df = NULL, yname = NULL, xname = NULL, modeltype = NULL, ...)
A data.frame object
The outcome variable
The predictor variable(s)
A character specifying the model type e.g lm for linear model
Other arguments to specific model types.
# NOT RUN { fit_model(iris,"Sepal.Length","Species","lm") fit_model(iris,"Sepal.Width","Sepal.Length + Petal.Length + I(Petal.Width)**2","lm") # }
Run the code above in your browser using DataLab