I need to test the interaction between two categorical variables (HealthSystem*ruca_category). Ruca_category specifies the rurality of a clinic in a health system and is coded as a character variable with values "1" for Urban and "2" for Rural. HealthSystem is a categorical variable consisting of 101 specific health systems and is coded as a numeric variable with values 1-101.
The goal of the analysis is to determine if the health system in which a patient is seen and the rurality of the clinic in which they are seen impact the likelihood of a preventive screening. Not all health systems have clinics in both rural and urban locations, so the interaction term HealthSystem*Ruca_category yields categories with 0 observations.
Is there a way to specify certain values of the HealthSystem variable for the interaction term? Alternatively, could I create another categorical variable of only those health systems that have both urban and rural clinics and use this in just the interaction term to determine the effect of this interaction?
Included below is code that I have currently. Note that it is simplified to include only the variables mentioned above- the full model includes additional variables.
PROC LOGISTIC DATA=<have>;
CLASS ruca_category (Ref='1') HealthSystem (Ref='1')/param=ref;
MODEL exam (Event='1')= ruca_category HealthSystem/clodds=wald;
RUN;
Thank you in advance!
If I understand your data, I don't think you need to do anything other than to include the interaction of the two variables in your model.
proc logistic;
CLASS ruca_category (Ref='1') HealthSystem (Ref='1')/param=ref;
MODEL exam (Event='1')= ruca_category HealthSystem ruca_category*HealthSystem;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.