BookmarkSubscribeRSS Feed
Obsidian | Level 7

The purpose of our study is to compare our results for minimum dietary diversity for women during 2 seasons: spring and summer.

We want to check if our confounding variables for women’s dietary diversity interact during the 2 seasons.

I have a question regarding the way we should include interactions in proc logistic when comparing two groups? We felt that it was possible that more than one confounding factor affects the way seasons influence dietary diversity. (For instance, maybe women with greater wealth have lower dietary diversity in the spring as compared to summer because foods are cheaper in the summer. In contrast, maybe women with lesser wealth must sustain on the same types of low-cost food all year-long.)

We used the following program, specifying the types of interactions for which we need to know the odds ratio: spring_summer* v_region_pub and spring_summer * v_urban_rural in this case.


proc logistic data=results2;

class v_region_pub (param=ref ref='1-Sud')

v_urban_rural (param=ref ref='rural')

spring_summer (param=ref ref='spring');


MDD_W_5 (event='Oui')=




spring_summer* v_region_pub

spring_summer * v_urban_rural  ;

oddsratio spring_summer / diff=ref at (v_region_pub=all) cl=pl;

oddsratio spring_summer / diff=ref at (v_urban_rural =all) cl=pl;



Though the oddsratio step specifies that we would like the program to generate the odds ratio for :

spring_summer* v_region_pub and

spring_summer * v_urban_rural  


it generates a table that presents all permutations of

spring_summer* v_region_pub * v_urban_rural



Your model says that the effect of spring_summer depends on both of the other variables since interactions with both are in the model. Because of that, it would not make sense to look at its effect at only levels of one of the variables. If you want to assume it does not interact with one of them, then you can get the odds ratios at just the levels of the other.

Obsidian | Level 7

Thank u so much for your answer.

You said, "If you want to assume it does not interact with one of them, then you can get the odds ratios at just the levels of the other."  can you please explain to me what do u mean by that, how can I get the odds ratio at the level of the other? 

+ I wanted to make a table like this, isn't it possible to make with proc logistic when entering 2 interactions (the region with spring_summer and rural_urban with spring_summer)!!? 


Odds Rtio

Spring vs summer in region=SUD


Spring vs summer in region=GAE


Spring vs summer in rural_urban=rural


Spring vs summer in rural_urban=urban


Spring vs summer livestock=yes


Spring vs summer livestock=no



I mean that you would have to change your model. If you removed one of the interactions, then an ODDSRATIO statement for spring_summer would show odds ratios just at levels of the other variable it still interacts with. However, it would be misleading to run two such models, each with one of the interactions dropped, just so you can generate the odds ratios you say you want. All of your inferences should result from a single model that best reflects reality. You shouldn't have two different versions of reality for the convenience of getting numbers. If the data indicate that spring_summer does interact with both variables, then the correct odds ratios are what you got initially.

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
  • 3 replies
  • 2 in conversation