Help using Base SAS procedures

odds ratios table for multiple variables

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

odds ratios table for multiple variables

Does anyone know any easy way to create an odds ratio table, analogous to a correlation table for multiple (binary) variables so that Xij would be the odds ratio for variables i and j? 

William Roy

Professor of Sociology

UCLA


Accepted Solutions
Solution
‎08-01-2015 11:48 PM
Super User
Posts: 10,044

Re: odds ratios table for multiple variables

What does your data look like ? Post some sample data . Let me see how it work.

View solution in original post


All Replies
Super User
Posts: 10,044

Re: odds ratios table for multiple variables

Check  proc freq,

OR you want SAS/IML  code ?

Post it at IML forum, Rick might give you something you need.

New Contributor
Posts: 4

Re: odds ratios table for multiple variables

Thank you Xia.  Proc freq creates one dataset per pair of variables.  They can concatenated, but I would hoping for a matrix like a correlation matrix.  I can do it in IML, but was hoping someone would have designed a macro to make it simple.

Bill Roy

Super User
Posts: 10,044

Re: odds ratios table for multiple variables

Why would you need a data step macro ? I think IML is more simple and succinct than it . Don't you think so ?

New Contributor
Posts: 4

Re: odds ratios table for multiple variables

Yes, I do.  Not finding an existing macro, I've designed one myself and am working to refine it.

Solution
‎08-01-2015 11:48 PM
Super User
Posts: 10,044

Re: odds ratios table for multiple variables

What does your data look like ? Post some sample data . Let me see how it work.

New Contributor
Posts: 4

Re: odds ratios table for multiple variables

Xia,

I have written my own macro and no longer need help.  Thank you for your offer.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 398 views
  • 0 likes
  • 2 in conversation