You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the 4 models below. Only the 4th does not work and NA's instead of factor variables names are introduced when adding spaces to variable names (I am doing this to make the output more human friendly to read) in lme4 models, but not in OLS lm() models.
library(lme4)
library(equatiomatic)
sim_longitudinal$`group dummy` <- as.factor(sim_longitudinal$group)
sim_longitudinal$group_dummy <- as.factor(sim_longitudinal$group)
## works
model1 <- lm(score ~ 1 + treatment + group_dummy,
data = sim_longitudinal)
extract_eq(model1)
## works
model2 <- lm(score ~ 1 + treatment + `group dummy`,
data = sim_longitudinal)
extract_eq(model2)
## works
model3 <- lmer(score ~ 1 + treatment + group_dummy + (1|school),
data = sim_longitudinal)
extract_eq(model3)
## does not work
model4 <- lmer(score ~ 1 + treatment + `group dummy` + (1|school),
data = sim_longitudinal)
extract_eq(model4)
The text was updated successfully, but these errors were encountered:
Consider the 4 models below. Only the 4th does not work and NA's instead of factor variables names are introduced when adding spaces to variable names (I am doing this to make the output more human friendly to read) in lme4 models, but not in OLS
lm()
models.The text was updated successfully, but these errors were encountered: