interactions icon indicating copy to clipboard operation
interactions copied to clipboard

mod2.labels issue

Open marcyshieh opened this issue 3 years ago • 1 comments

I am trying to change the "dem_perc" in each of my graph titles into "Dem Pct".

interact_plot(reg2a, pred = x, modx = days, mod2 = dem_perc, data = dataset, x.label = "Regulations", y.label = "Probability of Doing X", legend.main = c("Logged Days"), mod2.labels = c("Dem Pct"))

However, "dem_perc" does not change:

image

What am I doing incorrectly? Any guidance will be appreciated!

marcyshieh avatar May 22 '22 04:05 marcyshieh

@marcyshieh, you need to provide a string for each of the three labels, i.e.,

interact_plot(
  reg2a,
  pred = x, modx = days, mod2 = dem_perc, data = dataset, 
  x.label = "Regulations", y.label = "Probability of Doing X", 
  legend.main = c("Logged Days"), 
  mod2.labels = c("Dem Pct - 1 SD","Dem Pct", "Dem Pct + 1 SD")
)

You also may not need to concatenate the legend.main string, as I think you may only be able to pass a single string to this parameter.

atanasj avatar Aug 04 '22 05:08 atanasj