Hello,
I am currently conducting a logistic regression where both of my predictors are continuous (i.e., X and M). The outcome is binary (Y). I have already tested the interaction term and found that it is significant, but I am struggling with the best approach for interpreting the types of interaction. Is there an easy way to plot this using PROC SURVEYLOGISTIC?
Any advice would be a great help.
Thanks!
The default EFFECTPLOT, as noted earlier, gives a visual assessment of the variable effects and interaction via a surface plot. You can also use the Margins macro to estimate the slope (instantaneous rate of change) of the response surface at specified points. For example, the following statements produce the surface plot and estimate slopes at points on the surface for the continuous variables in the neuralgia data in the example titled "Logistic Modeling with Categorical Predictors" in the PROC LOGISTIC documentation. The variable PAINNUM is a 0,1 coded numeric version of the character Pain variable in that data set. The macro requires a numeric response. See also this note for more on assessing the effect of continuous variables in a model.
proc surveylogistic data=neuralgia;
model Pain=Age|Duration;
store log;
run;
proc plm restore=log;
effectplot;
run;
data atdat;
do duration=20,40;
do age=60 to 80 by 5;
output; end; end;
run;
%margins(data=neuralgia, response=painnum, roptions=event='1',
model=age|duration, dist=binomial,
effect=age, at=duration age, atdata=atdat, options=cl)
I have never done this, but you can save the model using the STORE command in PROC SURVEYLOGISTIC. Then in PROC PLM, you can use the EFFECT PLOT command to create an interaction plot.
Is there anything I have to do to specify high versus low levels of the moderator? I'm used to categorical moderators where it is a lot easier to just stratify and plot, but I'm having trouble wrapping my head around how that's done with something continuous.
@djohn051 wrote:
Is there anything I have to do to specify high versus low levels of the moderator?
No.
I'm used to categorical moderators where it is a lot easier to just stratify and plot, but I'm having trouble wrapping my head around how that's done with something continuous.
A continuous * continuous interaction can be though of as different slope for variable X depending on value of variable M. Please use your favorite internet search engine and search for
interpret continuous * continuous interaction
Plenty of explanations out there.
The default EFFECTPLOT, as noted earlier, gives a visual assessment of the variable effects and interaction via a surface plot. You can also use the Margins macro to estimate the slope (instantaneous rate of change) of the response surface at specified points. For example, the following statements produce the surface plot and estimate slopes at points on the surface for the continuous variables in the neuralgia data in the example titled "Logistic Modeling with Categorical Predictors" in the PROC LOGISTIC documentation. The variable PAINNUM is a 0,1 coded numeric version of the character Pain variable in that data set. The macro requires a numeric response. See also this note for more on assessing the effect of continuous variables in a model.
proc surveylogistic data=neuralgia;
model Pain=Age|Duration;
store log;
run;
proc plm restore=log;
effectplot;
run;
data atdat;
do duration=20,40;
do age=60 to 80 by 5;
output; end; end;
run;
%margins(data=neuralgia, response=painnum, roptions=event='1',
model=age|duration, dist=binomial,
effect=age, at=duration age, atdata=atdat, options=cl)
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.