0

I would like to select one panel from the jnplot generated by probe_interactions() for a three-way interactions. The get_panel() command from cowplot does not seem to work here. Does anybody know whther this is possible? I may be overlooking something, I am not terribly familiar with cowplot.

Here's an illustration of what I want to do:

  1. I ran the probe_interactions() command from interactions for a three-way interaction with jnplot=T, like so plot <- probe_interaction(fit, pred = pred, modx = mod1, mod2 = mod2, jnplot = T)
  2. I want to use the johnson_neyman plots this generates plot <- plot$simslopes$jnplot
  3. Then I only want to have (and be able to edit) the plot for -1 SD on mod2, I have tried this ggdraw(get_panel(plot, 1)). But this just generates the same plot.

Does anybody know if this is possible at all? Thanks!

ggvh
  • 1
  • 1
    Can you provide a minimum reproducible example and your expected result? – Peace Wang Mar 03 '21 at 14:47
  • I am sorry, but I am not completely sure what extra information you are looking for. The above should work (or, rather, not work) when using any three continuous variables in the interaction and a continuous outcome variable. You could just recreate the above by creating a dataset with four (random) variables and run these commands for *interactions* and *cowplot*. The jnplot I create in step 2 has three panels, one for -1 SD, the mean, and the other for +1 SD on mod2. I would like to be able to, as it were, "take" the former panel and edit it. – ggvh Mar 03 '21 at 16:02
  • 1
    That’s the question. I mean you should provide the specific code that we can run. Now that you have said we can recreate a dataset with four random variables, why don’t you provide the code ( include seed and how you plot). This means reproducible. Code is the best way to help us understand your problem but you don’t provide anything we can run directly. – Peace Wang Mar 04 '21 at 00:08
  • Read about how to give a reproducible example. https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Peace Wang Mar 04 '21 at 06:58

0 Answers0