I'm trying to conduct a simple slopes analysis for a mixed effects model obtained with lmer
.
The model is similar to the following:
data(Orthodont,package="nlme")
mod <- lme4::lmer(distance ~ age*Sex + (1|Subject), data=Orthodont)
When trying to conduct a simple slopes analysis with the function sim_slopes
in the package interactions
, I obtain the following error message.
interactions::sim_slopes(model=mod, pred=age, modx=Sex)
Error: One of the requested columns does not exist.
Backtrace:
1. interactions::sim_slopes(model = mod, pred = age, modx = Sex)
5. jtools:::summ.merMod(...)
6. jtools:::create_table(...)
In addition: Warning message:
Johnson-Neyman intervals are not available for factor moderators.
Would any one have any thoughts on what the problem might be?
Note that it works well with the package reghelper
, but I need p values for these tests, which reghelper
does not provide.
reghelper::simple_slopes(mod)
The output of sessionInfo()
is:
R version 3.6.0 (2019-04-26) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.2 LTS
Matrix products: default BLAS:
/usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1locale: [1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C
LC_TIME=en_CA.UTF-8 [4] LC_COLLATE=en_CA.UTF-8
LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8 [7] LC_PAPER=en_CA.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=Cattached base packages: [1] stats graphics grDevices utils
datasets methods baseloaded via a namespace (and not attached):
[1] Rcpp_1.0.1 magrittr_1.5 splines_3.6.0 MASS_7.3-51.1
[5] munsell_0.5.0 colorspace_1.4-1 lattice_0.20-38 rlang_0.3.4
[9] minqa_1.2.4 plyr_1.8.4 tools_3.6.0 grid_3.6.0
[13] gtable_0.3.0 nlme_3.1-140 cli_1.1.0 assertthat_0.2.1
[17] digest_0.6.19 lme4_1.1-21 lazyeval_0.2.2 tibble_2.1.2
[21] crayon_1.3.4 Matrix_1.2-17 reghelper_0.3.4 nloptr_1.2.1[25] ggplot2_3.1.1 interactions_1.1.0 jtools_2.0.1 pander_0.6.3
[29] compiler_3.6.0 pillar_1.4.1 scales_1.0.0 boot_1.3-20
[33] pkgconfig_2.0.2