Dear R users,
I'm trying to fit a crossed-effects mixed model that would include a
spatial correlation structure..
The data come from four controlled experiments (control, treatment1,
treatment2, treatment1+treatment2) on plants grown in a growth
chamber. Individual replicates of different genotypes were grown
together and response traits were measured. A covariate X is included
in the model with a quadratic form.
We fitted the following model using lmer:
fm1 <- lmer(Y ~ 1 + Trt1*Trt2*poly(X, degree=2, raw=T) +
(1|idGenotype) + (1|Trt2:idGenotype) + (1|Trt1:idGenotype) +
(1|Trt1:Trt2:idGenotype), data=...)
This model is very interesting because we can extract the BLUPs for
each genotype in each (crossed) environment.
After discussion with colleagues, it appeared that we should try to
include the possible spatial heterogeneityof the
micro-environmentwithin the growth chamber. To this end, we tried to
fit a model with lme() because we cannot easily (if possible) include
a correlation structure using lmer(). The model is:
fm2 <- lme(Y ~ (X+I(X^2))*idCondition,
random =~1|idGenotype/idCondition,
correlation=corGaus(c(15,0.95),
form=~x+y|idGenotype/idCondition, nugget=T),
data =...)
where x and y are the coordinates of the plants within the growth
chamber.
Since I was unable to fit the crossed effects Trt1 x Trt2 in lme() I
coded a new variable idCondition which is the combination of Trt1 and
Trt2, and treated genotypes within idCondition. This is not entirely
satisfying because it is impossible to extract all BLUPs as in fm1.
Could you please tell me if I missed something and ifthere is a trick
to specify crossed effects using lme()?
I assume that this should use pdClasses but I'm not at all at ease
with the matrix specification of mixed models.
Alternatively, include a correlation structure in lmer seems to be
unfeasible, am I wrong?
Thank you very much for your help,
Denis