Hot answers tagged

24 votes
Accepted

How are PQL, REML, ML, Laplace, Gauss-Hermite related to each other?

Generalized Linear Mixed Models (GLMMs) have the following general representation: $$\left\{ \begin{array}{l} Y_i \mid b_i \sim \mathcal F_\psi,\\\\ b_i \sim \mathcal N(0, D), \end{array} \right.$$ ...
Dimitris Rizopoulos's user avatar
11 votes
Accepted

Checking a beta regression model via glmmTMB with DHARMa package

tl;dr it's reasonable for you to worry, but having looked at a variety of different graphical diagnostics I don't think everything looks pretty much OK. My answer will illustrate a bunch of other ...
Ben Bolker's user avatar
10 votes
Accepted

R: GLMM for unbalanced zero-inflated data (glmmTMB)

A1: "All in all, I have about 33% of the dates having counts of zero, which makes me think the data is zero inflated." -> this is a common misconception - zero-inflation != lots of zeros. Zero-...
Florian Hartig's user avatar
10 votes

Is it mandatory to subset your data to validate a model?

Data splitting is in general a very non-competitive way to do internal validation. That's because of serious volatility - different 'final' model and different 'validation' upon re-splitting, and ...
Frank Harrell's user avatar
8 votes
Accepted

Can you use glmmTMB to simultaneously model offsets and zero-inflation?

tl;dr as far as I can tell at this point, ...
Ben Bolker's user avatar
8 votes
Accepted

Inflated or not inflated: true zero dilemma in GLMM

There's a bunch going on here. First let's look at the data: ...
Ben Bolker's user avatar
7 votes
Accepted

Is it mandatory to subset your data to validate a model?

To start, I would suggest that it is usually good to be wary of statements that there is only one way to do something. Splitting an obtained sample into a "training" and a "testing" data set is a ...
Matt Barstead's user avatar
7 votes

Checking a beta regression model via glmmTMB with DHARMa package

I am the developer of DHARMa. Dimitris and Ben are correct, the pattern originates from the known issue that glmmTMB does not (yet) allow making predictions based on fixed effects only, which ...
Florian Hartig's user avatar
7 votes
Accepted

How to implement a mixed-model with a beta distribution?

Please note that there is no requirement, condition, or assumption regarding the distribution of the variables in any regression model. When the data are strictly positive and bounded then the beta ...
Robert Long's user avatar
  • 59.7k
6 votes

Overdispersion tests from DHARMa and sjstats: conflicting results?

I'm the developer of DHARMa. First of all: note that results are not actually conflicting - a non-significant test doesn't mean that there is no overdispersion, it just means just that the respective ...
Florian Hartig's user avatar
6 votes

Checking a beta regression model via glmmTMB with DHARMa package

Have a look at the section about glmmTMB in the vignette of DHARMa. It seems to be an issue with regard to how predictions are calculated given the random effects. As an alternative, you may try the ...
Dimitris Rizopoulos's user avatar
6 votes

Is it mandatory to subset your data to validate a model?

I think the answers here diverge because the question is somewhat unclear, foremost: what do you mean by "validation"? A 70/30 split (or a cross-validation for that matter) is usually performed to ...
Florian Hartig's user avatar
5 votes

Covariance structures in glmmTMB for temporal autocorrelation

you've probably found an answer by now but for anyone who is trying to ask a similar question I've found some answers in this updated version of the vignette you mentioned "Covariance structures ...
James R.'s user avatar
5 votes

How to extract the residual and null deviances from a glmmTMB object (to calculate D2, the deviance explained)?

This would be a comment, but I need to provide some code, so I'll include it as an answer. This may be in essence a programming question, but there might be a statistics question as well. With ...
Sal Mangiafico's user avatar
5 votes

R: Parameterization differences betwen MASS::glm.nb and glmmTMB "nbinom2"

The fact that the coefficients, AIC, log-likelihood, dispersion parameters etc. are the same (up to rounding), and only the SE/z values differ, implies that this is not a difference in ...
Ben Bolker's user avatar
4 votes

GLMM with poisson distribution for non-integer "count" data

To answer your questions, Wendal: 1) You are not doing this right - your outcome data are semi-continuous (i.e., a combination of a point-mass at zero and a positive skewed continuous distribution), ...
Isabella Ghement's user avatar
4 votes

