BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
djohn051
Fluorite | Level 6

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!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

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)

 

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
djohn051
Fluorite | Level 6

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.

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
StatDave
SAS Super FREQ

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)

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 361 views
  • 3 likes
  • 3 in conversation