Questions tagged [glmmtmb]

glmmTMB fits generalized linear mixed models (GLMMs) and extensions. It is intended to handle a wide range of statistical distributions (Gaussian, Poisson, binomial, negative binomial, Beta …) and zero-inflation. Fixed and random effects models can be specified for the conditional and zero-inflated components of the model, as well as fixed effects for the dispersion parameter.

The first stop for information on glmmTMB is its GitHub pages site, especially the "where to ask questions" section.

137 questions
7
votes
0 answers

Error with glmmTMB can't call FreeAdFunObject?

I'm running R 4.02 and RStudio 1.3.1073. I'm having an error when I'm running a model with glmmTMB. Should I update or revert to a different version? Error in .Call("FreeADFunObject", ptr, PACKAGE = DLL) : "FreeADFunObject" not available for…
bibigeans
  • 115
  • 5
7
votes
1 answer

How do I manually plot SE/CI around a model estimate

I am trying to manually plot model estimates on top of data. My real problem is far more complicated than this, so I want to avoid using predict if I can, and would prefer to understand how these predictions would be calculated rather than relying…
Dylan_Gomes
  • 2,066
  • 14
  • 29
6
votes
1 answer

Is there a difference between gamma hurdle (two-part) models and zero-inflated gamma models?

I have semicontinuous data (many exact zeros and continuous positive outcomes) that I am trying to model. I have largely learned about modeling data with substantial zero mass from Zuur and Ieno's Beginner's Guide to Zero-Inflated Models in R, which…
Kellan Baker
  • 375
  • 3
  • 11
5
votes
1 answer

Warning in every model of glmmTMB 'giveCsparse'

I am using the glmmTMB library to run mixed models, within a R markdown document. Any model that I run, I get these warnings: 'giveCsparse' has been deprecated; setting 'repr = "T"' for you'giveCsparse' has been deprecated; setting 'repr = "T"' for…
MKie45
  • 87
  • 1
  • 6
5
votes
1 answer

Get model estimates from another reference level, without running new model?

I am wondering if there is a simple way to change what values are in the intercept, perhaps mathematically, without re-running large models. As an example: mtcars$cyl<-as.factor(mtcars$cyl) summary( lm(mpg~cyl+hp,data=mtcars) ) Output: …
Dylan_Gomes
  • 2,066
  • 14
  • 29
4
votes
1 answer

Computing marginal effects: Why does ggeffect and ggemmeans give difference answers?

Example library(glmmTMB) library(ggeffects) ## Zero-inflated negative binomial model (m <- glmmTMB(count ~ spp + mined + (1|site), ziformula=~spp + mined, family=nbinom2, data=Salamanders, …
Constantin
  • 132
  • 9
4
votes
1 answer

How to plot predicted data of a GLMM from the package glmmTMB?

i have the following data and created a model with the package glmmTMB in R for plant diameters ~ plant density (number of plants) with a random plot effect: d <- data.frame (diameter = c(17,16,15,13,11, 19,17,15,11,11, 19,15,14,11,8), …
3
votes
1 answer

Using "snow" parallel operations in bootstrap_parameters/model on merMod object (R)

I've been using bootstrap_parameters (parameters package in R) on generalised linear mixed models produced using glmmTMB. These work fine without parallel processing (parallel = "no") and also works fine on my old and slow mac using parallel =…
plants-22
  • 31
  • 5
3
votes
2 answers

Simulate negbin data from a fitted glmmTMB model - family negbin1

I fitted a glmmTMB model using family = nbinom1. Now I would like to perform a simulation of data based on predicted values and the dispersion. However, from the help files, it looks like the go-to rnbinom function uses the family=nbinom2…
user2602640
  • 640
  • 6
  • 21
2
votes
0 answers

Confidence intervals computed by ggpredict() and emmeans() for a mixed-effect model differ: why?

I used function ggpredict() from package ggeffects 1.3.0 and function emmeans() from package emmeans to calculate estimates and confidence intervals (hereafter: CI) for a mixed-effect model. The CI estimated by the two functions differ. Why? The…
Marco Plebani
  • 436
  • 2
  • 14
2
votes
0 answers

glmmTMB output changes when knit to html in R Markdown

I'm working on an analysis using a negative binomial mixed effects model using glmmTMB, and using R Markdown to generate a report for my collaborators. When I knit to html, the regression output changes slightly. Also, AIC, BIC, logLik and deviance…
2
votes
3 answers

R package DHARMa detects deviations from normality even if a mixed model is fitted to gaussian-generated data

[Main edits in italics] Using R I generated data from normal distributions but, when I fitted a random-intercept mixed-effect model to them, both the Kolmogorov-Smirnoff test for normality and the Quantile-Quantile plot performed by the R package…
Marco Plebani
  • 436
  • 2
  • 14
2
votes
1 answer

Difference in results between glmmTMB and zeroinf (in pscl)

I applied glmmTMB and zeroinfl in pscl to the same dataset. I obtained the identical coefficients for the conditional part, but the coefficients for the binary part are somewhat different. Any idea on the potential factors that makes the…
KLee
  • 105
  • 1
  • 9
2
votes
0 answers

Back-transforming predictions from glmmTMB with truncated distribution

I'm running a glmmTMB with truncated count distributions, and am interested in predicting on the link scale and back-transforming the result. This is a follow-up to this question. The answer to the linked question addressed predicting from a glmmTMB…
user2602640
  • 640
  • 6
  • 21
2
votes
1 answer

Convergence Criteria in glmmTMB - what are my options?

When using glmmTMB() of the R-package {glmmTMB} (see CRAN with links to manual & vignettes), I am aware that I have certain options when dealing with the convergence of models. More specifically, there is the control = argument to which I can pass…
Paul Schmidt
  • 1,072
  • 10
  • 23
1
2 3
9 10