[R] drop1() seems to give unexpected results compare to anova()

Jeroen Ooms j.c.l.ooms at uu.nl
Fri Aug 1 18:00:08 CEST 2008



Thomas Chu wrote:
> 
> Neither of those 3 lines of commands managed to drop x4 and its P value 
> magically decreased from 0.94 to almost 0! I am also baffled by how R 
> calculated those RSS. 
> 
Maybe it is using a different type of SS. If i have a lm() model, and i do:
options(contrasts=c("contr.sum", "contr.poly"));
anovafit <- drop1(model,attributes(model$terms)$term.labels,test="F");
then i get identical SS, F and p values as in SPSS. Maybe 
http://www.nabble.com/set-type-of-SS-in-anova()-to18287076.html#a18287076
this post  is helpfull. Also check out the post on 
http://myowelt.blogspot.com/ this blog  from 2008-05-24: Obtaining the same
ANOVA results in R as in SPSS - the difficulties with Type II and Type III
sums of squares .

-- 
View this message in context: http://www.nabble.com/drop1%28%29-seems-to-give-unexpected-results-compare-to-anova%28%29-tp18770635p18777713.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list