dmp
dmp

Reputation: 1

tab_model error summarizing lmer model: "Model was not fitted with REML, however, `estimator = "REML"

Hello Stackoverflow Community,

I am running an LMER model to evaluate the effects of a 2x2 randomized crossover trial on response accuracy. I then summarize the model parameters using tab_model from the sjPlot package.

Although I set REML argument to false in the lmer model specification, when I attempt to display model estimates using tab_model(), I receive the following warning:

Model was not fitted with REML, however, estimator = "REML". Set estimator = "ML" to obtain
identical results as from AIC().

Here is my initial lmer model testing the effect of condition sequence (a fixed effect) with a random effect by the participant at the intercept:

mod1a <- lmer(n1ballacc ~ seq + (1|id),data=d.1b.nt.acc, REML = FALSE)

Here is my syntax for tab_model():

library(sjPlot) mlm.sum.tab <- tab_model(mod1a,show.aic = TRUE, digits = 4, show.fstat=TRUE,show.dev=TRUE,show.zeroinf=TRUE,show.obs = FALSE,show.ngroups = FALSE,dv.labels = c("Sequence Model Random Intercept"),string.est="Coefficient") mlm.sum.tab

I am using R version 4.4.0 (2024-04-24) on MacOS Mongterey 12.6.5, and RStudio version 2024.04.1+748 and the following packages:

library(lme4)
library(ggplot2)
require(tidyverse)
library(dplyr)
library(parameters)
library(effectsize)
library(data.table)
library(JWileymisc)
library(extraoperators)
library(lme4)
library(lmerTest)
library(multilevelTools)
library(visreg)
library(ggpubr)
library(haven)

I checked the estimates of the random and fixed effects from this model against the model summary (summary(mod1a)) and the AIC estimates do not match:

The tab_model() does not accept the "estimator" argument and throws the following error upon attempt:

Error in purrr::map2(): ℹ In index: 3. ℹ With name: "ML". Caused by error: ! Sorry, model_parameters() failed with the following error (possible class character not supported):

$ operator is invalid for atomic vectors

A scoping search through topics on Stackexchange yielded no posts that would be directly relevant, neither did my Google search.

If anyone has come across this error, and could share how they resolved it, I would appreciate it.

Upvotes: 0

Views: 103

Answers (0)

Related Questions