BookmarkSubscribeRSS Feed
Calcite | Level 5
data new;
education $ wealth obesity @@;
0 5 0 1 0 1 0 3 0 1 0 1 0 1 1 1 1 1 1 2 0 1 4 0

proc surveylogistic data=GAIR60FL nomcar;
    class education (ref = '0') residence (ref = '2') v131 (ref = '1') / param=ref;
    model BMI(event='1')= education v190 education*v190 residence parity v012 v131/CLODDS;
    weight sam_wei;
    strata v022;
    cluster v021;
  	estimate 'OR for v190=5 (vs v190=1) @ level 1 of education' v190 1 0  education*v190 5 1/ exp cl;

Hi there,


I am having difficulty determining the correct code for a continuous and categorical interaction in proc survey logistic. I have read this paper and it seems slice by only works for categorical variables. I would like to know what else I could try. Here is what I want to do - I am trying to run an interaction of education on the association of wealth index on overweight.


Education is coded as “0” and “1” and run as a categorical variable


Wealth index is numbered from 1 – 5 and is run as a continuous variable


Overweight is binary – “0” and “1”


This means I am interested in examining the relationship of wealth index with overweight when education is “0” and the same relationship when education is “1”


My code is below with an example structure of my data. I tried to use estimate but the odds ratio estimates were not what i expected as I already used the slice by option to conduct the same analysis with wealth index as categorical. Can anyone please help?




If there is continuous by categorical interaction, then that means that the slope of the continuous variable depends on the level of the categorical variable. So, you would want to see the separate slopes on the continuous variable at each level of the categorical variable. This can be done by replacing the two main effects and interaction with the main effect for the categorical variable and a nested effect. For example, if A is a categorical (CLASS) variable and X is a continuous variable and your model includes A X A*X, then you can instead specify A X(A). The two slopes on X at each level of A are provided by the nested term.

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
  • 1 reply
  • 2 in conversation