I would like to plot an interaction (one independent variable -3 modalities treated as categorical-, one moderator variable -7 modalities treated as continuous; finally, a binary dependent variable -0 or 1).
Specifically, I am intending to make a graph with DV in y axis and the categorical IV in x axis. Now, I would like to plot two lines for my continuous moderator variable, representing the +1sd and the -1sd from the mean at each level of the 3 levels of the independent variable (as it is traditionally done in this kind of graphs), and not the seven lines that represent each of the modalities.
How can I ask the R software to calculate and display these two specific information pieces only in the graph using ggplot?
[EDIT 1] Here is a subset of my data: content is the categorical IV, Motivcentered, the moderator (continuous), resp is my DV (binary) :
structure(list(content = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3),
resp = c(1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1),
motivcentered = c(-0.25, 1.75, 1.75, -0.25, -2.25, 1.75, 1.75, -1.25, 0.75, -0.25, 0.75, -0.25, -4.25, -1.25, 1.75),
id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15),
item = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)),
.Names = c("content", "resp", "motivcentered", "id", "item"),
row.names = c(NA, -15L),
class = "data.frame", codepage = 65001L)
[EDIT 2] I'm trying to plot new data using now a categorical ID (with a continuous moderator and a categorical DV). The categorical ID is the only difference with my previous request (see above). I'm facing issues plotting such a graph (still plotting the +1sd, -1sd and mean lines for the moderator) since it does not display each modality of my IV (3 modalities, which should appear on the x-axis). Does any of you would know how to deal with that issue using the subset provided?