BookmarkSubscribeRSS Feed
zihdonv19
Quartz | Level 8

I'm using this example dataset to show my question, which is from: http://support.sas.com/kb/24/455.html

  data uti;
         input diagnosis : $13. treatment $ response $ count @@;
         datalines;
      complicated    A  cured 78  complicated   A not 28
      complicated    B  cured 101 complicated   B not 11
      complicated    C  cured 68  complicated   C not 46
      uncomplicated  A  cured 40  uncomplicated A not 5
      uncomplicated  B  cured 54  uncomplicated B not 5
      uncomplicated  C  cured 34  uncomplicated C not 6
      ;

I want to examine the relationship between count and diagnosis (odds ratio) using interaction term in logistic regression at each level of treatment. What I want:

Treatment ORs (diagnosis~count) Confidence interval
A 1.4 (1.2, 1.6)
B 1.2  (1.1, 1.6)
C 1.5  (0.8, 1.8)

For a fabricate example, the odds ratio is 1.4 at treatment A meaning that for every one count increase, the risk of being diagnosed increased by 40%.

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello @zihdonv19,

 

Sorry to see that your question hasn't been answered yet.

 

So you reinterpret the sample data from Usage Note 24455 so that COUNT is now a continuous predictor and DIAGNOSIS is the dichotomous response variable. Let's assume that DIAGNOSIS='complicated' is the event of interest.

 

Then, in principle, you can obtain the desired odds ratio estimates (together with 95% confidence intervals) with this syntax:

proc logistic data=uti;
class treatment / param=glm;
model diagnosis(event='complicated') = treatment count treatment*count;
oddsratio count;
run;

However, this particular dataset with only four observations per treatment group is too small to yield a reasonable result: see the warnings about quasi-complete separation etc. in the log and in the output.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 607 views
  • 0 likes
  • 2 in conversation