I have the following code:
ggpredict(df, terms=c("x"), by = "id") %>% plot() +
ylab("predicted probabilities") + xlab("") + ggtitle("") +
geom_errorbar(aes(ymin = conf.low, ymax = conf.high), width = 0.05) +
scale_x_continuous(
breaks = seq(0, 2, 1),
labels = c("No Answer", "No", "Yes")
)
It produces a plot that looks like this:
I want to change the facet titles so I added:
ggpredict(df, terms=c("x"), by = "id") %>% plot() +
ylab("predicted probabilities") + xlab("") + ggtitle("") +
geom_errorbar(aes(ymin = conf.low, ymax = conf.high), width = 0.05) +
scale_x_continuous(
breaks = seq(0, 2, 1),
labels = c("No Answer", "No", "Yes")
) +
facet_wrap(~ x, labeller = labeller(x = c("0" = "A", "1" = "B", "2" = "C", "3" = "D", "4" = "E")))
Which gives men a graph that's way off:
I recognize that the x-axis is squished and I plan to fix that later, but right now, my primary concern is changing the facet titles.

