BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sharonlee
Quartz | Level 8

Hi,

I am calculating an overall 5-year rate for survivors (#ppl surviving after 5 years after diagnosis / # ppl diagnosed with cancer). My dataset is quite simple, it has pt_id, clinic_id and survival (0/1). I have decided to ignore my clinic_id since I am interested in the overall rate. How do I use SAS to calculate the standard deviation? PROC FREQ doesn't have anything I can find easily. 

Or should I be using a confidence interval instead? 

Ultimately I'd like to know if each of my clinics is statistically higher or lower than my overall clinic rate.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc Mean or Summary may work for simple analysis. The Mean of a 0/1 coded variable is actually the percentage of 1's.

 

Proc summary data = have;

    class clinic_id;

    var survival;

    output out= want mean=rate Lclm = LowerCl UCLM=UpperCl;

run;

The _type_ variable will have a value of 0 indicating overall rate or limits for the data and each clinic will have it's result on a separate line.

 

Or a more human readable:

proc tabulate data=have;
   class clinic;
   var survival;
   table all clinic,
         survival*(mean='Rate'*f=percent8.2  
                   lclm='Lower CL'**f=percent8.2 
                   uclm='Upper CL'**f=percent8.2);
   ;
run;

The results will be rate of 1 responses.

 

View solution in original post

3 REPLIES 3
ballardw
Super User

Proc Mean or Summary may work for simple analysis. The Mean of a 0/1 coded variable is actually the percentage of 1's.

 

Proc summary data = have;

    class clinic_id;

    var survival;

    output out= want mean=rate Lclm = LowerCl UCLM=UpperCl;

run;

The _type_ variable will have a value of 0 indicating overall rate or limits for the data and each clinic will have it's result on a separate line.

 

Or a more human readable:

proc tabulate data=have;
   class clinic;
   var survival;
   table all clinic,
         survival*(mean='Rate'*f=percent8.2  
                   lclm='Lower CL'**f=percent8.2 
                   uclm='Upper CL'**f=percent8.2);
   ;
run;

The results will be rate of 1 responses.

 

sharonlee
Quartz | Level 8

Thanks, ballardw!

The proc summary didn't work for reason reason (I get all 0 values), but the proc tabulate worked great, except that I had to change it so that there was only one astrix instead of two (modified below).

Appreciate you taking the time to help out!

proc tabulate data=have;
   class clinic;
   var survival;
   table all clinic,
         survival*(mean='Rate'*f=percent8.2  
                   lclm='Lower CL'*f=percent8.2 
                   uclm='Upper CL'*f=percent8.2);
   ;
run;

  

Reeza
Super User

If you're trying to compare these, a Chi-Square (via PROC FREQ) test would be appropriate to test the overall distribution. 

To do the pairwise comparisons, make sure to include a Bonferonni correction for multiple testing but ideally you should calculate an age/sex standardized rate unless you have reason to believe your clinics have the same patient distribution. 

 

If you decide to standardize, check out PROC STRATE

 

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_stdrate_exam...

 

 

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!

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
  • 3 replies
  • 2327 views
  • 1 like
  • 3 in conversation