gtsummary and lmerTest

Viewed 109

I really appreciate gtsummary, but recently, this "classical" script including lmer() failed :

library(lmerTest) ; library(gtsummary) ; library(dplyr)
lmerTest::lmer(Reaction ~ Days + (1 | Subject), sleepstudy) %>% tbl_regression()

This is the error message :

Error in match.call() : ... used in a situation where it does not exist

I tried to re-install the 3 packages but the problem remains... Do you know why ?

Thank you very much for your help!

1 Answers

Welcome to Stackoverflow! For random effects or mixed effects models, I use the lme4 package. There are no issues with the lme4 model. Example Below!

library(gtsummary) 
#> #BlackLivesMatter
packageVersion("gtsummary")
#> [1] '1.5.0'

tbl <-
  lme4::lmer(Reaction ~ Days + (1 | Subject), lme4::sleepstudy) %>% 
  tbl_regression()

enter image description here Created on 2021-10-17 by the reprex package (v2.0.1)

Related