[R] GLMM in R

Ben Bolker bbolker at gmail.com
Sat Jun 1 18:21:38 CEST 2013


Milan Bouchet-Valat <nalimilan <at> club.fr> writes:

> 
> Le vendredi 31 mai 2013 à 22:27 -0300, Luis Fernando García Hernández a
> écrit :
> > Dear Friends,
> > 
> > I am new on R so I ask you to excuse me if this question sounds fool. I
> > want to see if there is a significativa relationship between the mating
> > (response variable) and several explanatory variables such as individual
> > number (categorical), leg movemente (continous) and the reuse of
> > individuals (categorical). My data looks like this
> > 

 [snip]

> > MatingIDReplicationShaking1M1R1100M1R2140M2R1150M2R
  2121M3R1140M3R2171M4R1190
> > M4R2221M5R1180M5R2161M6R117

 Your data seem to have gotten mangled in pasting (the mailing
list doesn't take HTML-format postings), so I'm
not *quite* sure what's going on here ...

> > 
> > 
> > 
> > 1 means mating happened, 0 means did not occur.
> > 
> > I am trying to organize the data to apply a GLMM to
>  the data, but have not
> >  been able to do it.I followed the model proposed by CRawley 
> for binary
> > response with pseudorreplication but does not wok. The script goes like this
> > 
> > model2<-lmer(Mating~Replication+(1 ID),family=binomial,method=PQL)

  As pointed out, there is at least one thing wrong here, and it
essentially has to do with following a printed/dead-tree representation
when lmer is a fairly rapidly moving target.

  As well as being obsolete, the method argument should have been
a string ("PQL") in any case.

  I would suggest

glmer(Mating~...+(1|ID), family=binomial,data=...)

(I strongly recommend the use of a 'data' argument to pass
the model variables rather than pulling them from the workspace.

  Further questions should probably go to
r-sig-mixed-models at r-project.org

> > 
> > Can somebody tell me what part is wrong and how could
> I fix it? If you know
> > a better method, will be really welcomed!
> You do not tell us what you mean by "wrong", but at least in the form
> above it will not work. Try with (1|ID), and use "REML" and "nAGQ"
> arguments instead of the deprecated "method".
>



More information about the R-help mailing list