Date: Mon, 31 Mar 2008 08:32:18 -0700
Reply-To: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject: Re: Proc Tabulate
In-Reply-To: <be9fc348-7a4a-46f9-b026-e7d02f4e0afc@m73g2000hsh.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
In general, if you want to perform calculations you have two choices:
1) Switch to PROC REPORT, and do the calculations in COMPUTE blocks, or
2) Do the calculations ahead of time in a data step, and have PROC
TABULATE print them, not calculate them.
Sandip wrote:
> Hi,
>
> I am using proc tabulate to generate tabular output. Following is my
> code--
>
> data test;
> input satisfaction;
> cards;
> 1
> 2
> 4
> 5
> 5
> 5
> 5
> 1
> 5
> 5
> ;
> run;
> proc format;
> value sat
> 1='Bad'
> 2='2'
> 3='3'
> 4='4'
> 5='Good';
> run;
> proc tabulate data=test;
> class satisfaction;
> table satisfaction,all;
> format satisfaction sat.;
> run;
>
>
> I want to add an extra row which will give the difference between good
> and bad. i.e. 6-2=4.
>
> Thanks in advance.
>
> Sandip
|