I am trying to reproduce an analysis done in SAS from which Type III Sums of squares are used. How can you get Type III sums of squares in an aov similar to what SAS provides? With best wishes and kind regards I am Sincerely, Corey A. Moffet Instructor Department of Range, Wildlife, and Fisheries Management Mail Stop 2125 Texas Tech University Lubbock, Texas 79409-2125 (806) 742-2843 Voice (806) 742-2280 FAX c.moffet at ttu.edu -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Moffet, Corey" <Corey.Moffet at ttu.edu> writes:> I am trying to reproduce an analysis done in SAS from which Type III Sums of > squares are used. How can you get Type III sums of squares in an aov similar > to what SAS provides?drop1(), except that R will refuse to test main effects in the presence of an interaction. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 28 Jan 2002, Moffet, Corey wrote:> I am trying to reproduce an analysis done in SAS from which Type III Sums of > squares are used. How can you get Type III sums of squares in an aov similar > to what SAS provides? >You can get any set of sums of squares by fitting two aov models and comparing them (it's a FAQ). While I don't speak SAS fluently I believe that the Type III sums of squares for a term A compare a full model to a model without A but with everything else eg full.model<-aov(Y~A+B+C,data=df) anova(full.model, update(full.model,.~.-A)) You can use drop1(full.model) to get all of these at once. By default this will not give Type III SS for main effects in the presence of interactions but as these are usually silly that's not a big problem. If you really do want to test for a main effect in the presence of interactions (which occasionally makes sense) you can specify a list of specific terms to consider, eg: full.model2<-aov(Y~A+B*C,data=df) drop1(full.model2, scope=c("A","B")) -thomas Thomas Lumley Asst. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 Corey, At 09:50 AM 1/28/2002 -0600, Moffet, Corey wrote:>I am trying to reproduce an analysis done in SAS from which Type III Sums of >squares are used. How can you get Type III sums of squares in an aov similar >to what SAS provides?The Anova function in the car package will calculate both "Type II" and "Type III" sums of squares, but be careful with contrast coding for the latter or you'll get nonsense. I hope that this helps, John -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thank you the Anova function does just what I needed. With best wishes and kind regards I am Sincerely, Corey A. Moffet Instructor Department of Range, Wildlife, and Fisheries Management Mail Stop 2125 Texas Tech University Lubbock, Texas 79409-2125 (806) 742-2843 Voice (806) 742-2280 FAX c.moffet at ttu.edu -----Original Message----- From: John Fox [mailto:jfox at mcmaster.ca] Sent: Monday, January 28, 2002 1:49 PM To: Moffet, Corey Cc: r-help at stat.math.ethz.ch Subject: Re: [R] Type III Sums of Squares Dear Corey, At 09:50 AM 1/28/2002 -0600, Moffet, Corey wrote:>I am trying to reproduce an analysis done in SAS from which Type III Sumsof>squares are used. How can you get Type III sums of squares in an aovsimilar>to what SAS provides?The Anova function in the car package will calculate both "Type II" and "Type III" sums of squares, but be careful with contrast coding for the latter or you'll get nonsense. I hope that this helps, John -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._