Model convergence problem; non-positive-definite Hessian matrix with glmmTMB in R

the following site reports the troubleshooting you are mentioning: https://cran.r-project.org/web/packages/glmmTMB/vignettes/troubleshooting.html the following point can be the problem when you are ...
Herbuiten's user avatar
4 votes
Accepted

Tweedie distribution without zeroes

Tweedie distributions don't always have zeros, but even when they do, often the proportion of zeros in fitted Tweedie models is often fairly small - at least in the cases I've seen it used to fit. (...
Glen_b's user avatar
  • 281k
4 votes

Dealing with Overdispersed Negative Binomial using glmmTMB

A couple of points: The variance of the random effect for site is extremely low. This could either mean that there is no correlations in the bat activity within a site or that could be an artefact of ...
Dimitris Rizopoulos's user avatar
4 votes
Accepted

GLMM hurdle model for continuous data -Truncated negative binomial family in glmmTMB?

I'm not sure why you say that glmmTMB can't handle zero-inflated Gamma responses: the glmmTMB news file says (for version 1.0.0, release 2020-02-03): new ziGamma ...
Ben Bolker's user avatar
4 votes
Accepted

Interpreting a zero-inflation negative binomial model

What does the zero-inflation model actually represent? this is a model for the occurance of non zeros vs zeros. It can be interpreted in the same was as a logistic regression model where success ...
Robert Long's user avatar
  • 59.7k
4 votes

How to extract the residual and null deviances from a glmmTMB object (to calculate D2, the deviance explained)?

Another general comment, from the details section of ?lme4::deviance.merMod: Deviance and log-likelihood of GLMMs: One must be careful when defining the deviance ...
Ben Bolker's user avatar
4 votes
Accepted

Inverse and log link give opposite results in Gamma GLM

This isn't an error. The GLM is doing exactly what you're telling it to do. The log link is an increasing function of the linear predictor, while the inverse link is a decreasing function of the ...
Alex J's user avatar
  • 1,776
3 votes

assessing glmmTMB hurdle model fit using DHARMa scaled residual plot

I would answer this on two levels: 1) is this the right model from theoretical considerations, and 2) is the residual plot cause for concern? First of all, is this really a case for a hurdle count ...
Florian Hartig's user avatar
3 votes
Accepted

Zero-truncated Poisson distribution in glmmTMB

This appears in the Exanples section help page for the glmmTMB function from the package of the same name. It appears to be what you asked for: ...
DWin's user avatar
  • 7,677
3 votes

Overdispersion parameter in R's glmmTMB

I think a value of Overdispersion parameter for nbinom2 family (): 9.28e+06 actually means no overdispersion. This is the theta parameter of a NB2 model, see also What is theta in a negative ...
Jochen Einbeck's user avatar
3 votes

Residuals still zero inflated after running zero-inflated poisson mixed effect model with glmmTMB

A better way to check the fit of such a model would be the simulated scaled residuals of the DHARMa package. In addition, note that the glmmTMB() fits the model ...
Dimitris Rizopoulos's user avatar
3 votes

Dispersion value with glmmTMB versus mgcv::gam()

You can use the function sigma() to get the dispersion parameter (on the real rather than log scale). To interpret the dispersion parameters of any distribution, see ?sigma.glmmTMB.
MBrooks's user avatar
  • 76
3 votes

What approach can I use to analyse zero-inflated, overdispersed, count data with very low replicates and a nested random effect?

Per the Introduction provided by the glmmTMB creators, ziformula = ~ 1 means that a zero-inflation parameter has been applied to all observations. ...
Brady DeHart's user avatar
3 votes

Why does the glmmTMB gives different fixed effects when random slopes are requested vs just intercepts?

The time variable p is a factor. Hence, when you include it in the random effects you specify that you want a different random effect per time point. Also, the ...
Dimitris Rizopoulos's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible