This function was devised to deal with a list of linear model formulas. The
main objective is to bring together several functions commonly used when
building linear models, such as automated variable selection. In the current
implementation, variable selection can be done using stepVIF or
stepAIC or both. stepVIF is a backward variable selection
procedure, while stepAIC supports backward, forward, and bidirectional
variable selection. For more information about these functions, please visit
their respective help pages.
An important feature of buildMS is that it records the initial number
of candidate predictor variables and observations offered to the model, and
adds this information as an attribute to the final selected model. Such
feature was included because variable selection procedures result biased
linear models (too optimistic), and the effective number of degrees of
freedom is close to the number of candidate predictor variables initially
offered to the model (Harrell, 2001). With the initial number of candidate
predictor variables and observations offered to the model, one can calculate
penalized or adjusted measures of model performance. For models built using
builtMS, this can be done using statsMS.
Some important details should be clear when using buildMS:
this function was originally devised to deal with a list of formulas,
but can also be used with a single formula;
in the current implementation, stepVIF runs before
stepAIC;
function arguments imported from stepAIC and stepVIF
were named as in the original functions, and received a prefix (aic
or vif) to help the user identifying which function is affected by a
given argument without having to go check the documentation.