[R-sig-ME] nlme issue with multiple random effects and autoregression

Thierry Onkelinx th|erry@onke||nx @end|ng |rom |nbo@be
Tue Nov 10 08:28:13 CET 2020


Dear Anne-Christine,

You have too few levels for species and years to handle them as random
effects. You'll need to handle them as fixed effects. Leaving only name_id
as random effect.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///////////////////////////////////////////////////////////////////////////////////////////
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
///////////////////////////////////////////////////////////////////////////////////////////

<https://www.inbo.be>


Op di 10 nov. 2020 om 04:46 schreef sree datta <sreedta8 using gmail.com>:

> I do not see the data file. Please attach it if possible. In addition, how
> is the "species" variable set-up? Is it coded as a numeric variable or as a
> factor? Since you only have two species, if species is not set up as a
> factor variable and data within species is in a string/character format,
> that can generate NaNs.
> What version of R are you using? Starting with R V4.0,
> StringsAsFactors=FALSE is the default setting.
>
> Please send the results of the following commands:
>
> str(data) (where data is the name of your data-frame)
>
> head(data, n = 10)
>
> class(data$species)
>
> Sree
>
> On Mon, Nov 9, 2020 at 5:55 PM Anne-Christine Auge <achr.auge using gmail.com>
> wrote:
>
> > I am trying to analyse the effect of temperature range (T.range) on
> turtle
> > animal activity (odba_mean).
> > I have multiple daily measurements for multiple individuals (name_ID)
> from
> > two species. I have data for 3 years (no turtle repeats over the years).
> A
> > datafile is attached.
> > Activity (mean_ODBA) measures appear to be temporally autocorrelated, so
> > this needs to be accounted for).
> >
> > I am fairly new to mixed models, so I am very unsure about my code. I am
> > using the nlme package because this seems to one that can more easily
> > account for autoregression.
> > This is the code I have so far:
> >
> > Mlme <- lme(odba_mean ~ T.range + species + T.range*species,
> >              random = ~ T.range|species/name_ID,
> >              data = df3,
> >              correlation = corAR1(form = ~date|species/name_ID))
> >
> >
> > I have a couple issues that I cannot seem to solve:
> > 1. I get the warning: "Warning message: In pt(-abs(tVal), fDF) : NaNs
> > produced" which appears to be due to the nesting structure, but I just do
> > not know how to fix it.
> > 2. I cannot figure out how to include year as another random effect. I
> read
> > that it is very difficult in nlme to include multiple random effects that
> > are not nested. I suppose technically name_ID is nested in years, but it
> is
> > already nested in species, and species is not nested in years (but
> > crossed). How do I incorporate this?
> >
> > Thank you.
> > Regards,
> > Anni
> >
> > --
> > *_________________________________________*
> >
> >
> > *Anne-Christine Auge*
> > _______________________________________________
> > R-sig-mixed-models using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using 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