[R-sig-ME] [R] Random effect in an Incomplete block design

arun smartpink111 at yahoo.com
Tue May 22 03:12:45 CEST 2012


HI Reza,

This should be forwarded to r mixed group.

I would use lme4 package.
Regarding the factors nested within replicates is a bit confusing.  It is normally the other way around.  Also, I have doubts in the model statement with year*factors included as fixed effects, because you mentioned it as random.  I may be wrong.  I hope some expert from the mixed group will respond to this problem.

A.K.





----- Original Message -----
From: Reza Deihimfard <deihim59 at yahoo.com>
To: "r-help at r-project.org" <r-help at r-project.org>
Cc: 
Sent: Monday, May 21, 2012 4:36 PM
Subject: [R] Random effect in an Incomplete block design

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
______________________________________________
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.




More information about the R-sig-mixed-models mailing list