I am creating an interaction plot for APA pub. I am close but a few things I cannot figure out:
- How do I have the two interaction lines only display from -1 SD to +1 SD?
- How do I add point shapes so each moderator level has either a square or triangle that represents the -1SD and +1 SD points
- Is there a way to change the x-axis so it doesn't show tick marks and instead has a "Low Agency" and "High Agency" label aligned with the -1 SD and +1 SD points?
My code:
model.interactions.4 <- lm(posemo.t1.t2 ~ (agency.cent * investor_count.cent) +
agency.cent + investor_count.cent +
communion.cent +
gender_d.cent + first_time_founder_d.cent +
num_years_in_business.cent + statuses_count.cent,
data = h_vars)
p <- interactions::interact_plot(model.interactions.4,
pred = agency,
modx = investor_count,
modx.values = "plus-minus",
x.label = "Agency",
y.label = "Change in Positive Affect, t1 to t2",
modx.labels = c("Low Investor Count", "High Investor Count"))
p + jtools::theme_apa()
Current graph with the changes needed:
EDIT: Ideally, I am trying to get the graph to mimic this asthetic (this comes from an Excel template for APA interaction plots):
EDIT: Reprex of first 10 rows of data:
structure(list(posemo.t1.t2 = c(-1.68, -2.3, -1.58, -2.12, 0.22,
1.06, 0.0600000000000005, -2.54, -0.92, -1.99), agency.cent = c(0.0649148418491476,
0.514914841849148, -0.195085158150852, 0.504914841849148, 0.644914841849148,
-1.37508515815085, -0.00508515815085175, -2.52508515815085, 0.964914841849148,
-0.205085158150852), investor_count.cent = c(NA, -2.98954703832753,
NA, 0.010452961672474, 0.010452961672474, 7.01045296167247, -2.98954703832753,
-2.98954703832753, -0.989547038327526, -0.989547038327526), communion.cent = c(1.37408759124088,
0.294087591240876, 0.244087591240876, -0.705912408759124, -1.04591240875912,
-1.34591240875912, 3.02408759124088, -1.57591240875912, 1.38408759124088,
-0.115912408759124), gender_d.cent = c(-0.868292682926829, 0.131707317073171,
0.131707317073171, 0.131707317073171, 0.131707317073171, 0.131707317073171,
0.131707317073171, 0.131707317073171, 0.131707317073171, 0.131707317073171
), first_time_founder_d.cent = c(0.339152119700748, 0.339152119700748,
0.339152119700748, 0.339152119700748, -0.660847880299252, -0.660847880299252,
-0.660847880299252, -0.660847880299252, -0.660847880299252, 0.339152119700748
), num_years_in_business.cent = c(-0.821818696683303, 0.657633358111217,
0.531605960850943, -0.271133765176454, -0.94510636791618, -0.698531025450427,
-1.323188559697, 0.065852536193409, -1.19990088846413, -0.8245584227107
), statuses_count.cent = c(-4267.79562043796, -5839.79562043796,
4351.20437956204, -7041.79562043796, 1050.20437956204, 38029.204379562,
8841.20437956204, -5565.79562043796, -5996.79562043796, -4602.79562043796
)), row.names = c(NA, -10L), class = "data.frame")