Questions tagged [glmmtmb]

R package to fit linear and generalized linear mixed models with various extensions, including zero-inflation.

Filter by
Sorted by
Tagged with
1 vote
0 answers
7 views

glmmTMB & glmer: diffrences in results and warnings of a logistic glmm

I was fitting a logistic generalized liner mixed model using glmer from the lme4 package when I stumbled upon the fact that the results change drastically when the order of the data was changed. So I ...
1 vote
0 answers
25 views

How is AR(1) autocorrelation defined in a glmmTMB generalised linear model?

How is AR(1) autocorrelation defined / parameterised when using a R {glmmTMB} GLM? I have read through Kristensen and McGillycuddy's vignette (https://cran.r-...
  • 11
2 votes
1 answer
27 views

Effective degrees of freedom for spline term in glmmTMB

I have fitted a model in glmmTMB that includes an spline function for age using the bs function from the splines package (version 3.6.2) in R. The syntax in glmmTMB looks like this: glmmTMB(...
2 votes
2 answers
36 views

GLMMs for count data shows significant deviation according to DHARMa diagnostics qqplot

I am making a GLMM to test for various aspects of grooming in primates. I have made 3 different models for the different species. For 1 of the 3 models, I am getting an issue with the qqplot. The data ...
0 votes
0 answers
37 views

Reporting zero-inflated models: from two part output of glmmTMB to single estimate/p-value?

I have fit a zero-inflated model using the very user-friendly R package glmmTMB where both the zero-inflated and conditional models are significant. ...
  • 1
1 vote
1 answer
55 views

Random-intercept by ID with no repeated measures: is maximum likelihood estimation dropping cases?

I have two-time point data, where I want to measure "change" in a dependent variable (si_ch_r) predicted by change in three independent variables and ...
0 votes
0 answers
20 views

Dealing with lower- and upper-bound truncated data with Tweedie distribution through glmmTMB

I'm working with intensive longitudinal data with observations nested within persons via glmmTMB with a random effect of person. My outcome is negative emotion, which was computed by taking the mean ...
0 votes
0 answers
58 views

Interpretation of ZINB when ziformula = ~1 in glmmTMB

I estimated a ZINB model with the probability of producing a structural zero as equal for all observations with ziformula = ~1. For context: I want to know what predicts the number of cigarettes ...
  • 13
0 votes
0 answers
29 views

glmmTMB, zero inflation and response variable with values very close to 0 with a gamma distribution

I have 3 repeated values of a specific metabolites per person post vaccination and I am trying to see if there is a difference in between vaccine groups overtime. I am trying to fit a glmm model (...
1 vote
2 answers
67 views

Interpretation of Dispersion Parameter and Intercept in ZINB Model

I am doing my first own data analysis and I'm new to more complicated mixed models. I fitted a ZINB model with the glmmTMB package with the following code: ...
  • 13
0 votes
0 answers
38 views

Generalized Poisson regression using glmmTMB

I'm modelling a discrete (and naturally bounded) underdispersed variable $Y$ taking values in $0, 1,..., k$ and the aim is to estimate the conditional probabilities $P(Y ≤ y \ | \ X)$ under the model ...
  • 53
1 vote
1 answer
18 views

GLMM estimates holding some ranefs at mean value

I'm trying to estimate annual expected counts (number of individuals of a species) by analyzing point count data from multiple sites across several years. The model looks like this: ...
3 votes
3 answers
106 views

Several single-species GLMMs -> A multi-species GLMM (random effects syntax?)

I'm looking to describe annual relative abundance for several species over several years by analyzing point count data. I'm using a Poisson GLMM in glmmTMB for each ...
0 votes
0 answers
27 views

glmmTMB summary table full of NaN for z-values- cant find solution in troubleshooting vignette

All, I am running a generalised mixed effects model. My data has loads of zeroes and quite large values, it is count data. I am trying to test a treatment by date interaction and to see the effect of ...
  • 1
1 vote
1 answer
100 views

Zero-truncated negative binomial model in glmmTMB predictions

I have a dataset of counts of a vocalisation per hour. I am interested in fitting a model to see if the count of the vocalisations of a given category per hour is effected by noise. My response ...
  • 11
0 votes
0 answers
31 views

GLMM on Binomial data interpretation (R)

I am trying to interpret data coming from behavioural tests with a GLMM model. Three fixed factors are tested, the effect of three different molecules, the species of the tested insect and the size of ...
user avatar
0 votes
0 answers
41 views

How to calculate a r-squared for a zero-truncated poisson mixed model (glmmTMB)

I am interested to calculate the pseudo-r-squuared for a zero-truncated poisson mixel model (using glmmTMB). The r.squaredglmm (package MuMin) gives a message that it can not calculate pseudo-r2 for ...
0 votes
0 answers
206 views

Confidence Intervals of EMMEANS and EMMEANS contrasts

I am trying to look at how the effect of a large scale event (Event) impacts my response variable (AnimalActivity) across two regions (Region; A impacted by the event and B not impacted), while taking ...
user avatar
0 votes
0 answers
68 views

DHARMa problems: Poisson or Zero-inflated negative binomial model?

I have a dataset of abundance of of rodent (AA) in 63 sites, which located in two main area (northern and southern part, NS). AA ...
0 votes
0 answers
48 views

Random effect with compound symmetric covariance structure in glmmTMB

I have a dataset of abundance of a kind of rodents(AA) in 63 sites, and want to know which environmental factors can explain the rodent abundance, and because the sampling sites are basically locate ...
0 votes
0 answers
119 views

Specifying a correct model using glmmTMB while experiencing unusually large coefficients and z-statistics

I have a data set of an beetle community where I want to analyse species richness (for example). The experimental design is as follows: 4 blocks 19 plots 2 different treatments 3 samples of the ...
0 votes
0 answers
50 views

ggpredict produces flat fit line for glmmTMB model

I am conducting a step selection analysis of animal movement data using a Poisson model in glmmTMB. The model runs as expected, however, when I use ggeffects to plot model predictions I get a flat ...
0 votes
0 answers
20 views

emmeans, should I use ML or REML fitted models [duplicate]

I see a lot of examples out there which use ML or REML fitted models as an input for emmeans. If I understand correctly for model comparison of fixed effects for "fixed effects nested models"...
0 votes
0 answers
55 views

Specify nested random effect in INLA

I am trying to understand how to specify nested random effect in INLA, but I do not succeed to reproduce the results of glmmTMB. My final goal is to build a model with random intercept and slope on ...
2 votes
1 answer
92 views

Inflated or not inflated: true zero dilemma in GLMM

I have the models with overdispersion and almost 40% of the data set are true zeros with biological meaning. I'd like to study the temperature (temp) and time ...
0 votes
1 answer
263 views

emmeans properly conducts multiple comparison for one glmmTMB model but not the other

I have two datasets from different years. They are structured almost identically. One is substantially larger than the other and has more time points. When I prepare a negative binomial generalized ...
1 vote
1 answer
273 views

glmmTMB results in R summary() or Anova()?

I am wondering how to analyze differences between subspecies. I want to see if body mass differs between 3 subspecies of rodent and if sex and reproductive status are also different. We then want to ...
0 votes
1 answer
57 views

Should I include "time" variable in GLMM of annual tree growth over a specified time period?

I've been looking through several publications on modeling (LMM or GLMM) tree growth over a specific time period and found significantly different approaches: whilst some studies use "time" ...
  • 11
0 votes
0 answers
226 views

Differing confidence intervals between ggpredict() and ggemmeans() when REML = TRUE in glmmTMB beta regression

I am using the package ggeffects to estimate marginal effects and confidence intervals for a beta regression model fit with glmmTMB. I notice the estimates differ ...
  • 89
0 votes
1 answer
72 views

Advice on improving the model fit of a mixed model on repeated measurements?

I've got repeated measurements data on an outcome including a total of 310 measurements (range in the amount of measurements per patient is 1-6) conducted in 149 ...
  • 119
0 votes
0 answers
34 views

Valid to only use random slope for linear term when the variance of quadratic slope term is near-zero?

I am performing some habitat analyses across a large area and am incorporating random slopes in my models for landscape predictors and a random intercept for individual animal. According to this post ...
1 vote
0 answers
23 views

Model comparison: what to do when reduced model doesn't converge?

This is a general question about how to do hypothesis testing via model comparison: I want to test the significance of several different predictors in a data set using model comparison. After a lot of ...
  • 31
0 votes
0 answers
110 views

manually calculated the fitted values of gamma hurdle model from glmmTMB

I'm manually calculating the fitted values from a gamma hurdle model and compare the results with glmmTMB package. I transferred the response variable to be zero and non-zero and fitted the logistic ...
0 votes
0 answers
67 views

Unusual model convergence problem with glmmTMB function

I had an unexpected problem while using glmmTMB function. I have three fixed effects in my model. One fixed effect is a categorical variable with 8 levels. These levels are: 'upper', 'upperright', '...
0 votes
0 answers
262 views

Interpreting p-value from GLMMTMB model

I'm analyzing count data from an experiment, where I want to study whether colonies of ants with different ratios (0, 50 100) of infected workers have different foraging activities. I am using the ...
0 votes
0 answers
142 views

Discrepancy between glmer.nb and glmmTMB results

I have been playing around with the generalized mixed models and I fit two models to the salamander data using glmer.nb and glmmTMB as shown below. ...
0 votes
0 answers
26 views

How do I model serial correlation in a binomial model?

I'd like to test for trends in proportions of animals sampled over 12 years at six different beaches so that there is a separate trend test per beach. In the data below 'thisbeach' is the number of ...
  • 31
1 vote
1 answer
663 views

Model residual diagnostics of gamma GLMM with log-link

I am trying to model fish length data (N > 115.000) which are highly right-skewed using linear mixed effects models. Actually all data make sense and the the extreme high values are valid ...
  • 155
2 votes
1 answer
268 views

DHARMa testZeroInflation: how to interpret output?

I'm analyzing count data with a negative binomial GLMM via the R package glmmTMB and lme4. I'm running DHARMa diagnostics, one of which is testing for zero inflation and I'm having some trouble ...
  • 37
1 vote
0 answers
34 views

GLM in R: How to set the dependent variable as a number of events (rows in dataset)?

I am carrying out GLMMs with glmmTMB, and my dataset contains rows of video analyses (behaviour analyses of recorded videos of deer) and columns of different data (camera id, date, time, behavioural ...
1 vote
1 answer
299 views

Interpretation of Positive Count Coefficients in Hurdle Model

What is the proper interpretation of the coefficients for the positive count part of a hurdle model (truncated Poisson or Negative Binomial)? I have read that the interpretation of the coefficients ...
  • 45
1 vote
0 answers
25 views

Is Hurdle model recommended if there is a few zero counts?

Is Hurdle model recommended if there is small number of zero counts? Is there any limit for the zero count to fit Hurdle model?
3 votes
1 answer
1k views

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

I am interested in using a generalised linear mixed model with a response variable (values ranging from 0.001-0.999) that best fits a beta distribution when checked using the 'fitdistrplus' package ...
  • 65
2 votes
0 answers
408 views

How to correct spatial autocorrelation with glmmTMB when there are several observations on sites?

I have a large dataset of several species' activity parameters during nights and I want to account for spatial autocorrelation (tests and graphs show that my models suffer from it). However, I cannot ...
  • 43
5 votes
1 answer
160 views

GLM modeling binomial proportions with varying trials and probabilities

A collection of coin manufacturers, $m$, each produces a line of coins, the number of which varies by manufacturer (some produce 3 types of coins, others make 7, and so on). Each manufacturer imparts ...
  • 51
2 votes
1 answer
59 views

Grouping Factor throws model off

One grouping factor of my model appears to pose a problem for model fit. Let me elaborate: I tried to fit a GLMM to ecological data for a behavioural study on termites. I did 80 experiments split ...
  • 101
4 votes
0 answers
77 views

Accounting for repeated measures by resampling data and averaging parameter estimates misses the mark, but why?

Let's say I am looking at how unicorn herd size changes with food quantity. Unicorn herd sizes were surveyed at seven localities over the course of twelve months. Food quantity was assessed monthly, ...
3 votes
1 answer
1k views

Convergence issues and model selection in glmmTMB

Convergence problems in mixed effect models seem to be a common struggle. It is my understanding that they emerge when the likelihood surface is too flat for the optimisation algorithms to find a ...
2 votes
1 answer
166 views

Temporal autoregression in glmmTMB: what do alternative syntax forms mean?

The argument ar1() in glmmTMB accepts two different forms of syntax (that I know of, there might be others): ...
3 votes
0 answers
938 views

Varying dispersion parameter (=dispformula) in glmmTMB in R to account for heteroscedasticity that originates from one predictor

I struggle with understanding the dispersion model and dispersion parameter of glmmTMB , and could not find answers anywhere. I constructed a GLMM using ...
  • 31