[R] aov and Error function

peter dalgaard pdalgd at gmail.com
Mon Feb 2 13:27:30 CET 2015


On 02 Feb 2015, at 13:09 , S Ellison <S.Ellison at lgcgroup.com> wrote:

> 
>>> aovsubj <- aov(value~group+time+Error(subject),data=dataRMANOVA)
>>> and
>>> aovsubjgroup <- aov(value~group+time+Error(subject/group),data=dataRMANOVA)
>>> 
>> Since no-one else seems to have answered you let me point out that your first
>> formulation treats subject 1 in the "int" group as being the same as subject 1 in
>> the "cont" group, and similarly for subject 2 and so on.
>> 
>> The second formulation (subject nested within group) treats subject 1 in the
>> "int" group as being *different* from subject 1 in the "cont" group.
> 
> Yes, but that isn't all, is it? 
> 
> subject/group
> 
> means group nested in subject, expanding to 
> ~subject+subject:group.
> 
> so Error(subject/group) asks for a subject effect across groups _as well as_ one within groups.
> 


Or maybe more usefully stated, a group effect within subjects. This could be relevant if each individual goes to two different groups labeled say 1 and 2, but the groups are not related between different subjects (subj.1 attends AA and Boy Scouts, subj 2 School Board and Church, etc.) so there is no main effect of group. In statistics, it is usually the other way around: subjects arbitrarily numbered 1-20 within each group, but no relation between "subj.1" in one group and "subj.2" of the other, in which case ~group + Error(group:subject) makes sense. 


> S Ellison
> 
> 
> *******************************************************************
> This email and any attachments are confidential. Any =...{{dropped:24}}



More information about the R-help mailing list