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
- /
- Health Care and Pharma
- /
- SAS in Health Care Related Fields
- /
- Performing calculations with counts

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

06-25-2007 09:51 AM

I'm pretty new to SAS coding and I'm a bit lost right now. How would you perform calculations with counts. For example, I want to get the rate of falls by type (same level falls, different level falls, etc... I created a variable to differentiate for each type of fall (same_fall, diff_fall).

How would I add up the type of falls and then divide it by the population?

Thanks,

How would I add up the type of falls and then divide it by the population?

Thanks,

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

06-26-2007 05:44 AM

If you'd raised this in the Enterprise Guide forum my answer would have been slightly different, although the result would be the same.

It seems you want to perform a frequency analysis, you want a percentage for the frequency as a proportion of the population, and you want to perform it separately for each level of a variable that classifies a group to observe.

In Enterprise Guide there is a standard analysis task that will do everything for you. In Foundation SAS, your can simply run code similar to the following:

Proc Freq Data = MYLIB.MYDATA Missing;

Tables CLASSVAR;

Run;

This will produce frequencies for each level of classvar, and percentages for each class as well as the whole population.

Kind regards

David

It seems you want to perform a frequency analysis, you want a percentage for the frequency as a proportion of the population, and you want to perform it separately for each level of a variable that classifies a group to observe.

In Enterprise Guide there is a standard analysis task that will do everything for you. In Foundation SAS, your can simply run code similar to the following:

Proc Freq Data = MYLIB.MYDATA Missing;

Tables CLASSVAR;

Run;

This will produce frequencies for each level of classvar, and percentages for each class as well as the whole population.

Kind regards

David