David Elliott
2006-Mar-25 02:41 UTC
[R] Trouble phrasing an R command that will run the model i need (ANOVA, nes
Hi John, Thank-you very much for replying, - in answer to your questions: *"As I understand what you wrote, all factors but linelabel are crossed, with linelabel nested within all the other factors?" That's exactly it, *" What is in the highest order cells? Single observations, or multiple scores?" I would say "single observations" - but i have to confess I'm not entirely sure what you mean by "multiple scores". Any one data point refers to a single animal (an individual fly, to be exact) giving a single value for a response variable, and having a single state with respect to each factor. One of my datasets involves crosses rather than flies, but it's the same set-up for them: each individual cross only gives one value for a response variable, and has one state with respect to each factor. Just in the interests of clarifying things as much as possible: one of my datasets looks like this(apologies if the formatting gets weird): foresttype region crosstype experiment linelabel yproductivity l g wx 1 al1 63 l g wx 1 al2 26 ... and so on. Each horizontal line refers to a single observation. The first horizontal line, for example, refers to a single cross that was found to have a yproductivity value of "63", and that cross happened to be in the "l" foresttype, the "g" region, it was crosstype "wx", in experiment "1", and of linelabel "al1". And any one cross only appears once in the dataset, so each horizontal line refers to a distinct cross, about which a single observation has been made. Is that the kind of information you were looking for? - David>From: John Vokey <vokey at uleth.ca> >To: dalelemu at hotmail.com >Subject: RE: [R] Trouble phrasing an R command that will run the model i > need (ANOVA, nested) >Date: Fri, 24 Mar 2006 09:41:49 -0700 > >David, > I could probably help you with aov(), but I need more information about >your design. As I understand what you wrote, all factors but linelabel >are crossed, with linelabel nested within all the other factors? What is >in the highest order cells? Single observations, or multiple scores? > > BTW, Anova() has no methods for the output from aov(), you need to use >summary(aov()); hence, the type III SS of Anova() aren't directly >available for aov(). But, you wouldn't want them anyway, because they >aren't the type III SS you probably were expecting (e.g., such as those >found in SAS or SuperAnova). >
John Vokey
2006-Mar-26 03:46 UTC
[R] Trouble phrasing an R command that will run the model i need (ANOVA, nes
David, Assuming I understand your design, the analysis should be straightforward (except for the possible unbalanced aspects). The summary() method for aov is usually quite good at detecting nesting, and constructing the correct SS, as long as all of the factors in your data frame are correctly as.factor(), so you shouldn't have to bother with the ``%in%'' statements in the model formula. Presumably, none of the factors are random sources, so the only random variability is associated with crosses (i.e., observations). Hence, the correct error term for all effects is the type I residual (the within-cells variance). So, summary(aov (yproductivity~foresttype*region*crosstype*experiment*linelabel)) should give you what you want (except it returns type I SS, so if your design is horribly unbalanced, the results will be misleading). On 25-Mar-06, at 4:00 AM, r-help-request at stat.math.ethz.ch wrote:> Hi John, > > Thank-you very much for replying, - in answer to your questions: > > *"As I understand what you wrote, all factors but linelabel are > crossed, > with linelabel nested within all the other factors?" > > That's exactly it, > > *" What is in the highest order cells? Single observations, or > multiple > scores?" > > I would say "single observations" - but i have to confess I'm not > entirely > sure what you mean by "multiple scores". > > Any one data point refers to a single animal (an individual fly, to be > exact) giving a single value for a response variable, and having a > single > state with respect to each factor. One of my datasets involves crosses > rather than flies, but it's the same set-up for them: each > individual cross > only gives one value for a response variable, and has one state > with respect > to each factor. > > Just in the interests of clarifying things as much as possible: one > of my > datasets looks like this(apologies if the formatting gets weird): > > foresttype region crosstype experiment linelabel yproductivity > l g wx 1 al1 > 63 > l g wx 1 al2 > 26 > ... and so on. > > Each horizontal line refers to a single observation. The first > horizontal > line, for example, refers to a single cross that was found to have a > yproductivity value of "63", and that cross happened to be in the "l" > foresttype, the "g" region, it was crosstype "wx", in experiment > "1", and of > linelabel "al1". And any one cross only appears once in the > dataset, so each > horizontal line refers to a distinct cross, about which a single > observation > has been made. > > Is that the kind of information you were looking for? > > - David-- Please avoid sending me Word or PowerPoint attachments. See <http://www.gnu.org/philosophy/no-word-attachments.html> -Dr. John R. Vokey