Skip to content
Prev 4317 / 20628 Next

RE : RE : Questions about mix models

Alena,

With simulated data and with your model structure, it converged with no apprent problem (see code below). It is difficult with the actual info, however, to see where the problem originates. Can you return the following commands:

1) xtabs(~ mead + trans + top + depth, your_datafile)
2) summary(your_datafile, 35)
3) str(your_datafile)

--------------------------------------------------------------------------------------
require(lme4)
set.seed(1001)
mead <- rep(c(1:35), each = 12)
trans <- rep(c(1:3), each = 4, time = 35)
top <- rep(c("A","B"), each = 2, time = 105)
depth <- rep(c("S","V"), time = 210)
number <- rpois(420, 207)
P <- rnorm(420, 1.7, 0.5)
K <- rnorm(420, 15, 5)
VVS <- runif(420, 0, 1)
datafile <- as.data.frame(cbind(mead, trans, top, depth, number, P, K, VVS))
datafile$number <- as.integer(datafile$number)
datafile$P <- as.numeric(P)
datafile$K <- as.numeric(K)
datafile$VVS <- as.numeric(VVS)
a2<-glmer(number~top + depth + P + K + VVS + (1|mead/trans/top), family=poisson, data=datafile)
summary(a2)
--------------------------------------------------------------------------------------

Julien Beguin

PS: adding your session info might also be a good idea


________________________________________
De : Luca Borger [lborger at uoguelph.ca]
Date d'envoi : 16 ao?t 2010 15:49
? : Alena Drasnarov?; Julien Beguin
Cc : r-sig-mixed-models at r-project.org
Objet : Re: [R-sig-ME] RE :  Questions about mix models

Hello,

given that you are interested in investigating the effects of a series of
predictors (e.g. moisture) on the number of seeds, whilst using random
effects to account for your sampling design, I would actually suggest to fit
your model without "top" also as fixed effect. Something like:

glmer(number ~ depth + HPV + K + VVS +
(1|mead/trans/top),data=dat,family=poisson)

HTH, just my 2 cents.


Cheers,

Luca


----- Original Message -----
From: "Alena Drasnarov?" <drasnarova.alena at gmail.com>
To: "Julien Beguin" <julien.beguin.1 at ulaval.ca>
Cc: <r-sig-mixed-models at r-project.org>
Sent: Monday, August 16, 2010 1:38 PM
Subject: Re: [R-sig-ME] RE : Questions about mix models


Julien, thank you for your reaction.
1) Below you can see structura of my data (for 1 meadow)

        mead trans top depth number man litt water pH Ca K Mg P N C  VVS  1
1 A S 605 L 8.6 0 5.28 40.667 8.000 14.292 1.903 0.165 14.068 0.199  1 1 A V
582 L 8.6 0 5.28 40.667 8.000 14.292 1.903 0.165 14.068 0.199  1 1 B S 135 L
10.5 208 4.49 3.629 4.484 2.387 1.889 0.185 10.173 0.096  1 1 B V 153 L 10.5
208 4.49 3.629 4.484 2.387 1.889 0.185 10.173 0.096  1 2 A S 3 L 2.6 182
5.90 114.113 33.967 27.520 1.848 0.167 8.782 0.457  1 2 A V 2 L 2.6 182 5.90
114.113 33.967 27.520 1.848 0.167 8.782 0.457  1 2 B S 18 L 7.7 332 5.48
133.495 9.194 41.580 1.769 0.252 11.612 0.252  1 2 B V 57 L 7.7 332 5.48
133.495 9.194 41.580 1.769 0.252 11.612 0.252  1 3 A S 387 L 5.4 0 5.84
266.500 8.588 51.103 1.777 0.211 18.139 0.232  1 3 A V 462 L 5.4 0 5.84
266.500 8.588 51.103 1.777 0.211 18.139 0.232  1 3 B S 62 L 4.5 5 5.32
227.184 15.444 47.302 1.895 0.337 14.172 0.313  1 3 B V 22 L 4.5 5 5.32
227.184 15.444 47.302 1.895 0.337 14.172 0.313
Only on 2 meadows there are some missing data. But I prefer to use these
plots too.

2)
I did not try my model without top in random part. I can try it, but I think
that the model will lost important information about my design. About deegre
of freedom, I am not sure how to calculate them.

Alena
























































































































































































































































































































































































































Dne 16. srpna 2010 15:26 Julien Beguin <julien.beguin.1 at ulaval.ca>
napsal(a):
Have you tried to exclude variable 'top' from the random component: only
(1|mead/trans) ? does it improve convergence? and do you get the appropriate
number of degree of freedom for your fixed effects (based on your
experimental design)?
r-sig-mixed-models-bounces at r-project.org] de la part de Alena Dra??narov?? [
drasnarova.alena at gmail.com]
them.
a2<-glmer(number~top+depth+HPV+K+VVS+(1|mead/trans/top),data=dat,family=poisson)
=1,n=1),G2=list(V=1,n=1),G3=list(V=1,n=1)))
random=~mead+mead:trans+mead:trans:top, family = "poisson",
data=dat,prior=prior)
--------------------------------------------------------------------------------