Description Usage Arguments Value Author(s) See Also Examples
This function will attempt to create the "best' linear model by finding the most significant predictors. A predictor will be included/excluded in the final model if when it is added/removed its p-value is below/above a certain threshold.
1 2 3 |
response |
the response variable of interest in the model |
fullmodel |
a linear model containing all possible predictors, typically of the form lm(y ~ ., data = data) |
aEnter |
the threshold for adding new predictors, set to 0.1 by default |
aRemove |
the threshold for removing predictors from the current model, set to 0.1 by default |
forcedIn |
a vector of predictors that will be forced into the final model regardless of their p-values |
forcedOut |
a vector of predictors that will not be included in the final model regardless of their p-values |
method |
"forward" will only add predictors, "backward" will only remove predictors and "both" will perfrom stepwise. "both" by default |
plotRes |
option to print residual plots. plotRes = TRUE will include normailty plot and fit vs. residual plots. FALSE by defult. |
a linear model of type lm containing the "best" predictors
Cory Langille <lang1729@gmail.com>
extractp
, stepfwd
, stepbwd
, fMaker
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.