[R-sig-ME] glmmTMB negbinom not working with spatial autocorrelation
bbo|ker @end|ng |rom gm@||@com
Thu Oct 17 03:20:37 CEST 2019
Did you really try to fit a model with
+ ziformula = ~.
in the formula? Or do you mean that you fitted a zero-inflated negative
y ~ ...., ziformula=~., family=nbinom1, ... ) ?
This is surprising behaviour.
* Does it work in a clean R session?
* Does your model work with any alternative families (e.g. nbinom2) or
simplifications (e.g. leave out the zero-inflation, or make ziformula =
~1 ) ?
* Can you post a minimal reproducible example? The code below works
(sort of -- convergence problems with the second model, but these are
related to the data and don't sound like what you described).
n <- 400
dd <- expand.grid(population=letters[1:20],
dd <- transform(dd,
dd$eta <- simulate(~poly(b1,2)+poly(b2,2)+
dd$resp <- rnbinom(n, mu=exp(dd$eta), size=1)
dd <- transform(dd,
model1 <- glmmTMB(resp ~ poly(b1,2) + poly(b2,2) + exp(pos + 0|group ) +
(1|population/species), data = dd,
model2 <- update(model1, family=nbinom1)
On 2019-10-16 1:33 p.m., Bansal, Udita wrote:
> Hello all,
> I had been running a mixed model with poisson distribution of the following type, with a spatial autocorrelation term, which works fine:
> Y(count data) ~ x1 + square(x1) + x2 + square(x2) + exp( ) + (1|population/species)
> I realized that my dataset has a lot of small values (mostly 1 and 2) and some large values, so that the data is highly skewed and over dispersed. So I tried to run the following negbinom1 model:
> Y(count data) ~ x1 + square(x1) + x2 + square(x2) + exp( ) + (1|population/species) + ziformula = ~.
> This time the model doesn’t run and says it cannot find one of the independent variables in the dataset. If I remove that variable from the model then it says so for another variable and so on. If I remove the factor for spatial autocorrelation, the model seems to work fine. Can anyone tell me what’s happening and if what I am doing is appropriate for a highly skewed and over dispersed dataset?
> Thank you
> Udita Bansal
> Project Assistant
> Centre for Ecological Sciences
> Indian Institute of Science
> [[alternative HTML version deleted]]
> R-sig-mixed-models using r-project.org mailing list
More information about the R-sig-mixed-models