[R] Random effect in an Incomplete block design
Reza Deihimfard
deihim59 at yahoo.com
Mon May 21 22:36:18 CEST 2012
Dear R Users,
I am facing a problem analyzing an incomplete block design with two replicates. As you can see in the attached .xls file, the factor2 (6 levels) nested within factor1(two levels) nested within replicates all were chosen as random effects in the statistical model (see below). Note that the replicates are incomplete. The effect of year crossed with these factors as random. To handle incomplete design and random effects, I used lme package instead of aov as follows:
library(nlme)
data<- read.table("C:\\Users\\user\\Desktop\\sb.txt",header=T)
attach(data)
model<-lme(var~1+ year+ year*replicates+ year*factor1+ year*factor2, random=~1|replicates/factor1/factor2)
summary(model)
The above-code is runnable. However, could you please make me sure of the following points?
1- Have I defined the interactions correctly (particularly year by other factors) ?
2- Which one should I include into the statistical model, replicates or block.incomplete?
3- How can I compare different levels of each factor (i.e. factor1, factor2, year)? In other words, is there any way to use LSD or SED methods in the package lme?
Your help would be highly appreciated.
Best regards,
Reza
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sb.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120521/211c3245/attachment.txt>
More information about the R-help
mailing list