[R-sig-ME] GlmmADMB: random slopes and fixed effects

Genevieve Perkins genevieve.c.perkins at gmail.com
Fri May 1 15:54:30 CEST 2015


Thanks Ken and Ben for your help.

On 29 April 2015 at 20:52, Ben Bolker <bbolker at gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 15-04-29 07:58 PM, Ken Beath wrote:
> > A random effect for a slope means that the slopes have a random
> > distribution about the fixed effect. For example if the fixed
> > effect is 5 then the slopes for each species will be distributed
> > around this value. So one species may have a slope of 4 and another
> > 5.6. Why it is sensible to have a fixed effect is that it is
> > usually not realistic for the mean slope to be zero, that is to
> > have the random slopes distributed around zero. That would imply
> > that some slopes are negative.
>
>    I would frame it slightly differently ...
>
>    In the absence of evidence to the contrary (see
> example(ranef.merMod) for some ways of plotting the random effects), I
> would probably encourage you to retain species as a random effect,
> while perhaps simplifying the random effect (as suggested by Thierry
> Onkelinx below). Perhaps you can add some species-level covariates
> (average body mass, habitat preference -- perhaps that's what 'trait'
> is?) -- it's the *deviations* from the species-level predictions based
> on fixed effects, on the log scale, that need to be Normal, not the
> species-level predictions themselves.
>
>    It's fine to have negative slopes -- that would just imply that the
> expected response decreased when the covariate increased.  What's
> unusual about a model that contains a random effect without the
> corresponding fixed effect is that it assumes the average effect
> across groups is exactly zero.  The only contexts I can think of in
> which this makes sense are (1) if the data have already manipulated so
> that the expected effect is standardized to zero (e.g. meta-analyses);
> (2) as a null model for testing whether the average effect is non-zero.
>
> >
> > On 29 April 2015 at 23:56, Genevieve Perkins
> > <genevieve.c.perkins at gmail.com> wrote:
> >
> >> Hi Thierry, Thanks for the response and great advice.
> >>
> >> I have 25 species, 59 sites and total of 1475 observations
> >> (including absences). I didn't mention in the post, but I
> >> centered all my predictor variables prior to fitting the model
> >> (except trait,which is coded as -1 or +1 for ease of
> >> interpretation).
> >>
> >> I am able to run the model both with and without fixed affects :
> >>
> >> fitn <- glmmadmb(bird.abund ~ Cats + trait + Cat:trait + Veg +
> >> Pop + (1 + Veg + Pop + Cats|Species), data = bdata, family=
> >> "nbinom").
> >>
> >> The parameters for the random slope do not have normal
> >> distributions, so I will take your advice and also include these
> >> as fixed effects.
> >>
> >> Could you suggest any references which explain how random slopes
> >> are treated. I have mainly been using Zurr, Gelman and Hill,
> >> chapters from Ecological Statistics (eds. Fox et al.) and online
> >> postings.
> >>
> >> Thanks again!
> >>
> >>
> >>
> >>
> >>
> >> On 29 April 2015 at 03:51, Thierry Onkelinx
> >> <thierry.onkelinx at inbo.be> wrote:
> >>
> >>> Dear Genevieve,
> >>>
> >>> An observation level random effect (OLRE) is used in a poisson
> >>> or
> >> binomial
> >>> glmm to model the overdispersion. The negative binomial
> >>> distribution has
> >> a
> >>> parameter that handles the overdispersion. So you don't need
> >>> the ORLE.
> >>>
> >>> Note that the as.formula() is not required.
> >>>
> >>> Random slopes assume that the parameters follow a normal
> >>> distribution
> >> with
> >>> zero mean. When the overall slope is not zero, this assumption
> >>> is
> >> violated
> >>> when the variable is not used as a fixed effect.
> >>>
> >>> Note that you better center random slopes to get more stable
> >>> estimates.
> >> Do
> >>> you have enough data to fit such a complex model? The variance
> >>> covariance matrix of the Species random effect requires 10
> >>> parameters. I would
> >> strive
> >>> for >100 observations per species and >10 species.
> >>>
> >>> Best regards,
> >>>
> >>> ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek /
> >>> Research Institute for Nature
> >> and
> >>> Forest team Biometrie & Kwaliteitszorg / team Biometrics &
> >>> Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium
> >>>
> >>> To call in the statistician after the experiment is done may be
> >>> no more than asking him to perform a post-mortem examination:
> >>> he may be able to
> >> say
> >>> what the experiment died of. ~ Sir Ronald Aylmer Fisher The
> >>> plural of anecdote is not data. ~ Roger Brinner The combination
> >>> of some data and an aching desire for an answer does not ensure
> >>> that a reasonable answer can be extracted from a given body of
> >> data.
> >>> ~ John Tukey
> >>>
> >>> 2015-04-28 22:41 GMT+02:00 Genevieve Perkins <
> >>> genevieve.c.perkins at gmail.com>:
> >>>
> >>>> Hello,
> >>>>
> >>>> I am a masters student new to the world of GLMMs. I have
> >>>> developed a
> >> mixed
> >>>> model using the glmmADMB package and I have been scouring the
> >>>> literature and help files, and trying to find an answer to my
> >>>> questions with no success.
> >>>>
> >>>> I want to estimate the effect of cats on bird abundance for
> >>>> birds with particular traits (all traits are binary coded
> >>>> (0,1); Specifically I am looking at the interaction
> >>>> estimate.
> >>>>
> >>>> I included species as a random effect, and I wanted the
> >>>> species response to vary with Vegetation (Veg) and Population
> >>>> (Pop). I also added a random level observation term.
> >>>>
> >>>> Model 1: fitn <- glmmadmb(as.formula(bird.abund ~ Cat + trait
> >>>> + Cat:trait + (1 + Veg + Pop + Cat|Species) + (1|ID)), data =
> >>>> bdata,family=
> >> "nbinom")
> >>>>
> >>>>
> >>>> I noticed however that if I include Veg and Pop as fixed
> >>>> effects (model
> >> 2)
> >>>> my model estimate for cats at the fixed effect level and
> >>>> species level also change.
> >>>>
> >>>> Model 2: fitn <- glmmadmb(as.formula(bird.abund ~ Cats +
> >>>> trait + Cat:trait + Veg + Pop + (1 + Veg + Pop +
> >>>> Cats|Species) + (1|ID)), data = bdata, family= "nbinom")
> >>>>
> >>>>
> >>>> My questions are: 1)  Is it possible to include varying slope
> >>>> coefficients (ie: Veg and
> >> Pop)
> >>>> in a GLMM model without including them as fixed effects? (I
> >>>> couldn't
> >> find
> >>>> any examples of this format)
> >>>>
> >>>> 2) How are the estimates for the random effects treated
> >>>> without a corresponding fixed effect in Glmmadmb. I was
> >>>> guessing they may be pooled to a group mean of zero, but I
> >>>> was not able to find this information in the glmmadmb
> >>>> literature.
> >>>>
> >>>> All suggestions greatly appreciated! Thanks
> >>>>
> >>>> [[alternative HTML version deleted]]
> >>>>
> >>>> _______________________________________________
> >>>> 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
> >>
> >
> >
> >
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iQEcBAEBAgAGBQJVQXy0AAoJEOCV5YRblxUHyEYIAImiOMFEfUxLfcYincSo7nM+
> gI7sykoIEOiY3Pg32DH2lh5/gcCi19ezWBJlQtKgA0ZVBC9PoUDN6PkD+CiR4Tq/
> YghExE/axBE8/mOnkhCtqulkx6ZsVbMvq+6efPG8Xc7YEp8obNnruW56co0/1/Sr
> 8JRK+07HqtD9ocjcKrJ6rF0Zv175+LSBVpiT+UslbObV1/l1NxfCrBVQDIJ9AKw9
> VgxSiuX7A57JlLhbSzYD/f0WSDLk9C2XbRt1S7azfcFsJBZdFXzi4R4pwsgoxXDO
> 9zh+XSXgCv6xqv851gz58DqI8kaloHrcCFgNdNMacWOqPnBLReQabUYJ+40tNLU=
> =JtYy
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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