Hello!
I'm trying to create an interaction plot using the interaction.plot function from the stats package. However, the output I get is an empty plot... Does anyone know what I'm doing wrong here? My dataframe is in the "long" format (longitudinal data with two time points). The variables "visit" and "group" are factors, while "COG_REYI_SCORE" is numeric. Thanks!
interaction.plot(x.factor = d_long$visit,
trace.factor = d_long$group,
response = d_long$COG_REYI_SCORE,
fun = mean,
type = c("l"),
legend = TRUE,
trace.label = "Group",
fixed = FALSE,
xlab = "Visit",
ylab = "REY I",
ylim = range(0, 15, na.rm = TRUE),
lty = 1,
col = c("blue", "green", "black","yellow", "orange", "red"),
pch = c(1:9, 0, letters),
#xpd = NULL, leg.bg = par("bg"), leg.bty = "n",
#xtick = FALSE, xaxt = par("xaxt"), axes = TRUE,
)