| lm_slopes_compare | R Documentation |
This allows you to compare two lme4 models that have the same fixed predictors but differ in other ways (e.g., from different datasets, different random effects). It will produce a Z score a p-value for each effect.
lm_slopes_compare(VAR1, VAR2)
VAR1 |
An lme4 object |
VAR2 |
An lme4 object that has the same variables, in the same order as VAR1. |
Z-tests comapring slopes.
data(sleepstudy, package = "lme4")
model1 <- lmerTest::lmer(Reaction ~ Days + (1 | Subject), data = sleepstudy)
model2 <- lmerTest::lmer(Reaction ~ Days + (1 | Subject),
data = sleepstudy[sleepstudy$Days < 8, ])
lm_slopes_compare(model1, model2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.