Dear R Core Team
I've a proposal to improve drop1(). The function should change the
contrast from the default ("treatment") to "sum". If you fit
a
model with an interaction (which ist not signifikant) and you
display the main effect with
drop1( , scope = .~., test = "F")
If you remove the interaction, then everything's okay. There is
no way to fit a model, let an non signifikant interaction in
the model and get interpretable main effects with the
"treatment" contrast.
One solution would be to change automatically the contrast to
the "sum" contrast.
Another possibility is to produce a warning when you use drop1
with the scope argument to get main effects in the presence of
an interaction (even not signifikant) with "treatment"
contrast.
An example:
library(MASS)
##- Data "genotype"
names(genotype)
##- > [1] "Litter" "Mother" "Wt"
##- to be sure the contrasts are "treatment"
options(contrasts = c("contr.treatment", "contr.poly" ))
##- model with interaction
gen.int <- aov(Wt ~ Litter*Mother, data = genotype)
drop1(gen.int, scope = .~., test = "F")
##- Model:
##- Wt ~ Litter * Mother
##- Df Sum of Sq RSS AIC F value Pr(F)
##- <none> 2440.8 257.0
##- Litter 3 591.7 3032.5 264.3 3.6362 0.01968 *
##- Mother 3 582.3 3023.1 264.1 3.5782 0.02099 *
##- Litter:Mother 9 824.1 3264.9 256.8 1.6881 0.12005
##- ---
##- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 `
' 1
##- the interaction is not signifikant, Litter is signifikant,
##- but is that really true?
##- main effect model
gen.main <- aov(Wt ~ Litter + Mother, data = genotype)
drop1(gen.main, scope = .~., test = "F")
##- Model:
##- Wt ~ Litter + Mother
##- Df Sum of Sq RSS AIC F value Pr(F)
##- <none> 3264.9 256.8
##- Litter 3 63.6 3328.5 252.0 0.3508 0.78870
##- Mother 3 775.1 4040.0 263.8 4.2732 0.00886 **
##- ---
##- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 `
' 1
## Dramatic change of the sum of squares for the factor Litter
## With contrast = "sum" the whole thing looks better
options(contrasts = c("contr.sum", "contr.poly" ))
##- model with interaction
gen.int1 <- aov(Wt ~ Litter*Mother, data = genotype)
drop1(gen.int1, scope = .~., test = "F")
##- Model:
##- Wt ~ Litter * Mother
##- Df Sum of Sq RSS AIC F value Pr(F)
##- <none> 2440.8 257.0
##- Litter 3 27.7 2468.5 251.7 0.1700 0.91612
##- Mother 3 671.7 3112.6 265.9 4.1282 0.01142 *
##- Litter:Mother 9 824.1 3264.9 256.8 1.6881 0.12005
##- ---
##- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 `
' 1
##- the interaction is not signifikant, Litter is NOT! signifikant.
gen.main1 <- aov(Wt ~ Litter + Mother, data = genotype)
drop1(gen.main1, scope = .~., test = "F")
##- Wt ~ Litter + Mother
##- Df Sum of Sq RSS AIC F value Pr(F)
##- <none> 3264.9 256.8
##- Litter 3 63.6 3328.5 252.0 0.3508 0.78870
##- Mother 3 775.1 4040.0 263.8 4.2732 0.00886 **
##- ---
##- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 `
' 1
##- Litter stays not signifikant.
Best regards
Christoph Buser
--
Christoph Buser <buser at stat.math.ethz.ch>
Seminar fuer Statistik, LEO D6
ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND
phone: x-41-1-632-3505 fax: 632-1228
http://stat.ethz.ch/~buser/