Re: [R] Type I or III SS with mixed model function lme

From: John Fox <jfox_at_mcmaster.ca>
Date: Tue, 06 May 2008 17:49:56 -0400

Dear Bill,

I expect that the problem is in the contrasts that your student used for A and B, though I haven't thought specifically about the context of a mixed model. If he or she used the default contr.treatment(), then the contrasts for different factors (and the interaction) are not orthogonal in the row basis of the model matrix and hence are not orthogonal, even for balanced data. Using, e.g., contr.sum() should provide A, B, and A:B contrasts that are orthogonal to each other.

I hope this helps,
 John



John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox

> -----Original Message-----
> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org]
On
> Behalf Of Bill Shipley
> Sent: May-06-08 2:13 PM
> To: R help list
> Subject: [R] Type I or III SS with mixed model function lme
>
> Hello, I have come across a result that I cannot explain, and am hoping
that
> someone else can provide an answer. A student fitted a mixed model using
the
> lme function: out<- lme(fixed=Y~A+B+A:B, random=~1|Site). Y is a
continuous
> variable while A and B are factors. The data set is balanced with the
same
> number of observations in each combination of A and B. There are two
> hierarchical levels: Site and plots nested in site.
>
>
>
> He tried two different ways of getting theANOVA table: anova(out) and
> anova(out, type=marginal).
>
>
>
> Since the data were balanced, these two ways should (I think) give the
same
> output since they correspond to Type I and III sums of squares in the SAS
> terminology. At least, this is the case with normal (i.e. not mixed)
linear
> models. However, he finds very different results of these two types of
ANOVA
> tables. Why?
>
>
>
> Bill Shipley
>
> North American Editor, Annals of Botany
>
> Dipartement de biologie
>
> Universiti de Sherbrooke
>
> Sherbrooke (Quibec) J1K 2R1
>
> Canada
>
> (819) 821-8000, poste 62079
>
> (819) 821-8049 FAX
>
>
>
> <http://pages.usherbrooke.ca/jshipley/recherche/>
> http://pages.usherbrooke.ca/jshipley/recherche/
>
>
>
>
> [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 06 May 2008 - 21:54:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 06 May 2008 - 23:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive