[R-sig-ME] Data sheet notation and model structure for GLMM with 3 non-factorial factors
Raldo Kruger
raldo.kruger at gmail.com
Thu Sep 24 08:22:45 CEST 2009
Hi R users,
I have 3 factors in a non-factorial design (G, K and N), as well as
two time periods (Year) and a random factor (Site), with Plant numbers
as the response variable.
My 1st question relates to the the notation of the treatments in the
data frame. Is it appropriate to use an expanded treatment notation,
such as this, when using glmer{lme4}:
Site Year Plant G K N
A 1 5 0 0 0
A 1 4 1 0 0
A 1 7 0 1 0
A 1 10 0 0 1
A 2 3 0 0 0
A 2 4 1 0 0
A 2 8 0 1 0
A 2 12 0 0 1
B 1 7 0 0 0
B 1 3 1 0 0
B 1 7 0 1 0
B 1 12 0 0 1
B 2 4 0 0 0
B 2 5 1 0 0
B 2 6 0 1 0
B 2 11 0 0 1
With the model
m1<-glmer(Plant~G+K+N+Year+(1|Site), ...)
Or is it better to use a single column for the treatments, like this:
Site Year Plant Treatment
A 1 5 C
A 1 4 G
A 1 7 K
A 1 10 N
A 2 3 C
A 2 4 G
A 2 8 K
A 2 12 N
B 1 7 C
B 1 3 G
B 1 7 K
B 1 12 N
B 2 4 C
B 2 5 G
B 2 6 K
B 2 11 N
With the following model:
m1<-glmer(Plants~Treatment+Year+(1|Site), ...)
Many thanks,
--
Raldo Kruger
MSc student
University of Cape Town
More information about the R-sig-mixed-models
mailing list