5
$\begingroup$

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.

$\endgroup$

1 Answer 1

2
$\begingroup$

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.

$\endgroup$
4
  • 1
    $\begingroup$ Won't it be difficult to interpret a plot with the outcome on the y axis, since it is binary ? $\endgroup$
    – LeelaSella
    Commented Oct 10, 2020 at 15:25
  • $\begingroup$ 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. $\endgroup$
    – Erik Ruzek
    Commented Oct 10, 2020 at 18:44
  • $\begingroup$ 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 ? $\endgroup$
    – LeelaSella
    Commented Oct 11, 2020 at 9:07
  • 1
    $\begingroup$ 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. $\endgroup$
    – Erik Ruzek
    Commented Oct 11, 2020 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.