[R-sig-ME] multiple random effects in lmer and glmmPQL

Douglas Bates bates at stat.wisc.edu
Thu Jul 3 14:53:18 CEST 2008


Just a quick comment that REML is not allowed as an estimation
criterion for generalized linear mixed models.  The only option, and
hence the default, is maximum likelihood estimation of the parameters
based on the Laplace approximation to the log-likelihood.  Bin Dai is
working on incorporating adaptive Gauss-Hermite quadrature (AGQ) as an
alternative approximation in the cases where it makes sense to
evaluate it.

I will take this opportunity to give a pre-vacation message.  I will
be off the net for the next week, relaxing in a beautiful home on a
lake in Canada, sleeping and reading novels.  Do enjoy yourselves
while I am gone.

On Thu, Jul 3, 2008 at 4:32 AM, Mike Dunbar <mdu at ceh.ac.uk> wrote:
> Dear Pablo
>
> You may be trying to make things too complicated. Are you interested purely in random intercept components or random slopes with respect to particular covariates as well? Providing you are just interested in random intercepts then your model structure then your model would simply be:
>
> lmer(Y~X+W+Z + (1|region/route), method="REML", data=ac, family=poisson)
>
> lmer will correctly deduce from the way that the covariates vary with the groups that X is at a different level from W and Z. If you really are interested in testing for random slopes then it looks like you have quite a complicated model, it is still worth starting with the simpler models to explore the data then you may need to consult with a professional statistican face to face.
>
> regards
>
> Mike
>
>
>>>> logodall <logodall at yahoo.fr> 02/07/2008 16:46 >>>
> I was hoping to obtain some guidance for the specification of a mixed
> model in the following analysis that I have been trying to do with
> glmmPQL. My problem is that I am unsure on how to specify multiple random effects associated with different
> covariates at different spatial scales.
> * Response variable: a integer variable Y that are counts of birds in a
> route over time (12 years, one count per year, there might be temporal
> autocorrelation, hence my interest in using the library nlme)
> * Explanatory variables : three continuous variables measured over
> time: X is measured at the route level and W and Z are measured at the
> regional level (there are many  >10 routes in each of the 24 regions)
> * The goal: to determine the extent to which Y (at the route level) is
> determined by X,W and Z, knowing that each  covariate was estimated at
> different spatial scales (route, region), and that  each of these
> scales are organized in a nested manner (routes within regions)
>
> I have been trying to fit the model with lmer:
> lmer(Y~X+W+Z + (X|region/route)+(W|region)+(Z|region), method="REML", data=ac, family=poisson)
> and it seems to be doing the right things, though I am not 100% sure
> that I am correctly specifying that each explanatory variable is
> measured at different spatial resolution. Any words of wisdom would be
> appreciated.
>
> However, when passing to glmmPQL (because I need to test for temporal
> autocorrelation), I am encountering problems to fit the very same model
> (asumming that it is correct). I have tried:
> glmmPQL(Y~X+W+Z, random= list(~X|region/route, ~W|region,~Z|region) and I obtain an error message
> Error in logLik.reStruct(object, conLin) :
>  NAs in foreign function call (arg 2)
> In addition: Warning messages:
> 1: In ncols * isLast :
>  longer object length is not a multiple of shorter object length
> 2: In ncols * c(rep(1, Q), 0, 0) :
>  longer object length is not a multiple of shorter object length
> I have also tried :
> glmmPQL(Y~X+W+Z, random= (X|region/route +W|region+Z|region) and though
> it gives an answer, I am far from certain to know what it does.
>
> Before posting this message, I have read most of the threads of this
> list, searched for help in general forums of R, and looked at the main
> textbooks (Pinheiro & Bates and others) without much success.
>
> To rephrase the question: how to specify the structure of random
> effects to specify multiple random effects associated with different
> covariates at different spatial scales?
> Many thanks for any help/suggestions
> Sincerely,
> Pablo Inchausti
>
>
>
>      _____________________________________________________________________________
>
> o.fr
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
> --
> This message (and any attachments) is for the recipient ...{{dropped:6}}
>
> _______________________________________________
> 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