Help using Base SAS procedures

Omitting individual information to display in the Proc Tabulate

Reply
N/A
Posts: 0

Omitting individual information to display in the Proc Tabulate

Dears,
I´d like to do a simple task but unfortunately I didn´t find a solution to this (in the manner of it is simple and automatic).

I´am producing a large amount of tables using proc tabulate and in no one of them can appear the value (monetary) of individual observation, for discloser question.

I´d like to know if its possible do build a new "proc tabulate" that can do this for me automatic, as example below.


Instead of :
Expenditures with employee

Regions....................Firm (n)...Value (US$)
South.........................10..........2.000,00
South west...................5..........1.500,00
North...........................1.............200,00

I´d like of:

Regions....................Firm (n)...Value (US$)
South.........................10..........2.000,00
South west...................5..........1.500,00
North...........................1....................(x)

(x)= Numeric data omitted to avoid individualization of information.

Sincerely

Edmundo
Campinas State University
Science and Policy Unit Research
SAS Super FREQ
Posts: 8,868

Re: Omitting individual information to display in the Proc Tabulate

Posted in reply to deleted_user
Hi:
This is really not the kind of thing you can do with PROC TABULATE without either pre-processing or post-processing the data.

It would be far easier to do this kind of thing with PROC REPORT because with PROC REPORT, you could test the vaue of N on every report row and if N=1, then you could assign missing to the Value variable. This ability to use programming logic involves the use of COMPUTE blocks in PROC REPORT -- that's why PROC REPORT is a better choice for this report than TABULATE.

Let's say that you had variables named REG and VAL and you wanted to have a PROC REPORT step that would be a summary report of this data (WORK.REGDATA):
[pre]
REG FIRM VAL

East aaa 175
South aa1 200
South aa2 200
South aa3 200
South aa4 200
South aa5 200
South aa6 200
South aa7 200
South aa8 200
South aa9 200
South aa10 200
South west bb1 150
South west bb2 150
South west bb3 150
South west bb4 150
South west bb5 150
North zzz 200
[/pre]

Note that East and North each only have 1 observation in the data. This PROC REPORT program would set the summary information for VAL to missing for North and East. The Options statement turns the display of the missing value to x instead of the usual '.' -- and then the COMPUTE AFTER block uses a LINE statement to write the message about the meaning of the x for missing values.

[pre]
options missing = 'x';

ods html file='c:\temp\regrept.html' style=sasweb;

proc report data=regdata nowd;
column reg n val;
define reg / group order=data 'Region';
define n / 'Firm (n)';
define val / sum f=dollar12.2;
compute val;
if n = 1 then
val.sum = .;
endcomp;
compute after;
line '(x)= Numeric data omitted to avoid individualization of information.';
endcomp;
run;

ods html close;
[/pre]

For more help with PROC REPORT or with COMPUTE blocks, your best bet is to read the PROC REPORT documentation and examples. In particular, Technical Report P-258 is very helpful for use in "batch" or the non-windowing environment ( http://support.sas.com/documentation/onlinedoc/v82/techreport_p258.pdf ). You could also consult with Tech Support for help with your particular report needs.

cynthia
N/A
Posts: 0

Re: Omitting individual information to display in the Proc Tabulate

Posted in reply to Cynthia_sas
Dear Cynthia, many thanks for your solution. Indeed it is the best choice and easy to implement. However, I don´t know if I ´ll have time enough to convert all of my proc tabulate into proc report.

For this reason I´am looking for a solution that could be done with proc tabulate.

Sincerely

Edmundo
Ask a Question
Discussion stats
  • 2 replies
  • 98 views
  • 0 likes
  • 2 in conversation