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%.
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.