Calculating percentages and scores

Viewed 55

Lets say I have data which looks like:

ID   A1Q A2Q B1Q B2Q Continued
23      1  2 2 3 
24      1  2 3 3 

To understand the table it translates into, Person with ID 23 had answers 1,2,2,4 for the questions A1,A2,B1,B2 respectively. I want to know how to know the percentage of students who answered 1, 2 or 3 in the entire dataset.

I have tried using

PROC FREQ data = test.one;
tables A2Q-A2Q;
tables B1Q-B2Q;
RUN;

But this does not get me what I want. It separately analyzes each question and the output is long. I just need it into one table that tells me this percentage answered 1, this percentage answered 2 and etc.

The output could be:

Question:         1    2   3
Percentage A1Q    40%  40%  20%
Percentage A2Q    60%  20%  20%
Total Percentage  30%  30%  40%

So it would translate such that 40% people chose 1, 40% chose 2, and 30% chose 3 for question A1Q. The total percentage is out of all the people that gave answers, 30% chose 1 30% chose 2 and 40% chose 3.

2 Answers
Related