BookmarkSubscribeRSS Feed
Nupur20
Calcite | Level 5

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.

1 REPLY 1
Tom
Super User Tom
Super User

proc freq ;

  tables response*category / norow nopercent ;

run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 747 views
  • 0 likes
  • 2 in conversation