1695814
05-07-2003, 01:02 PM
Is there a command in SAS - Proc Tabulate so that I can get the percentage of the total of a variable?
I imagine the output would look something like this:
---------------------------
|.......|....CT....|....CT....|
|.......|-------- +---------+
|.......|..SUM...|.....%.....|
|-----+--------+----------+
|class|..........|..............|
|------|...........|..............|
|AA...|___732|__20.80|
|-----+--------+----------+
|BB...|___005|__00.14|
|-----+--------+----------+
|CC...|___440|__12.50|
|-----+--------+----------+
|DD...|___777|__22.07|
|-----+--------+----------+
|EE...|____782|__22.22|
|-----+--------+----------+
|FF...|____784|__22.27|
---------------------------
|ALL..|__3,520|__100.00|
---------------------------
Here's my proc tabulate statement now:
PROC TABULATE;
CLASS class;
VAR CT;
TABLE class ALL,
CT*F=COMMA8.0
CT*(??????<CT>)*F=COMMA10.2
Where ?????? is where the secret code goes...at least I think it does.
OK, thanks.
I imagine the output would look something like this:
---------------------------
|.......|....CT....|....CT....|
|.......|-------- +---------+
|.......|..SUM...|.....%.....|
|-----+--------+----------+
|class|..........|..............|
|------|...........|..............|
|AA...|___732|__20.80|
|-----+--------+----------+
|BB...|___005|__00.14|
|-----+--------+----------+
|CC...|___440|__12.50|
|-----+--------+----------+
|DD...|___777|__22.07|
|-----+--------+----------+
|EE...|____782|__22.22|
|-----+--------+----------+
|FF...|____784|__22.27|
---------------------------
|ALL..|__3,520|__100.00|
---------------------------
Here's my proc tabulate statement now:
PROC TABULATE;
CLASS class;
VAR CT;
TABLE class ALL,
CT*F=COMMA8.0
CT*(??????<CT>)*F=COMMA10.2
Where ?????? is where the secret code goes...at least I think it does.
OK, thanks.