Hi all,
I am trying to use the glmmTMB package (version 1.1.0) to run a hurdle model that includes a spatial covariance structure. However, when I try to include spatial information in the zero-inflated part of the model I get an error.
Here is a reproducible example with the error message that I receive:
library(glmmTMB)
d <- data.frame(count = as.vector(Salamanders$count),
mined = as.vector(Salamanders$mined),
x = as.vector(row(Salamanders)),
y = as.vector(col(Salamanders)))
d$pos <- numFactor(scale(d$x), scale(d$y))
d$ID <- factor(rep(1, nrow(d)))
m <- glmmTMB(count ~ mined + mat(pos + 0 | ID),
zi = ~.,
family = truncated_poisson, data = d
)
"Error in Reduce(addForm0, list(...)) : object 'mined' not found?
Is there a way of including a spatial structure in both parts of the hurdle model?
Any help would be much appreciated!
M?ire
Spatial structure in hurdle glmmTMB
3 messages · KIRKLAND, MAIRE E., Mollie Brooks
Hi M?ire, It sounds like you found a bug. Thank you for the easily repeatable example. Would you like to file an issue on GutHub, or should I? https://github.com/glmmTMB/glmmTMB/issues cheers, Mollie
On 22Apr 2020, at 15:48, KIRKLAND, MAIRE E. <maire.kirkland at durham.ac.uk> wrote:
Hi all,
I am trying to use the glmmTMB package (version 1.1.0) to run a hurdle model that includes a spatial covariance structure. However, when I try to include spatial information in the zero-inflated part of the model I get an error.
Here is a reproducible example with the error message that I receive:
library(glmmTMB)
d <- data.frame(count = as.vector(Salamanders$count),
mined = as.vector(Salamanders$mined),
x = as.vector(row(Salamanders)),
y = as.vector(col(Salamanders)))
d$pos <- numFactor(scale(d$x), scale(d$y))
d$ID <- factor(rep(1, nrow(d)))
m <- glmmTMB(count ~ mined + mat(pos + 0 | ID),
zi = ~.,
family = truncated_poisson, data = d
)
"Error in Reduce(addForm0, list(...)) : object 'mined' not found?
Is there a way of including a spatial structure in both parts of the hurdle model?
Any help would be much appreciated!
M?ire
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Hi Mollie, Thanks so much for your reply. I have filed it as an issue on GitHub. Best wishes, M?ire
On 22 Apr 2020, at 15:15, Mollie Brooks <mollieebrooks at gmail.com> wrote: Hi M?ire, It sounds like you found a bug. Thank you for the easily repeatable example. Would you like to file an issue on GutHub, or should I? https://github.com/glmmTMB/glmmTMB/issues cheers, Mollie
On 22Apr 2020, at 15:48, KIRKLAND, MAIRE E. <maire.kirkland at durham.ac.uk> wrote:
Hi all,
I am trying to use the glmmTMB package (version 1.1.0) to run a hurdle model that includes a spatial covariance structure. However, when I try to include spatial information in the zero-inflated part of the model I get an error.
Here is a reproducible example with the error message that I receive:
library(glmmTMB)
d <- data.frame(count = as.vector(Salamanders$count),
mined = as.vector(Salamanders$mined),
x = as.vector(row(Salamanders)),
y = as.vector(col(Salamanders)))
d$pos <- numFactor(scale(d$x), scale(d$y))
d$ID <- factor(rep(1, nrow(d)))
m <- glmmTMB(count ~ mined + mat(pos + 0 | ID),
zi = ~.,
family = truncated_poisson, data = d
)
"Error in Reduce(addForm0, list(...)) : object 'mined' not found?
Is there a way of including a spatial structure in both parts of the hurdle model?
Any help would be much appreciated!
M?ire
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models