Skip to content

model selection using ANOVA

2 messages · Alina Sheyman, Stephan Kolassa

#
Hi Alina,

your approach sounds problematic - you can always get a smaller RSS if 
you add terms to your model, so your approach will always go for larger 
models, and you will end up overfitting. Consider information criteria, 
e.g., AIC or BIC, which "penalize" larger models. References for AIC are 
Burnham & Anderson; other people prefer BIC.

Then you can do something like

models <- list()
AICs <- rep(NA, n)
models[[1]] <- lm(...); AICs[1] <- AIC(model[[1]])
...
models[[n]] <- lm(...); AICs[n] <- AIC(model[[n]])
which.min(AICs)

depending on your specific needs.

HTH,
Stephan


Alina Sheyman schrieb: