Questions tagged [glmm]

75 questions
1
vote
0 answers

plotting a GLMM in R with a categorical variable

I need to plot this glm1 <- glmer(Total.species..MaxN. ~ Bait.Type + (1|Habitat), family=poisson, data=df) But I don't know how to get the fit and se.fit with a categorical variable. This is the output of my data from dput(df)…
1
vote
0 answers

Transform predictions on link scale to response scale for truncated distributions

I noticed when trying to back-transform predictions for my zero-truncated negative binomial model on the link scale to the response scale, the values are not the same: set.seed(1) data <- data.frame("x" = rep(1:5, 2), "y" =…
Zoe
  • 906
  • 4
  • 15
1
vote
1 answer

How to access the Fisher Weight matrix W from glmer() fit?

As stated in my question, I would like to access the Fisher weights used in PIRLS model fitting for GLMMs from my glmer() fit in the R package lme4. For such a simple task, I was surprised that I couldn't find any information in the documentation or…
ThighCrush
  • 145
  • 4
1
vote
1 answer

How to fix 'Error in vars$family.glmm$checkData(y) : data must be nonnegative integers'?

I am trying to run a glmm for the first time with my data. I have population data across 13 study sites and I am using a test file to see the results for blesbok in South Africa. This is my code (totally made…
1
vote
0 answers

Multinomial mixed effect model in R

I would like to make a multinomial model with random effects, but I don't know how. The model would look like this: native_driftertype ~treat+(1|replica)+(1|compartment/originhive), with native_driftertype a factor with 5 levels, treat a factor with…
user21291330
1
vote
1 answer

how to obtain p-value (or CIs) for correlation of random effects in a GLMM (lme4)

I want to test for a correlation between the random effects of a GLMM model calculated in lme4. I have already been suggested to conduct a likelihood ratio comparison of a model with and without the random correlation. That is indeed significant but…
rbeginner
  • 21
  • 4
1
vote
0 answers

Running a glmer() is not working/not giving the expected output?

The dependent variable is a binary response of 1=correct, 0=incorrect. The fixed effect is language group ("English" or "Turkish"), and the random effect is participant. Whenever I try running the code it does not give a z-score or p-value for any…
1
vote
1 answer

GLM: Finding x value (predictor) for a particular y value (response)

I have a follow-up to the post Regression (logistic) in R: Finding x value (predictor) for a particular y value (outcome). I have a more complex model: b1 <- glmmTMB(lambda ~ species * period * ffd_stan + (1|SITE_COUNTY), data =…
Amanda Goldberg
  • 169
  • 1
  • 11
1
vote
1 answer

How to report random effect in the mixed effects model

I use the iris dataset in R as the example below. library(lme4) mixed.fit.b <- lmer(Sepal.Width ~ Sepal.Length + (1+ Sepal.Length|Species), data =…
li jiaqi
  • 89
  • 7
0
votes
0 answers

GLMM with negative binomial family model, not all variables appear

I am trying to fit the following generalized linear mixed-effects model for the negative binomial family. I have 18 predictors but the model only uses 13 predictors and leaves two out. If I fit the model for 17 predictors, it still fits the model…
Justin
  • 374
  • 1
  • 3
  • 9
0
votes
0 answers

Question about how random effects are specified in lme when data are nested with a temporal component

I have a study that explores the effects of stream flow (RC1) on the condition (RW) of a fish species (n=1,900 fish). Fish were collected from 11 streams (STREAM) in 3 years (YEAR; 2012-2014). Flow variables are calculated each year for each stream.…
Ralph T
  • 1
  • 1
0
votes
0 answers

How to account for overdispersion for GLMM with binomial distribution in R?

I am pretty new to R and am having some trouble finding a straightforward solution to overdispersion in a GLMM with binomial distribution. I have a few different questions listed here. I am mostly finding information that does not consider a random…
nreg
  • 11
  • 1
0
votes
1 answer

Add legend to sjPlot model outputs modified with ggplot_build

I have two models, and I want to plot their estimates (using sjPlot), combining them in one plot. I create my models: data(iris) mod1 <- glmmTMB::glmmTMB(Sepal.Length ~ Petal.Length + Petal.Width + (1|Species), data =…
LT17
  • 227
  • 1
  • 8
0
votes
0 answers

How can i handle rank deficient in GLMM?

Hi I'm trying to simulate and fit this data. But, there is an error. How can i fit it? n=500 category=3 time=5 # group probability p <- 0.5 # group covariates group_rows <- 500 group_cols <-1 # group_i data generating group_i <- matrix(rbinom(n,…
KIM
  • 1
  • 1
0
votes
0 answers
1
2 3 4 5