BookmarkSubscribeRSS Feed
GordonC_SAS
Calcite | Level 5

I have two binary variables: treatment arm (arm 1, arm 2) and event (Yes, No) for each participant. I transformed my participant-level data into a long format summary data (so now I have 3 variables: count, arm and event). My goal is to compute the relative risk of event in arm 1 comparing to arm 2, and the exact confidence interval. The problem is the frequency of the event in arm 2 is 0 (no one had event in arm 2) so I always get infinite RR. And upper bound of my confidence interal goes to infinite as well. Is there a way to avoid this problem? I learned that proc freq would add 0.5 to each frequency to ensure that the statistics is defined when there is 0 frequency table cells but I couldn't figure out the code. 

 

Here is my code:

 

proc freq data=data1;
weight Count;
tables arm*event ;
exact RELRISK;
run;

4 REPLIES 4
ballardw
Super User

Can you share the cell counts you are getting in the 2x2 table?

GordonC_SAS
Calcite | Level 5

my cell count frequencies are:

 

arm 1, event = yes: 5

arm 1, event = no :  70

arm 2, event = Yes: 0

arm 2, event = No: 26

Ksharp
Super User
proc freq data=data1;
weight Count/ZERO;
tables arm*event ;
exact RELRISK;
run;
GordonC_SAS
Calcite | Level 5

I'm still getting infinite relative risk with the ZERO option. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1839 views
  • 0 likes
  • 3 in conversation