[R-sig-ME] RE : RE : Questions about mix models

Julien Beguin julien.beguin.1 at ulaval.ca
Mon Aug 16 22:15:08 CEST 2010


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):
> Alena,
>
> 1) Can you join a summary of your data. Is it a balanced design?
>
> 2) Not sure to understand how your model assigns the residual error...
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)?
>
> Julien Beguin
> ________________________________________
> De : r-sig-mixed-models-bounces at r-project.org [
r-sig-mixed-models-bounces at r-project.org] de la part de Alena Drašnarová [
drasnarova.alena at gmail.com]
> Date d'envoi : 16 août 2010 05:58
> Ã? : r-sig-mixed-models at r-project.org
> Objet : [R-sig-ME] Questions about mix models
>
> Dear all,
>  I have so complicated data and I am trying to gain correct results from
them.
>
> I am interested in factors influencing density and diversity of the
> soil seed bank on alluvial meadows. I have nested design of my
> experiment: 35 meadows (mead=M1-M35), three transects on each meadow
> (trans=T1-T3) and  2 plots on each transect (top=A,B).
> I found out  a lot of information (about soil properties, moisure,
> litter, biomass, vegetation diversity and management).
> At first, I tried to use glmer, but sometimes there was error message:
>
>>
a2<-glmer(number~top+depth+HPV+K+VVS+(1|mead/trans/top),data=dat,family=poisson)
> Warning messages:
> 1: In mer_finalize(ans) :
>  Cholmod warning 'not positive definite' at
> file:../Cholesky/t_cholmod_rowfac.c, line 432
> 2: In mer_finalize(ans) :
>  Cholmod warning 'not positive definite' at
> file:../Cholesky/t_cholmod_rowfac.c, line 432
> 3: In mer_finalize(ans) : false convergence (8)
>
> So, I decided to use MCMCglmm, but I am not sure with fitting the
> model. I tried to fitt it by this way (example below is for one
> factor):
>
>> prior=list(R=list(V=1, n=0, fix=1), G=list(G1 = list(V
=1,n=1),G2=list(V=1,n=1),G3=list(V=1,n=1)))
>> m1 <- MCMCglmm(number ~ as.factor(top),
random=~mead+mead:trans+mead:trans:top, family = "poisson",
data=dat,prior=prior)
> I am not sure with define prior and random effect.
>
> I will be very happy, if anybody write me own experiences with these
> models and similar data and help me which model is the best to use.
>
> With kind regards
> Alena Drašnarová
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

[[alternative HTML version deleted]]




--------------------------------------------------------------------------------


> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



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