Dear All, I was trying to reproduce prof. Venables analysis on Sheffe data for rats: http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf I have no problems concerning the aov side of the analysis, but I noticed that drop1 in R gives me a completely different result than those on the Exegeses. In particular my Sum of Squares and RSS are wildly different. I used :> drop1(aov.model1,.~.,test="F")Single term deletions Model: WT ~ Litter + Mother + 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 which is pretty different form prof. Venables results: Model: Wt ? Litter * Mother Df Sum of Sq RSS F Value Pr(F) <none> 2440.816 Litter 3 27.6559 2468.472 0.169959 0.9161176 Mother 3 671.7376 3112.554 4.128153 0.0114165 Litter:Mother 9 824.0725 3264.889 1.688108 0.1200530 Any suggestion why? Regards, Federico Calboli ======================== Federico C.F. Calboli Department of Biology University College London Room 327 Darwin Building Gower Street London WClE 6BT Tel: (+44) 020 7679 4395 Fax (+44) 020 7679 7096 f.calboli at ucl.ac.uk ======================== -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Federico, At 05:24 PM 10/2/2002 +0100, Federico Calboli wrote:>Dear All, > >I was trying to reproduce prof. Venables analysis on Sheffe data for rats: > >http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf > >I have no problems concerning the aov side of the analysis, but I noticed >that drop1 in R gives me a completely different result than those on the >Exegeses. In particular my Sum of Squares and RSS are wildly different. > >I used : > > > drop1(aov.model1,.~.,test="F") > >Single term deletions > >Model: >WT ~ Litter + Mother + 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 > >which is pretty different form prof. Venables results: > >Model: >Wt ? Litter * Mother > Df Sum of Sq RSS F Value Pr(F) ><none> 2440.816 >Litter 3 27.6559 2468.472 0.169959 0.9161176 >Mother 3 671.7376 3112.554 4.128153 0.0114165 >Litter:Mother 9 824.0725 3264.889 1.688108 0.1200530 > >Any suggestion why?The default contrast type for unordered factors is different in S-Plus and R: In S-Plus it is contr.helmert; in R, contr.treatment. You can obtain the published results by, e.g., setting the contrast type explicitly: > mod.1 <- aov(Wt ~ Litter*Mother, data=genotype) > drop1(mod.1, .~., test="F") Single term deletions Model: Wt ~ Litter + Mother + 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 > mod.2 <- update(mod.1, + contrasts=list(Litter=contr.helmert, Mother=contr.helmert)) > drop1(mod.2, .~., test="F") Single term deletions Model: Wt ~ Litter + Mother + 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 Regards, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox ----------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The explanation is simple. The default R contrasts are
options(contrasts=c("contr.treatments", "contr.poly"))
whereas for S-PLUS (on which I worked) they are
options(contrasts=c("contr.helmert", "contr.poly"))
If you declare these as the contrasts (or indeed any of the standard
contrast matrix generators EXCEPT contr.treatment) you should get the same
answers as published in the Exegeses paper.
Someday I really need to update and publish that old thing... Hmm.
Bill Venables.
-----Original Message-----
From: Federico Calboli [mailto:f.calboli at ucl.ac.uk]
Sent: Thursday, October 03, 2002 2:25 AM
To: r-help at stat.math.ethz.ch
Subject: [R] drop1
Dear All,
I was trying to reproduce prof. Venables analysis on Sheffe data for rats:
http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf
I have no problems concerning the aov side of the analysis, but I noticed
that drop1 in R gives me a completely different result than those on the
Exegeses. In particular my Sum of Squares and RSS are wildly different.
I used :
> drop1(aov.model1,.~.,test="F")
Single term deletions
Model:
WT ~ Litter + Mother + 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
which is pretty different form prof. Venables results:
Model:
Wt ~ Litter * Mother
Df Sum of Sq RSS F Value Pr(F)
<none> 2440.816
Litter 3 27.6559 2468.472 0.169959 0.9161176
Mother 3 671.7376 3112.554 4.128153 0.0114165
Litter:Mother 9 824.0725 3264.889 1.688108 0.1200530
Any suggestion why?
Regards,
Federico Calboli
========================
Federico C.F. Calboli
Department of Biology
University College London
Room 327
Darwin Building
Gower Street
London
WClE 6BT
Tel: (+44) 020 7679 4395
Fax (+44) 020 7679 7096
f.calboli at ucl.ac.uk
========================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._