4

I am assessing the effect of a specific drug (categorical factor: 0=placebo, 1=drug1, 2=drug2) and probability differences on choice. My model in MATLAB therefore looks like that:

lme=fitglme(T,'choice~prob_diff+drug+drug:prob_diff+(1|subj)',
            'link','logit','Distribution','binomial','FitMethod','REMPL');

I get a significant interaction effect between drug and probability difference (positive tstat for drug 1 and negative tstat for drug2). As I understand this indicates that the slope for predicting choice from probability differences is higher under drug 1 (compared to drug2+placebo) and lower under drug2 (compared to drug1 and placebo).

My question is: What would be a good way to visualize the effects? I can`t just estimate a new model seperately for each drug and compare the slopes right? Because then I would miss within subject variance that is included in the full model.

chl
  • 50,972
  • 18
  • 205
  • 364
Laurie
  • 179
  • 6

1 Answers1

2

I would suggest that you create a plot with the outcome on the y-axis, prob_diff on the x-axis, and then you draw three lines (they will likely be curves) representing each of your conditions. You can do this by plugging in relevant values of prob_diff into the regression equation and calculating the probability of choice. I don't know if MATLAB has a function for doing this, but most statistical packages do. In other statsitical software, this goes by the general name of marginal effects calculation, although a quick internet search did not turn up anything like that for MATLAB.

See also Interaction in generalized linear model

It appears that only the intercept is random in your model, which means that the probability of the outcome is shifted up or down for each subject but is mean 0 across all subjects. In other words, you don't need to worry about these when creating your interaction plot.

Erik Ruzek
  • 3,297
  • 10
  • 18
  • 1
    Won't it be difficult to interpret a plot with the outcome on the y axis, since it is binary ? – LeelaSella Oct 10 '20 at 15:25
  • Possibly. You could try it both ways and see which makes the most sense. What I like about keeping the outcome on the y-axis is that if you extend the x-axis out far enough, the s-shape of the logistic curve will emerge. – Erik Ruzek Oct 10 '20 at 18:44
  • I'm still a bit confused. How can there be any points on the y axis other than 0 and 1 ? Do you mean that we want to see a pattern of mostly 0s on the left and mosty 1s on the right ? – LeelaSella Oct 11 '20 at 09:07
  • 1
    Yes. There will of course be a lot of points that move toward the middle, but if the association is strong enough, you will see some separation. – Erik Ruzek Oct 11 '20 at 15:37