Top "Mixed-models" questions

Programming problems related to the analysis of statistical models with random-effects terms, also variously: repeated measures, hierarchical, multilevel models

How to get coefficients and their confidence intervals in mixed effects models?

In lm and glm models, I use functions coef and confint to achieve the goal: m = lm(resp ~ 0 + var1 + var1:…

r lme4 random-effects mixed-models
lme4::lmer reports "fixed-effect model matrix is rank deficient", do I need a fix and how to?

I am trying to run a mixed-effects model that predicts F2_difference with the rest of the columns as predictors, …

r regression linear-regression lme4 mixed-models
Get 95% confidence interval with glm(..) in R

Here are some data dat = data.frame(y = c(9,7,7,7,5,6,4,6,3,5,1,5), x = c(1,1,2,2,3,3,4,4,5,5,6,6), color = rep(c('a','b'),6)) and the plot of …

r statistics glm confidence-interval mixed-models
lmer error: grouping factor must be < number of observations

I am attempting to run a mixed effect model on some data but struggling with one of the fixed effects, …

r lme4 mixed-models nlme
Extract prediction band from lme fit

I have following model x <- rep(seq(0, 100, by=1), 10) y <- 15 + 2*rnorm(1010, 10, 4)*x + rnorm(1010, 20, 100) id <- NULL …

r prediction confidence-interval mixed-models
How to cope with a singular fit in a linear mixed model (lme4)?

I am running several linear mixed models for an study about birds with the variable nest as a random variable. …

r lme4 mixed-models
R: Interaction Plot with a continuous and a categorical variable for a GLMM (lme4)

I would like to make an interaction plot to visually display the difference or similarity in slopes of interaction of …

r plot interaction lme4 mixed-models
How to compare a model with no random effects to a model with a random effect using lme4?

I can use gls() from the nlme package to build mod1 with no random effects. I can then compare mod1 …

r lme4 mixed-models nlme
Warning lme4: Model failed to converge with max|grad|

I have to run a lmer with a log transformed response variable, a continuous variable as fixed effect and and …

r optimization lme4 mixed-models
Singularity in backsolve at level 0, block 1 in LME model

dput for data, copy from https://pastebin.com/1f7VuBkx (too large to include here) data.frame': 972 obs. of 7 variables: $ …

r mixed-models