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

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;
	run;

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?

 

 

1 REPLY 1
StatDave
SAS Super FREQ

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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1 reply
  • 1172 views
  • 0 likes
  • 2 in conversation