liao wrote:
Deal S-Plusers,
I want to base on ANOVA aov() output, and extract the factors with
significant p-values, and then input these factors into regression models
glm() or lm() to do model selection.
My questions are:
1. The aov() output specify the interaction with colons such as factor(A) :
factor(B): factor(C),.. How can I split the interaction to individual
factor(A), factor(B), factor(C) so that program can recognize factor names?
Use unpaste("A:B", sep = ":").
2. The whole process hopes to AUTOMATICALLY do ANOVA first and then input
factors to glm() or lm(), kind of like PROC GLM in SAS. Any recommended
S-PLUS function? Or other suggestions?
"aov" is just a wrapper function for "lm" (see ?aov). That said, why not
fit lm (or glm) directly, then use stepAIC in the MASS library for model
selection? Or alternatively, you can use stepAIC directly on the aov
object. Using coefficient p-values as a method for model selection is
very dangerous.
Sundar
|