Im am using the interact_plot function to plot a 3-way interaction. I would like to add the Johnson-Neyman region of significance by adding some vertical and horizontal lines. When I do the simple plot with jtools, the only significant curve is with the mod2 - 1 SD group. I would like to only included the JN interval (vline and hline) in the mod2 -1 SD panel (left panel).
This is my script that works but applies vertical and horizontal lines to all 3 mod2 panels.
png(filename = 'interaction_plot.png', width=1000, height=400)
P=interact_plot(fit4, pred = mean_centered_Pren_CESD, modx = gender_male, mod2 =
mean_centered_auc_post_cesd, interval = TRUE, plot.points = TRUE,colors = c("blue",
"orange"),
x.label = "Prenatal depression",
y.label = "ADHD",
pred.labels = "Prenatal depression",
modx.labels = c("Girls"=0,"Boys"=1),
mod2.labels = c("A) Low postnatal depression","B) Average postnatal
depression", "C) High postnatal depression"),
main.title = NULL,
legend.main = "Sex")
P +
drop_gridlines() +
geom_vline(xintercept=c(-0.06, 1.74), linetype='dashed', size=1) +
geom_hline(yintercept=c(-0.14, 1.33), linetype='solid', size=1)
dev.off()
In these lines of codes I would like to only apply "
geom_vline(xintercept=c(-0.06, 1.74), linetype='dashed', size=1) +
geom_hline(yintercept=c(-0.14, 1.33), linetype='solid', size=1)
" to the mod2 group that is "Low" based on the default -1SD grouping. Can someone help me, I've tried a bunch of things and I can't figure out to call that left panel.
Thank you so much.