Hi, I have an experiment with 2 independant factors which I have been trying to analyse in R. The problem is that there are several data points recorded on the same animal. However, no combination of treatments is repeated on the same animal. All possible combinations of treatments are done in a random order with as many points as possible being done on 1 animal before moving onto the next. The suggested way to remove pseudoreplication is to average the points from the same animal. However, as my measures on the same animal are of different treatment combinations so this makes no sense. It is also suggested that as I have random and fixed effects I should use a mixed effects model. However, given that my independant variables are factorial I am not sure how to incorporate this. I would be very grateful for any advice on methods of getting round this problem or whether I have sufficiently accounted from my none independant measures experimentally. Many thanks, Natalie -- View this message in context: http://www.nabble.com/2-way-ANOVA-with-possible-pseudoreplication-tp23295845p23295845.html Sent from the R help mailing list archive at Nabble.com.
Hi Natalie, It sounds like a mixed model might be appropriate but it's not completely clear what your data are like. How many levels are there of each factor? Or is each factor just binary (treatment or no treatment)? What did you measure as the response? It's a good idea to post a sample of your data, or at least some dummy data with the same structure, so that we can see what it's like. It sounds like you don't have pseudo replication but you do have repeated measures (same animal used for more that 1 observation) and missing observations (not all treatment / treatment combinations measured for each animal). A mixed effects model with a random effect for animal might be appropriate but it would depend on how many animals you have, how many treatment combos there were and how many treatment combos each animal got on average. Also knowing the order treatments were given to each animal might help. Andy. andydolman@gmail.com 2009/4/29 nat_h <fbsnch@leeds.ac.uk>> > Hi, > > I have an experiment with 2 independant factors which I have been trying to > analyse in R. The problem is that there are several data points recorded on > the same animal. However, no combination of treatments is repeated on the > same animal. All possible combinations of treatments are done in a random > order with as many points as possible being done on 1 animal before moving > onto the next. > > The suggested way to remove pseudoreplication is to average the points from > the same animal. However, as my measures on the same animal are of > different > treatment combinations so this makes no sense. It is also suggested that as > I have random and fixed effects I should use a mixed effects model. > However, > given that my independant variables are factorial I am not sure how to > incorporate this. I would be very grateful for any advice on methods of > getting round this problem or whether I have sufficiently accounted from my > none independant measures experimentally. > > Many thanks, > > Natalie > -- > View this message in context: > http://www.nabble.com/2-way-ANOVA-with-possible-pseudoreplication-tp23295845p23295845.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. >[[alternative HTML version deleted]]
Well, it's clearly not pseudoreplication if it's not replication! But the observations within animal could well be associated. You seem to have a straightforward experiment with multiple treatment combinations on multiple subjects. You could do several things. The most obvious is probably to consider 'animal' (or 'subject') as a random effect. You can do that with lme or lmer: lme(y~trt1*trt2, random=1|animal, data=...) or lmer(y~trt1*trt2+(1|animal), data=...) If you have a balanced design (all treatment combinations on all animals) and the treatments can reasonably be considered as fixed effects, you have a blocked design that can be analysed with a model of the form y~trt1*trt2+block (it is, under those circumstances, valid to compare treatment effects directly with the residual term; the 'block' effect just drops out as long as it's additive) or, using aov, with summary(aov(y~trt1*trt2+Error(block), data=.. )) That would make me nervous if different animals were given different sets of treatment combinations unless you'd been really clever and used a balanced incomplete block design (you'd certainly know if you had planned it that way!) The other obvious questions are whether treatments were applied in a consistent order, as a cross-over design or in randomised order, and whether there is carry-over. Carry-over and the related cross-over designs are distinctly outside my experience, though; chemists can normally ignore carry-over. I assume there's a biostatistician in the house... ... and of course I'm naively assuming that the treatments are factors and that you aren't studying dose-response curves or other things that need gradient terms. If you are, I suppose you'll want to look at Pinheiro and Bates rather carefully... Steve e>>> nat_h <fbsnch at leeds.ac.uk> 29/04/2009 13:43 >>>Hi, I have an experiment with 2 independant factors which I have been trying to analyse in R. The problem is that there are several data points recorded on the same animal. However, no combination of treatments is repeated on the same animal. All possible combinations of treatments are done in a random order with as many points as possible being done on 1 animal before moving onto the next. The suggested way to remove pseudoreplication is to average the points from the same animal. However, as my measures on the same animal are of different treatment combinations so this makes no sense. It is also suggested that as I have random and fixed effects I should use a mixed effects model. However, given that my independant variables are factorial I am not sure how to incorporate this. I would be very grateful for any advice on methods of getting round this problem or whether I have sufficiently accounted from my none independant measures experimentally. Many thanks, Natalie -- View this message in context: http://www.nabble.com/2-way-ANOVA-with-possible-pseudoreplication-tp23295845p23295845.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
Hi Natalie, The fact that there's a non-linear relationship between frequency and power does not matter if you treat power as a categorical variable rather than continuous. So like Steve suggested above: Using the lme4 package lmer(power~freq*short+(1|animal), data=...) would seem a good starting point. Make sure that frequency and shortening are treated as factors. Alternatively the nlme package lme(power~freq*short, random=1|animal, data=...) Andy. ---------- Forwarded message ---------- From: Natalie Holt <fbsnch at leeds.ac.uk> Date: 2009/5/1 Subject: Re: [R] 2 way ANOVA with possible pseudoreplication To: Andrew Dolman <andydolman at gmail.com> Hi Andy, Thanks ever so much for your reply. I have attached the general layout of my data with some more infomation on how it was collected. If you have any ideas they would be much appreciated. Many thanks, Natalie So I?ve measured muscle power output (continuous) for 3 different shapes of contraction cycle (25, 50 and 75% shortening) at 3 different frequencies. So I have 9 possible combinations. I have several replicates of each treatment. I randomized the order in which I did all 9 treatments and did as many as possible on one animal before moving on to the next. There are between 1 and 4 treatments on any one animal. There is only ever 1 replicate of any 1 treatment on a single animal. I could do a mixed effect model however it is well established that the power frequency relationship is non-liner with an optimum value at around 5. I believe it is possible to do a non-linear mixed effects model. However I do not have an equation describing this non-linear relationship. Is this still possible to do?? Quoting Andrew Dolman <andydolman at gmail.com>: Hi Natalie,> > It sounds like a mixed model might be appropriate but it's not completely > clear what your data are like. How many levels are there of each factor? Or > is each factor just binary (treatment or no treatment)? What did you > measure > as the response? It's a good idea to post a sample of your data, or at > least > some dummy data with the same structure, so that we can see what it's like. > > It sounds like you don't have pseudo replication but you do have repeated > measures (same animal used for more that 1 observation) and missing > observations (not all treatment / treatment combinations measured for each > animal). A mixed effects model with a random effect for animal might be > appropriate but it would depend on how many animals you have, how many > treatment combos there were and how many treatment combos each animal got > on > average. Also knowing the order treatments were given to each animal might > help. > > > > Andy. > > > > > > andydolman at gmail.com > > > 2009/4/29 nat_h <fbsnch at leeds.ac.uk> > > >> Hi, >> >> I have an experiment with 2 independant factors which I have been trying >> to >> analyse in R. The problem is that there are several data points recorded >> on >> the same animal. However, no combination of treatments is repeated on the >> same animal. All possible combinations of treatments are done in a random >> order with as many points as possible being done on 1 animal before moving >> onto the next. >> >> The suggested way to remove pseudoreplication is to average the points >> from >> the same animal. However, as my measures on the same animal are of >> different >> treatment combinations so this makes no sense. It is also suggested that >> as >> I have random and fixed effects I should use a mixed effects model. >> However, >> given that my independant variables are factorial I am not sure how to >> incorporate this. I would be very grateful for any advice on methods of >> getting round this problem or whether I have sufficiently accounted from >> my >> none independant measures experimentally. >> >> Many thanks, >> >> Natalie >> -- >> View this message in context: >> >> http://www.nabble.com/2-way-ANOVA-with-possible-pseudoreplication-tp23295845p23295845.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> 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. >> >> >