On 01/02/15 02:17, John Sorkin wrote:> I am trying to understand the Error function and its use in ANOVA. In > particular I want to understand the difference between two models > that differ only with respect to the Error statement: > > > aovsubj <- aov(value~group+time+Error(subject),data=dataRMANOVA) > and > aovsubjgroup <- aov(value~group+time+Error(subject/group),data=dataRMANOVA) > > You will note that in my data I have two subject identifiers, > subject and subject2. I am also trying to trying to understand how I > should identify subjects, within group (i.e. intervention vs. > control) or within time (0=baseline, 1=post)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. If you were using subject2 instead of subject there would (I *think*) be no difference between the two formulations. HTH cheers, Rolf Turner -- Rolf Turner Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 Home phone: +64-9-480-4619
> > 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. S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
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}}