StandICModelSelect {DBModelSelect} | R Documentation |
Model selection using standardized information criteria
Description
Perform model selection on a list of models using standardized information criteria.
Usage
StandICModelSelect(
x,
IC = "AIC",
ref_model_index = NULL,
sd_cutoff = 2,
user_df = NULL,
...
)
## S3 method for class 'StandICModelSelect'
print(x, ...)
## S3 method for class 'StandICModelSelect'
plot(x, ...)
Arguments
x |
A list containing the fitted model objects on which to perform model selection. Model objects must have a |
IC |
A character string containing the base information criteria to use. Options are "AIC", "BIC", and "AICc" for linear models. Default option is 'AIC'. |
ref_model_index |
An integer with the index of the largest candidate model to use as the reference. If not supplied, defaults to the model with largest number of estimated coefficients in |
sd_cutoff |
A numeric describing how many standard deviations to use when formulating a cutoff for model viability. |
user_df |
An optional vector the same length as |
... |
Additional arguments. |
Value
A list containing the final model selected in addition to standardized information criteria and difference in degrees of freedom for all candidate models.
Examples
# example code
# generate some data
s <- rnorm(200)
t <- rnorm(200)
y <- s + rnorm(200)
# formulate and fit models
model_list <- list(lm(y~1), lm(y~s), lm(y~t), lm(y~s+t))
# perform model selection
model_select <- StandICModelSelect(model_list, IC = "AIC")
# display best model
model_select$best_model