[R-sig-ME] ZIP MCMCglmm model structure error if at.level(trait, 2) is used

Vital Heim v|t@|@he|m @end|ng |rom gm@||@com
Wed Jun 17 10:47:27 CEST 2020


Dear list,

Currently, I am working on analysing behavioural data from wild animals
attending touristic provisioning events. One model looks at how much bait
these animals consume and the other at how much time the animals spend
attending events and what variables could impact that. I already used this
forum to ask questions about the first model and got some great advice and
decided that I would like to ask a question in regards to the second model
I could not yet find an answer to.

I have data for 28 animals for 104 events. Every animal has 1 observation
per event (if present, presence time > 0, and if absent there is still an
observation in the df for the animal but the presence time = 0). This
resulted in 2912 observations but I had to remove 112 observations due to
missing values in the "tourists" column resulting in a df of 2800
observations.I tried to fit the following model.

prior <- list(R = list(V = diag(2), nu = 2, fix = 2),

               G = list(

               G1 = list(V = diag(2), nu = 2, alpha.mu = c(0,0), alpha.V =
diag(2))

              ,G2 = list(V = diag(2), nu = 2, alpha.mu = c(0,0), alpha.V =
diag(2))))



NITT <- 320000

BURN <- 20000

THIN <- 200

MULT <- 10


model2.1<-MCMCglmm(presence ~ trait - 1
                 + trait:(animals*philo) + trait:(tourists*philo) +
trait:(operators*philo) + trait:observed + at.level(trait,1):counter
                 , random = ~idh(trait):id + idh(trait):event
                 , rcov =~ idh(trait):units
                 , data=df, family="zipoisson", prior=prior
                 , nitt=NITT*MULT, burnin=BURN*MULT, thin = THIN*MULT,
verbose=FALSE)

This model ran fine, the mixing was ok and I could not see any warning
signs in regards to the output.

The predictors are:
- animals: number of other animals attending the event, numeric
- philo: the animals are seasonal residents, and some animals have been
observed at the tourism site the years before my study period already
(philo = y) and some have been identified for the first time during my
study period (philo = n), factor, 2 levels: "y", "n".
- operators: nr. touristic operators at the site
- observed: the touristic season lasts approximately 4 months. However,
some animals would only arrive halfway through the season, towards the end
of the season, etc. I wanted to take into account that before a shark has
been observed the first time during the season, the observations before
that particular event will have presence time = 0 because the animal has
not yet arrived in the area at all and therefore could not have been
attending the provisioning event, factor, 2 levels ("n", "y").
- counter: Once the animal has been observed for the first time that season
I then labelled every further observation with +1 as a count, numeric.

I have two random effects: one for the id of the animal and the
provisioning event.

At that point I reconsidered the model and thought that the variable
"observed" should only be taken into account in the ZI part of the model. I
re-wrote the model to:

modelnew<-MCMCglmm(presence ~ trait - 1

                   + trait:(animals*philo) + trait:(divers*philo) +
trait:(boats*philo)

                   + at.level(trait,1):counter + at.level(trait,2):observed

                   , random = ~idh(trait):id + idh(trait):dive

                   , rcov =~ idh(trait):units

                   , data=df, family="zipoisson", prior=prior

                   , nitt=NITT*MULT, burnin=BURN*MULT, thin = THIN*MULT,
verbose=FALSE)

However, when I did that I got the following warning:

Warning message:

In MCMCglmm(presence ~ trait - 1 + trait:(animals* philo) +
trait:(tourists*  :

  some fixed effects are not estimable and have been removed. Use
singular.ok=TRUE to sample these effects, but use an informative prior!

I am not sure what causes this warning. Did I wrongly specify the model
formula or the prior for that particular model? This is the first time that
I tried to write a model that has the at.level(trait,2) part in it and I
therefore am not sure if that is how I would use it, i.e. when I would like
to have a predictor estimated in the ZI part of the model only. I found an
article in the list that says that the warning is issued when effects are
confounded rather than just strongly correlated but that it could
potentially be ignored. However, I do not understand why the warning
appears and feel a bit uncomfortable ignoring a warning that I do not fully
understand.

Kind regards, Vital

	[[alternative HTML version deleted]]



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