sjPlot
sjPlot copied to clipboard
Moderator value default differs between "int" and "pred"?
Hello, I just noticed something that might be worth either fixing, if it is a bug, or at least mentioning in the documentation of plot_model()
.
For the mdrt.values
argument, the documentation states that "minmax" is the default. I have found this to be the case if I call type="int"
, but if I call type="pred"
it plots the "meansd" method. Specifying the argument to "minmax", does not change the plot in this case. Apologies if I've missed something in the documentation. Here is an example:
library(sjPlot)
mtcars$vs <- as.factor(as.character(mtcars$vs))
mtcars$am <- as.factor(as.character(mtcars$am))
m1 <- lm(mpg ~ vs * am * hp,
data = mtcars)
plot_model(m1,
type = "int")
plot_model(m1,
type = "pred",
terms = c("vs", "am", "hp"))
plot_model(m1,
type = "pred",
terms = c("vs", "am", "hp"),
mdrt.values = "minmax")
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C LC_TIME=English_Canada.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sjPlot_2.8.9
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 mvtnorm_1.1-2 lattice_0.20-44 tidyr_1.1.3 zoo_1.8-9
[6] digest_0.6.27 assertthat_0.2.1 utf8_1.2.2 R6_2.5.1 backports_1.2.1
[11] coda_0.19-4 ggplot2_3.3.5 pillar_1.6.2 rlang_0.4.11 multcomp_1.4-17
[16] minqa_1.2.4 performance_0.7.3 nloptr_1.2.2.2 Matrix_1.3-4 effectsize_0.4.5
[21] ggeffects_1.1.1 labeling_0.4.2 splines_4.1.1 lme4_1.1-27.1 stringr_1.4.0
[26] munsell_0.5.0 broom_0.7.9 compiler_4.1.1 modelr_0.1.8 xfun_0.25
[31] pkgconfig_2.0.3 parameters_0.14.0 insight_0.14.4 tidyselect_1.1.1 tibble_3.1.4
[36] codetools_0.2-18 fansi_0.5.0 crayon_1.4.1 dplyr_1.0.7 MASS_7.3-54
[41] sjmisc_2.8.7 grid_4.1.1 nlme_3.1-152 xtable_1.8-4 gtable_0.3.0
[46] lifecycle_1.0.0 DBI_1.1.1 magrittr_2.0.1 bayestestR_0.11.0 scales_1.1.1
[51] datawizard_0.2.0.1 estimability_1.3 stringi_1.6.2 farver_2.1.0 snakecase_0.11.0
[56] ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8 boot_1.3-28 sandwich_3.0-1
[61] sjlabelled_1.1.8 TH.data_1.0-10 RColorBrewer_1.1-2 tools_4.1.1 glue_1.4.2
[66] purrr_0.3.4 sjstats_0.18.1 emmeans_1.6.3 survival_3.2-11 colorspace_2.0-2
[71] knitr_1.33