BookmarkSubscribeRSS Feed
sam369
Obsidian | Level 7

Hi all,

I have 2 set of question

1) odds ratio using relrisk?

have data:

trt      res    COUNT

Trt1        1       54

Trt1        2       12

Trt2        1      120

Trt         2      103

i need Odds ratio trt1 over trt2 ? how can i acheive that?

2) i am using Clopper-Pearson method(freq binomial)

i got ouput 95CI%

              trt1                                                                         trt2

(19.7, 41.5)                                (27.9, 40.8)

i got query back to me "trt2 group is beyond it point estimate ?, CI look not correct

what does that mean

Thanks

Sam

3 REPLIES 3
Reeza
Super User

Can you post the code you used?  And did you get an error?

For odds ratio can use proc logistic.

sam369
Obsidian | Level 7

hi Reeza,

the follwoign code is using to get odds ratio and Clopper-Pearson method for CI for response

i can use logistic, but dont know how to

For odds ratio:

ods output RelativeRisks=rr(where=(StudyType eq 'Case-Control (Odds Ratio)'));

proc freq data=have;

weight count;

tables trt*res/chisq relrisk;

run;

Clopper-Pearson method:

proc freq data=ci noprint;

tables grp/ binomial alpha = 0.05;

by trt ;

output binomial out=_ci;

run;

data final_ci

retain ci;

set _ci;

  by trt;

  lcl = round(100 * (1 - xu_bin),.1);

  ucl = round(100 * (1 - xl_bin),.1);

   ci = '   ('||put(lcl,4.1)||', '||put(ucl,4.1)||')';

run;

Thanks

Sam

StatDave
SAS Super FREQ

The following computes the odd ratio and relative risk estimates:

data a; input

trt $     res    COUNT; datalines;

Trt1        1       54

Trt1        2       12

Trt2        1      120

Trt2        2      103

;

proc freq;

weight count;

table trt*res/relrisk;

run;

The odds ratio estimate is 3.8625 = (54/12) / (120/103). 

It can also be produced using PROC LOGISTIC:

proc logistic;

freq count;

class trt;

model res(event="1")=trt;

run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 1479 views
  • 0 likes
  • 3 in conversation