Is it possible to set a stepwise linear model to use the BIC criteria rather than AIC?
I've been trying this but it still calculates each step using AIC values rather than BIC
null = lm(data[,1] ~ 1)
full = lm(data[,1] ~ age + bmi + gender + group)
step(null, scope = list(lower=null,upper=full),
direction="both", criterion = "BIC")
The Bayesian Information Criterion (BIC) is more useful in selecting a correct model while the AIC is more appropriate in finding the best model for predicting future observations.
The Akaike information criterion (AIC) and the Bayesian information criterion (BIC) provide measures of model performance that account for model complexity. AIC and BIC combine a term reflecting how well the model fits the data with a term that penalizes the model in proportion to its number of parameters.
The Bayesian Information Criterion, often abbreviated BIC, is a metric that is used to compare the goodness of fit of different regression models. In practice, we fit several regression models to the same dataset and choose the model with the lowest BIC value as the model that best fits the data.
If it's between 6 and 10, the evidence for the best model and against the weaker model is strong. A Δ BIC of greater than ten means the evidence favoring our best model vs the alternate is very strong indeed.
Add the argument k=log(n)
to the step
function (n
number of samples in the model matrix)
From ?step
:
Arguments:
...k the multiple of the number of degrees of freedom used for the penalty. Only k = 2 gives the genuine AIC; k = log(n) is sometimes referred to as BIC or SBC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With