turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- How to calculate standard deviation or confidence ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2017 07:09 PM

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.

Accepted Solutions

Solution

05-03-2017
03:08 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2017 07:24 PM

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.

All Replies

Solution

05-03-2017
03:08 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2017 07:24 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-03-2017 03:09 PM

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2017 08:10 PM

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