[R-sig-ME] multiple random effects in lmer and glmmPQL
Luca Borger
lborger at uoguelph.ca
Thu Jul 3 16:58:18 CEST 2008
sorry, I meant to write (1|region/route)
Cheers,
Luca
----- Original Message -----
From: "Luca Borger" <lborger at uoguelph.ca>
To: "logodall" <logodall at yahoo.fr>; <r-sig-mixed-models at r-project.org>
Sent: Thursday, July 03, 2008 9:32 AM
Subject: Re: [R-sig-ME] multiple random effects in lmer and glmmPQL
Hello,
furthermore, given your goal, it might be informative to compare a model
with only random intercepts - (X|region/route) - to models with one or more
of your fixed effects added in (do the fixefs account for some of the
variance of the ranefs, and at the right level? etc.).
Hope this makes sense.
Cheers,
Luca
---------------------------
Luca Börger, PhD
Postdoctoral Research Fellow
Department of Integrative Biology
University of Guelph
Guelph, Ontario, Canada N1G 2W1
phone: +1 519 824 4120 ext. 52975
fax: +1 519 767 1656
----- Original Message -----
From: "logodall" <logodall at yahoo.fr>
To: <r-sig-mixed-models at r-project.org>
Sent: Wednesday, July 02, 2008 11:46 AM
Subject: [R-sig-ME] multiple random effects in lmer and glmmPQL
>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
>
_______________________________________________
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