[R-sig-ME] modeling question
Joaquín Aldabe
joaquin.aldabe at gmail.com
Thu Jan 26 22:24:21 CET 2017
ok. These are the models I wrote. I'm attaching the data frame. The
variables mean.biom is the biomass in each count, Trysu_dens is the density
of birds in each count and Plot_name is the id of each plot. Let me know if
I'm not explaining myself adequately.
1) model with random intercept:
m2=lme(Trysu_dens~mean.biom, random=~1|Plot_name, data=try.dens.biom)
2) model with random slope and intercept, centering biomass with the mean
try.dens.biom$mean.biom.c=try.dens.biom$mean.biom-152.46
m2.1=lme(Trysu_dens~mean.biom.c, random=~mean.biom.c|Plot_name,
data=try.dens.biom)
2017-01-26 16:17 GMT-03:00 Ben Bolker <bbolker at gmail.com>:
>
>
> On 17-01-26 02:11 PM, Joaquín Aldabe wrote:
> > Thanks Ben, I sent all emails to the whole list. See below (in caps lock
> > for differentiating from the other text). Regards, Joaquin
> >
> > 2017-01-26 15:59 GMT-03:00 Ben Bolker <bbolker at gmail.com
> > <mailto:bbolker at gmail.com>>:
> >
> > On Thu, Jan 26, 2017 at 9:38 AM, Joaquín Aldabe
> > <joaquin.aldabe at gmail.com <mailto:joaquin.aldabe at gmail.com>> wrote:
> > > Dear Ben, it's me again
> >
> >
> > (I don't mind if you cc: me, but this is really a question to the
> > list. Probably better to frame it as "I sent this to the list and Ben
> > Bolker said ...")
> >
> > > with this subject about invertebrate biomass and its
> > > possible effect on shorebird density. I have a couple of extra
> doubts about
> > > your recommendations:
> >
> >
> > >
> > > You suggested this:
> > >
> > > (1) The relationship between bird density and invert biomass, as
> well
> > > as the intercept (i.e., expected bird density at invert_biomass=0,
> or
> > > better invert_biomass=<some sensible reference quantity>).
> > >
> > > I tried a quantity considering the lowest value of the
> invertebrate biomass
> > > variable, but the model did not converge. So I wonder if I should
> pick this
> > > value or a different one?
> >
> > Hmm, is this with lme or lmer? Can you give more detail? If it's
> > lmer, it's quite likely a false positive. I USED LME. I DON'T REALLY
> > KNOW WHAT DO YOU EXACTLY MEAN WITH SENSIBLE REFERENCE QUANTITY. I
> > THOUGHT IT WAS THE MINIMUM VALUE OF MY X VARIABLE (AS CERO IS NOT A
> > POSSIBILITY).
> >
>
> The minimum value of your x variable is sensible. The mean or median
> would also be sensible. It will change the interpretation of your
> intercept parameter, and might improve convergence, but if the model
> does converge then it won't change the overall fit of the model.
>
> If you're using lme and re-locating your x variable (i.e. using
> I(invert_biomass-ref_value)) doesn't help with convergence, then there
> might be something else wrong. We need more information (what was the
> error message? What are the general properties of your data?) and
> preferably a reproducible example ...
>
> > >
> > > (2) The relationship might be changing over time?
> > >
> > > lme(Bird.density~Invertebrate biomass+sample_time,
> > > random=~invert_biomass|Plot_identity, data=)
> > >
> > > How should I treat sample time? Is it a ordered categorical
> variable?
> >
> > Depends on a number of things. Your original message suggested
> > that you sampled over the course of 30 days (maybe at different times
> > in different plots?) If this is the case (e.g. you sampled plot 1 on
> > days 1, 5, 9, ... and plot 2 on days 2, 6, 10 ...) then it is
> probably
> > most sensible to treat time as a numeric variable (i.e., assume a
> > linear trend over days) and possibly a random effect with days as a
> > grouping variable (in which case you might have to switch from lme to
> > lmer). If you have a small number of distinct sample days then a
> > categorical variable makes sense. Whether you specify it as ordered
> or
> > (default) unordered doesn't affect the overall fit of the model, just
> > the particular contrasts that get tested with respect to the time
> > variable.
> >
> >
> > >
> > > Thankyou very much.
> > >
> > > Joaquin
> > >
> > >
> > > 2017-01-16 19:49 GMT-03:00 Ben Bolker <bbolker at gmail.com
> > <mailto:bbolker at gmail.com>>:
> > >>
> > >>
> > >> Center your biomass variable on this value: either create a
> > >>
> > >> mydata$invert_biomass_c <- mydata$invert_biomass-ref_value
> > >>
> > >> or include it directly in your formula:
> > >>
> > >> bird_dens ~ I(invert_biomass-ref_value), ...
> > >>
> > >> On 17-01-16 05:44 PM, Joaquín Aldabe wrote:
> > >> > Thankyou very much Ben. Can you please suggest a way of fixing
> some
> > >> > sensible reference quantity for Invertebrate biomass?
> > >> > All the best,
> > >> > Joaquín
> > >> >
> > >> > 2017-01-16 18:59 GMT-03:00 Ben Bolker <bbolker at gmail.com
> > <mailto:bbolker at gmail.com>
> > >> > <mailto:bbolker at gmail.com <mailto:bbolker at gmail.com>>>:
> > >> >
> > >> > That seems perfectly reasonable. There are a couple of
> > things to
> > >> > consider, although you may or may not find that your data
> > supports
> > >> > that much complexity.
> > >> >
> > >> > (1) The relationship between bird density and invert
> > biomass, as
> > >> > well
> > >> > as the intercept (i.e., expected bird density at
> > invert_biomass=0,
> > >> > or
> > >> > better invert_biomass=<some sensible reference quantity>)
> > >> >
> > >> > lme(Bird.density~Invertebrate biomass,
> > >> > random=~invert_biomass|Plot_identity, data=)
> > >> >
> > >> >
> > >> > (2) The relationship might be changing over time?
> > >> >
> > >> > lme(Bird.density~Invertebrate biomass+sample_time,
> > >> > random=~invert_biomass|Plot_identity, data=)
> > >> >
> > >> > (3) In principle you could consider random effects of both
> > time and
> > >> > invert biomass, but that will almost certainly overwhelm
> > your data.
> > >> >
> > >> > Don't forget to do the standard post-fitting checks: are
> your
> > >> > residuals *approximately* equal-variance and (even more
> > >> > approximately)
> > >> > Normally distributed? Is the relationship between bird
> > density and
> > >> > invert biomass *approximately* linear? (See ?plot.lme)
> > >> >
> > >> >
> > >> > On Mon, Jan 16, 2017 at 2:06 PM, Joaquín Aldabe
> > >> > <joaquin.aldabe at gmail.com <mailto:joaquin.aldabe at gmail.com>
> > <mailto:joaquin.aldabe at gmail.com <mailto:joaquin.aldabe at gmail.com>>>
> > wrote:
> > >> > > Dear all, I'm interested in modeling the effect of
> > invertebrate
> > >> > biomass on
> > >> > > the density of a grassland shorebird (they eat
> > invertebrates). For
> > >> > this, I
> > >> > > picked 8 plots and sampled invertebrates and birds 6
> > times in each
> > >> > plot for
> > >> > > about 30 days. This is, I went to each plot and did
> repeated
> > >> > measures of
> > >> > > invertebrates biomass and shorebird density separated in
> > time by
> > >> > four or
> > >> > > five days, as invertebrates biomass may change over time
> > and it is
> > >> > expected
> > >> > > that birds density change accordingly.
> > >> > >
> > >> > > So, I'm trying to see a general pattern of the effect of
> > changes
> > >> > in biomass
> > >> > > on the density of this shorebird species at a plot scale.
> > Plot
> > >> > identity is
> > >> > > not important; I consider them as particular events of a
> > random
> > >> > process.
> > >> > >
> > >> > > Is this model correct:
> > >> > >
> > >> > > lme(Bird.density~Invertebrate biomass,
> > random=~1|Plot_identity,
> > >> > data=)
> > >> > >
> > >> > > Thank you very much,
> > >> > >
> > >> > > Joaquin.
> > >> > >
> > >> > >
> > >> > > --
> > >> > > *Joaquín Aldabe*
> > >> > >
> > >> > > *Grupo Biodiversidad, Ambiente y Sociedad*
> > >> > > Centro Universitario de la Región Este, Universidad de la
> > >> > República
> > >> > > Ruta 15 (y Ruta 9), Km 28.500, Departamento de Rocha
> > >> > >
> > >> > > *Departamento de Conservación*
> > >> > > Aves Uruguay
> > >> > > BirdLife International
> > >> > > Canelones 1164, Montevideo
> > >> > >
> > >> > > https://sites.google.com/site/joaquin.aldabe
> > <https://sites.google.com/site/joaquin.aldabe>
> > >> > <https://sites.google.com/site/joaquin.aldabe
> > <https://sites.google.com/site/joaquin.aldabe>>
> > >> > >
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe>
> > >> >
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe>>>
> > >> > >
> > >> > > [[alternative HTML version deleted]]
> > >> > >
> > >> > > _______________________________________________
> > >> > > R-sig-mixed-models at r-project.org
> > <mailto:R-sig-mixed-models at r-project.org>
> > >> > <mailto:R-sig-mixed-models at r-project.org
> > <mailto:R-sig-mixed-models at r-project.org>> mailing list
> > >> > > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> > <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
> > >> > <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> > <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>>
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > *Joaquín Aldabe*
> > >> >
> > >> > /Grupo Biodiversidad, Ambiente y Sociedad/
> > >> > Centro Universitario de la Región Este, Universidad de la
> República
> > >> > Ruta 15 (y Ruta 9), Km 28.500, Departamento de Rocha
> > >> >
> > >> > /Departamento de Conservación/
> > >> > Aves Uruguay
> > >> > BirdLife International
> > >> > Canelones 1164, Montevideo
> > >> >
> > >> > https://sites.google.com/site/joaquin.aldabe
> > <https://sites.google.com/site/joaquin.aldabe>
> > >> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe>>
> > >> >
> > >> >
> > >> >
> > >
> > >
> > >
> > >
> > > --
> > > Joaquín Aldabe
> > >
> > > Grupo Biodiversidad, Ambiente y Sociedad
> > > Centro Universitario de la Región Este, Universidad de la República
> > > Ruta 15 (y Ruta 9), Km 28.500, Departamento de Rocha
> > >
> > > Departamento de Conservación
> > > Aves Uruguay
> > > BirdLife International
> > > Canelones 1164, Montevideo
> > >
> > > https://sites.google.com/site/joaquin.aldabe
> > <https://sites.google.com/site/joaquin.aldabe>
> > >
> > >
> > >
> >
> >
> >
> >
> > --
> > *Joaquín Aldabe*
> >
> > /Grupo Biodiversidad, Ambiente y Sociedad/
> > Centro Universitario de la Región Este, Universidad de la República
> > Ruta 15 (y Ruta 9), Km 28.500, Departamento de Rocha
> >
> > /Departamento de Conservación/
> > Aves Uruguay
> > BirdLife International
> > Canelones 1164, Montevideo
> >
> > https://sites.google.com/site/joaquin.aldabe
> > <https://sites.google.com/site/perfilprofesionaljoaquinaldabe>
> >
> >
> >
>
--
*Joaquín Aldabe*
*Grupo Biodiversidad, Ambiente y Sociedad*
Centro Universitario de la Región Este, Universidad de la República
Ruta 15 (y Ruta 9), Km 28.500, Departamento de Rocha
*Departamento de Conservación*
Aves Uruguay
BirdLife International
Canelones 1164, Montevideo
https://sites.google.com/site/joaquin.aldabe
<https://sites.google.com/site/perfilprofesionaljoaquinaldabe>
More information about the R-sig-mixed-models
mailing list