How to break up colour variable in sjPlot into equally-sized bins
Whereas the direction of main effects can be interpreted from the sign of the estimate, the interpretation of interaction effects often requires plots. This task is facilitated by the R package sjPlot (Lüdecke, 2022). For instance, using the plot_model function, I plotted the interaction between two continuous variables.
library(lme4)
#> Loading required package: Matrix
library(sjPlot)
library(ggplot2)
theme_set(theme_sjplot())
# Create data using code by Ben Bolker from
# https://stackoverflow.com/a/38296264/7050882
set.seed(101)
spin = runif(600, 1, 24)
reg = runif(600, 1, 15)
ID = rep(c("1","2","3","4","5", "6", "7", "8", "9", "10"))
day = rep(1:30, each = 10)
testdata
http://dlvr.it/SrBn7J
http://dlvr.it/SrBn7J

تعليقات
إرسال تعليق