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

sree datta @reedt@8 @end|ng |rom gm@||@com
Tue Nov 10 04:45:30 CET 2020


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



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