Reputation: 11
I'm plotting 3 continuous variables (pland_herb, PD_woody, PD_herb) with my response variable which is Richness. I want to show the 3-way interaction that is occurring over 3 panels, same as this example below:
3-way interaction graph from regression model
However, I'm using a different code to get it:
plot_model(mod81, type = "int", mdrt.values = "all", terms = c("PD_Woody","PD_Herbaceous", "Pland_Herbaceous"))
Here is the resulting graph:
3-way interaction graph-messed up
How do I change the y-axis for the range of numbers to be much smaller? They're only from 0-45, not in the 1000's.
I also tried changing each of the 'type' options and that didn't fix anything.
I found another person's answer by Allen Cameron, which is almost helpful, however I don't want percentage, just whole numbers: Editing the y axis on a sjplot in R (plot_model) How can I alter that code?
Any help is appreciated! Thank you
Upvotes: 0
Views: 157
Reputation: 11
I've tinkered with ggeffects code instead and got a plot closer to what I want! Hooray!
Here is the code:
dat_categorical <- predict_response(mod81, terms = c("PD_Woody","PD_Herbaceous [-1, 0, 1]", "Pland_Herbaceous [-1, 0, 1]"))
plot(dat_categorical, breaks = seq(0, 22, 2), limits = c(0, 22), ci_style = "ribbon")
corrected 3-way interaction plot!
Now my question is how do I fix the confidence interval ribbons, that seem to be stopping in the left and right panel?
Thanks again
Upvotes: 0