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
- /
- rearranging data in sas

- 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

09-25-2011 11:30 PM

* *

I have a data in sas like:

Category Response

A 50% - 70%

A 0%

A 0%

A More than 70%

B More than 70%

B 1% - 49%

B 0%

B 0%

B 50% -70%

I want my result data to look like:

Response A B

0% 2 (50%) 2 (40%)

1% -49% 0(0%) 1 (20%)

50%- 70% 1 (25%) 1 (20%)

More than 70% 1 (25%) 1 (20%)

Explanation of result data:

There are two categories A (=4)and B (=5) and there are four different types of response 0%, 1% -49%, 50% -70% and more than 70%.

In category A, only two out of four responded 0%, thus result is 2 (50%). Similarly in A, on;y one out of four responded 50-70%, thus result is 1 (25%).

Same as B for each response.

I would be grateful for your time reagarding the same.

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

Posted in reply to Nupur20

09-26-2011 01:15 AM

proc freq ;

tables response*category / norow nopercent ;

run;