BookmarkSubscribeRSS Feed
johnrizk
Calcite | Level 5

Hi everyone,

 

I am conducting a county-level analysis. Counties are clustered within states so I am using PROC GLIMMIX to account for clustering of counties within states (and thus correlation between counties within the same state). 

I want to visualize the interaction term between 2 continuous variables (depression*unemployment). The outcome is binary (1 or 0), not continuous, and the measure of association is Odds Ratio (OR). I have seen a few SAS sources for these but none show how to a) conduct this for clustered data (I'm using PROC GLIMMIX), b) adjust for confounding variables while studying the interaction.

 

Can anyone please share code for visualizing interaction in this scenario? Many thanks for your time and help!

 

This is my PROC GLIMMIX code:

/* GLIMMIX for full cohort*/
proc glimmix data=output.cohort_all_vars2 ;
class state  urbanity (ref="0") gini_high (ref="0") ; 
model highrisk=   COPD poverty popabove65 gini_high uninsured lessHS unemployment percwhite percentmale heart_disease depression Opioid_Rx_Rate urbanity depression*unemployment / dist=bin cl oddsratio;
random int /subject=state /*type=cs*/;
estimate 'gini_high' gini_high 1 / exp;
estimate 'uninsured' uninsured 1 / exp;
estimate 'lessHS' lessHS 1 / exp;
estimate 'poverty' poverty 1 / exp;
estimate 'unemployment' unemployment 1 / exp;
estimate 'COPD' COPD 1 / exp;
estimate 'popabove65' popabove65 1 / exp;
estimate 'percwhite' percwhite 1 / exp;
estimate 'percentmale' percentmale 1 / exp;

estimate 'heart_disease' heart_disease 1 / exp;
estimate 'depression' depression 1 / exp;
estimate 'Opioid_Rx_Rate' Opioid_Rx_Rate 1 / exp;
estimate 'urbanity' urbanity 1 / exp;
estimate 'depression*unemployment' depression*unemployment 1 / exp;
run;

 

8 REPLIES 8
PaigeMiller
Diamond | Level 26

I think the EFFECTPLOT command, with the CONTOUR option, allows you to see plots of an interaction between two continuous variables.

--
Paige Miller
johnrizk
Calcite | Level 5

Thanks for your response. It would help to have code that accounts for clustering and adjusts for other covariates.

PaigeMiller
Diamond | Level 26

The EFFECTPLOT uses (of course) the estimated regression coefficients. These already account for (in some sense) the clustering and other covariates. So, it's not clear what is missing that EFFECTPLOT is not providing for you. (Re-reading your original problem statement, I don't see clustering or even the usage of counties in the model)

--
Paige Miller
johnrizk
Calcite | Level 5

Thank you for responding. Using this example: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_introcom_sect032.htm

 

I see that they used logistic regression and integrated the effectplot statement in their logistic reg code. Are you saying that I can use effectplot in PROC GLIMMIX too?

 

 

 

PaigeMiller
Diamond | Level 26

Actually, EFFECTPLOT does not work in GLIMMIX.

--
Paige Miller
StatDave
SAS Super FREQ

Use the STORE statement in PROC GLIMMIX to save the fitted model. Then use PROC PLM to read the saved model (using the RESTORE= option) and include the EFFECTPLOT statement.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 8 replies
  • 699 views
  • 8 likes
  • 5 in conversation