Greetings. I have a longitudinal data set (set up in long form), and I am trying to graph a significant interaction of a time-varying predictor (ValueW, which is a continuous variable measured at 4 different time points) by a non-time varying predictor (female, a dichotomous measure of sex (male = 0, female = 1)). The outcome/dependent variable is a continuous measure of condom negotiation efficacy, also measured at the same 4 time points (cndngW).

The “mixed” command/syntax that I am using works fine, this is the command (relevant variables are bolded):

mixed cndngW c.valueW expecW i.female gpa clsmast clsext clsavd i.female##c.valueW || ID_STUDENT: year, cov(unstructured)

The output indicates that there is a significant interaction of female X valueW (p<.001).

I am trying to generate a graph to visualize this interaction. I usually use “margins” followed by “marginsplot,” but given that there is a time-varying predictor (valueW), I cannot get this to work. I am hoping that you can tell me how I can generate this graph (or some type of graph that will allow this to be visualized). So essentially I want to see how this interaction of a time-varying predictor (valueW) by a time-invariant dummy variable (female) predict a dependent variable measured at 4 time points (condngW).

Any insights would be greatly appreciated.