0

I am trying to fix a plot that I generated that has the incorrect predicted values along the y-axis. The predicted values should be "Score," my outcome variable. For some reason, the "id" variable is along the y-axis instead. Everything else is plotted correctly. I checked my model, and I can't see where the issue is coming from. I will post my regression model syntax and plot syntax below. The model is a multivariate regression with two outcomes. "scale" labels each of those two outcomes which are indicated by the Score variable. Both predictors are two-level categorical variables, and there is also an interaction between them. If anyone has any ideas, I would greatly appreciate it!

multireg4 <- gls(Score ~ 0 + scale + scale:DrinkStat + scale:ACEHx + scale:DrinkStat:ACEHx,
                  data = R34_Long,
                  na.action = na.omit,
                  weights = varIdent(form = ~ 1 | scale),
                  correlation = corSymm(form = ~ as.numeric(scale) | id))

plot_model(multireg4, type = "pred", terms = c("DrinkStat", "ACEHx", "scale")) + theme_sjplot2()

here is an image of the plot

I've tried adding limits to the scale variable in the plot_model code, but the issue is that the wrong predicted values are being pulled. This seems like an automatic function, so I am not exactly sure where to edit the syntax (in the model regression or the plot) in order to get R to use the correct predicted values.

  • Welcome to StackOverflow. Can you provide `dput(R34_Long)`? [See here on how to make a reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – jrcalabrese Dec 10 '22 at 19:14

0 Answers0