Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a stepwise linear model with BIC criterion

Tags:

r

lm

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")
like image 498
user2846211 Avatar asked Oct 16 '13 10:10

user2846211


People also ask

Which is better AIC or 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.

What is AIC and BIC in linear regression?

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.

What is BIC in regression?

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.

What is a good BIC score?

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.


1 Answers

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.

like image 192
rcs Avatar answered Oct 22 '22 23:10

rcs