So I have seven different fields/variables in a SAS table each containing 1's and 0's. I need to - if at all possible - display these seven variables in one single pie. Is this possible? If so how? When I do this: pie variable1 variable2 / options I get two pies. Is there a way for me to combine them into one?
Asked
Active
Viewed 85 times
1 Answers
0
If your indicators reflect percentages of a whole WITHOUT overlap then yes you can.
This applies to multiple choice questions where you can select One of the Above. If it's a question that is select All that apply, then this would not be appropriate.
You cannot use the GCHART procedure but first need to summarize your data. Use a proc means to calculate the sums and then pass those to your PROC.
Proc means data = have stackods sum;
VAR ind1-ind7;
ODS OUTPUT summary=totals;
Run;
Use the TOTALS dataset in your gchart with the sum as the Pie statement. I don't recall what the variable is called.

Reeza
- 20,510
- 4
- 21
- 38
-
This is great. If this was a bar chart would things be different? – Flemming Hald Dec 01 '16 at 20:37
-
A bar chart for each indicator is better if you have overlaps as each bar can be category on its own, rather than represent part of a whole. – Reeza Dec 01 '16 at 21:19
-
You would have to change your data structure but not presummarize your data. – Reeza Dec 01 '16 at 21:19