An R package providing different kinds of tests for linear mixed effects models as implemented in 'lme4' package.
Questions tagged [lmertest]
62 questions
1
vote
2 answers
How to visually assess the convergence of a mixed-effects model by plotting various optimizers
To assess whether convergence warnings render the results invalid, or on the contrary, the results can be deemed valid in spite of the warnings, Bates et al. (2023) suggest refitting models affected by convergence warnings with a variety of…

Pablo Bernabeu
- 402
- 4
- 23
1
vote
3 answers
How to display more decimals in estimates from lmer() function in R-package lmerTest?
I want to test fixed and random effects with the lmerTest R-package. After defining the model with lmer(), I use summary() to get the results. For my results report, I would like to display more decimals of AIC and BIC, of Variance and Std.Dev in…

LillyZoe
- 11
- 2
1
vote
1 answer
Emmeans is reporting different estimates and CIs for marginal means if printed as data.frame
After fitting a LMM I am using the emmeans() function to extract the estimated marginal means, SE and Confidence Intervals. However, depending if I directly extract the means, or save the as a data frame the estimates, their SE and their Confidence…

vheim
- 33
- 6
1
vote
1 answer
Extracting the p-value from an lmerTest model inside a loop function
I have a number of linear mixed models, which I have fitted with the lmerTest library, so that the summary() of the function would provide me with p-values of fixed effects.
I have written a loop function that extract the fixed effects of…

Pashtun
- 123
- 7
1
vote
0 answers
lmer error code "error in diag(Lambert) : object 'R_sparse_diag_get' not found"
I have the following packages loaded and I have tried reinstalling them in case it had not downloaded properly. That was not the issue. I'm working on the latest version of R and R…

Elizabeth
- 11
- 2
1
vote
1 answer
How can i get predictions with CI from lmerTest models?
We are currently working with plant phenology.
We built a linear mixed model for each species present in the study area.
We set Days From Snowmelt (The sum of days from snowmelt to the visit day along the summer) as the response variable while Mean…

LeteAlemany
- 13
- 3
1
vote
3 answers
How to account for paired observations in statistical tests other than t-test (e.g. regression)?
How to account for paired observations in statistical tests other than t-test? Below I discuss two examples in which I try to do so with a mixed-effect approach and fail.
Example 1: how to reproduce t.test(..., paired=T) in lm()?
# simulate…

Marco Plebani
- 436
- 2
- 14
1
vote
0 answers
How to get all sums of squares in lme4
I fit a mixed model using lmer of the lme4 package in R. Using lmerTest::anova I can get the sums of squares for fixed effects I have included in my model. Unfortunately, the total sums of squares (SSTO) and the error sums of squares (SSE) are not…

BioBroo
- 613
- 1
- 7
- 21
1
vote
1 answer
Easiest way to adjust the p-values for multiple comparisons for model(s) to be shown with msummary from modelsummary package
Having used lmerTest::lmer() to perform linear regression with repeated measures data I would like to adjust for multiple comparisons.
I ran several models and used Bonferroni-Holm to adjust each of them, see my approach below.
Eventually, I would…

mavericks
- 1,005
- 17
- 42
1
vote
0 answers
Variables length differ on Step function r
I fitted a model using the lmer() function (it works well). I have 11 explanatory variables. Three of them, if present in model, cause the step() function (from package lmerTest) to return the error: "Variables length differ (found on "...")" where…

Tiago Gimenez
- 11
- 3
1
vote
0 answers
lmerTest::rand() behaves strangely when variable names contain '.'
I have some experience with lme4, but today I tried lmerTest for the first time and was surprised by some results when using the rand() function to examine the random components. (I know this is not advised by the authors of lme4!) In…

ErinMcJ
- 593
- 6
- 20
1
vote
1 answer
Significant interaction in linear mixed effect model but plot shows overlapping confidence intervals?
I try to show you as much as possible of the structure of the data and the results I produced.
The structure of the data is the following:
GroupID Person Factor2 Factor1 Rating
1 2 109 2 …

ljbotzet
- 13
- 5
1
vote
1 answer
lmerTest:::anova uses lazy loading of data sets?
Ran into this problem while trying to get the empirical distribution of the K-R degrees of freedom...
This seems like fairly dangerous behaviour? Does it constitute a bug?
Reproducible example:
## import lmerTest package
library(lmerTest)
## an…

Ketil B T
- 111
- 5
1
vote
1 answer
How can I prevent a package from opening when starting a RStudio project
I have the lmerTest package installed, but it masks some of the lme4 functions and it loads automatically when I start a specific project.
I have tried deleteing the package but now I just get an error:
Loading required package: lmerTest Error in…

Chris Nunn
- 68
- 8
0
votes
0 answers
How to get the Standardise estimates, SE, Confidence intervals with upper and lower limits for the mixed effect models in Lmer?
I'm running a multi-level linear mixed effects model with a four-way interaction of fixed effects and two within-subject random effects.
AUG25M1 <- lmer(RTNormalized~ Block *SeqType* Group *AgeRange + (Block+SeqType|ParticipantID),…

Arpitha
- 27
- 3