Guillaume Théroux Rancourt
2010-Feb-26 21:06 UTC
[R] factorial block design with missing data
Hello! I have read somewhere (somehow, I can't seem to find it again, it's been a couple of months) that when analyzing factorial block design, the position where you put the block factor is important, even more when there are missing values. I understand that when using anova.lm, the order is sequential, so that if I want to check for a treatment effect, I should put my blocking factor before in order to . It's just that I got confused with all the answers from previous posts and books, and I don't know if the missing values are being handled properly. My code is: P.biom = lm(biomass ~ Bloc + Trt*Clone, data=mydata) P.aov = anova.lm(P.biom, test="F")> anova.lm(P.ar.2, test="F")Analysis of Variance Table Response: M_aerien Df Sum Sq Mean Sq F value Pr(>F) Bloc 2 139.7 69.9 0.4054 0.6710 Trt 1 31069.5 31069.5 180.2905 6.227e-13 *** Clone 7 1206.2 172.3 0.9999 0.4544 Trt:Clone 7 570.3 81.5 0.4728 0.8450 Residuals 25 4308.2 172.3 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Thank you very much. Guillaume Th?roux Rancourt Ph.D. candidate --- Plant Biology Universit? Laval, Qu?bec, QC, Canada guillaume.theroux-rancourt.1 at ulaval.ca
Guillaume Th?roux Rancourt writes:> > Hello! > > I have read somewhere (somehow, I can't seem to find it again, > it's been a couple of months) that when > analyzing factorial block design, the position where you put > the block factor is important, even more > when there are missing values. > > I understand that when using anova.lm, the order is sequential, > so that if I want to check for a treatment > effect, I should put my blocking factor before in order to . > It's just that I got confused with all the > answers from previous posts and books, and I don't know if > the missing values are being handled properly. > > My code is: > P.biom = lm(biomass ~ Bloc + Trt*Clone, data=mydata) > P.aov = anova.lm(P.biom, test="F") >[snip] Sorry to make things even more complicated, but *if* you are dealing with a large number of missing values you might want to consider using the lme() function (in the nlme package), along with its companion book by Pinheiro and Bates (2000); the methods used in that package should be more robust to lack of balance than lm/aov ... Ben Bolker