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
2
votes
1 answer

glmmTMB: Pairwise comparison post-hoc tests for factors interaction

In my example: # Packages library(glmmTMB) library(DHARMa) library(multcomp) library(lsmeans) library(car) # My data set ds <- read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/temp_ger_ds.csv") str(ds) #'data.frame': 140 obs. of …
Leprechault
  • 1,531
  • 12
  • 28
2
votes
2 answers

Bootstrap method for mixed glm zero-inflated model

I'd like to bootstrap a mixed glm zero-inflated model (m_F) using the glmmTMB package, but despite the use of coef or fixef for coefficients specification, I always have as output the error: Error in bres[i, ] <- coef(bfit) : incorrect number of…
Leprechault
  • 1,531
  • 12
  • 28
2
votes
2 answers

glmmTMB predictions error concerning random effect

I am trying to create a raster with predictions for a model, using glmmTMB. This is based on a model, and a rasterstack. I converted the rasterstack to a data frame, as I think this is a requirement for the function predict.glmmTMB to run. The…
2
votes
1 answer

ggcoef_model error when two random intercepts

When trying to graph the conditional fixed effects of a glmmTMB model with two random intercepts in GGally I get the error: There was an error calling "tidy_fun()". Most likely, this is because the function supplied in "tidy_fun=" was misspelled,…
Charlie_J
  • 89
  • 6
2
votes
1 answer

Why there is an error when running glmmTMB() in RStudio version 2022.02.0?

i am trying to run a Poisson GLMM model: m <- glmmTMB(length ~ temp + site + temp:site, family = poisson, data = df) but i get an error message: Error in .Call("getParameterOrder", data, parameters, new.env(), PACKAGE = DLL) : Incorrect number of…
amarantr
  • 23
  • 2
2
votes
0 answers

Is it valid to fit a generalized linear mixed effect model with "time" as a continuous fixed effect, but catagorical random effect?

I would like to fit a generalized linear mixed effect model using an AR1 correlation structure in the R package glmmTMB. After checking the documentation ... it seems that "time" must be fitted as a factor for the random effects component…
user167591
  • 121
  • 5
2
votes
0 answers

How to solve glmmTMB object not found error?

It seems a bit silly to post this as a question, but I haven't been able to find an answer for this. I want to use the glmmTMB package for modelling data with zero-inflation, but when I try to fit the model I want, the function glmmTMB() returns the…
LaHN
  • 47
  • 7
2
votes
0 answers

R - calculate the prediction interval with glmmTMB

I'm just looking for the code to calculate the prediction interval (rather than the 95% confidence interval) for my GLMMS. Is that possible using glmmTMB? Thanks
2
votes
1 answer

Temporal autoregression in glmmTMB: why does it require time as a factor?

With regards to autocorrelation, how can glmmTMB tell how far apart time steps are if the time sequence must be provided to ar1() as a factor? In glmmTMB, ar1 requires timesteps to be evenly spaced and to be coded as a factor (see this vignette).…
Marco Plebani
  • 436
  • 2
  • 14
2
votes
1 answer

Why don't I see all categories of explanatory variables in the output of my glmmTMB?

I have a dataset with both numeric and categorical variables, which I would like to include in a generalized mixed model. When I do so, the ouptut of the conditional model always "forgets" one category. For example, in this model I include the…
Charlotte
  • 21
  • 2
2
votes
0 answers

Fitting mixed model with interactions between two categorical variables using glmmTMB

Usually my mixed models contain several categorical variables with a lot of unique levels, so X matrix is ​​very sparse. I use glmmTMB package that handles X and Z matrices as sparse. This significantly reduced RAM usage during fitting the…
red_quark
  • 971
  • 5
  • 20
2
votes
1 answer

How to calculate predicted means for specific fixed effects from model output using glmmTMB

I am running a glmm using glmmTMB and using predict() to calculate predicted means. I want to know if it is possible to calculate predicted means based on specific fixed effects from the model. run the model model_1 <- glmmTMB(step.rate ~…
alex
  • 153
  • 1
  • 10
2
votes
3 answers

How to fit confidence intervals using predict function for glmmTMB

I am running a mixed model using the package glmmTMB and using the predict function to calculate predicted means using the following code: run model model_1 <- glmmTMB(Step.rate ~ Treatment*Week + (1|Treatment.Group/Lamb.ID) + (1|Plot), …
alex
  • 153
  • 1
  • 10
2
votes
1 answer

Contrast between variables in glmmTMB

As a reproducible example, let's use the next no-sense example: > library(glmmTMB) > summary(glmmTMB(am ~ disp + hp + (1|carb), data = mtcars)) Family: gaussian ( identity ) Formula: am ~ disp + hp + (1 | carb) Data: mtcars AIC …
iago
  • 2,990
  • 4
  • 21
  • 27
2
votes
0 answers

Does the "subset" command in MuMIn's dredge function work with random effects?

I have the following GLMM with a random slope that I'm conducting model averaging on using MuMIn "dredge" (I don't think my dataset is relevant so I'm just including the code here): sett_global2 <- glmmTMB(sett_dens~ depth_scale + sst_six_scale +…
Conrad
  • 45
  • 6
1
2
3
9 10