Diff for "FAQ/Rss" - CBU statistics Wiki
location: Diff for "FAQ/Rss"
Differences between revisions 18 and 19
Revision 18 as of 2014-01-16 10:28:46
Size: 1093
Editor: PeterWatson
Comment:
Revision 19 as of 2014-01-16 10:31:02
Size: 1042
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Type III SS
[[http://tolstoy.newcastle.edu.au/R/help/05/08/9560.html|
may be obtained]] using terms of form
Type III SS may be obtained using terms of form
Line 9: Line 8:
fit <- anova(lm(y~x+z))
anova(fi
t, ssType=3) 
library(car)
fit <- Anova(lm(y~x+z),type=c("III"))
Line 18: Line 17:
for ''lm'', ''aov'' and ''lme''. The ''Anova()'' procedure can be used to obtain type 3 sums of squares for ''lmer'' in R. The Anova () procedure is available by downloading the ''car'' extension package from [[http://cran.r-project.org/|here]] and can be inserted into the R library folder located in C:\Program Files\R\R2.x. You can also use the summary() procedure, for obtaining type III SS for ''lmer'' from version 2.7.2 of R. for ''lm'', ''aov'' and ''lme''. The ''Anova()'' procedure can also be used to obtain type 3 sums of squares for ''lmer'' in R. The Anova () procedure is available by downloading the ''car'' extension package from [[http://cran.r-project.org/|here]] and can be inserted into the R library folder located in C:\Program Files\R\R3.x. You can also use the summary() procedure, for obtaining type III SS for ''lmer'' from version 2.7.2 of R.

Sums of Squares used by R in lm, aov and lmer

R calculates sequential or Type I SS by default when using lm, lmer and aov as opposed to the type III SS (default in SPSS) which partials out effects of other terms in the model. A hierarchical approach is suggested which gives the same results for both sums of squares and only looks at the highest order terms in a model.

Type III SS may be obtained using terms of form

library(car)
fit <- Anova(lm(y~x+z),type=c("III"))

and

model.2 <- lme(y~a + b, random=~1|group)
anova(model.2,type="marginal")

for lm, aov and lme. The Anova() procedure can also be used to obtain type 3 sums of squares for lmer in R. The Anova () procedure is available by downloading the car extension package from here and can be inserted into the R library folder located in C:\Program Files\R\R3.x. You can also use the summary() procedure, for obtaining type III SS for lmer from version 2.7.2 of R.

None: FAQ/Rss (last edited 2014-01-16 11:03:55 by PeterWatson)