Date: Thu, 13 Jan 2000 11:04:21 -0500
Reply-To: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject: Re: Tabulate question
Content-Type: text/plain; charset=US-ASCII
You can do it by normalizing the data set. PROC TRANSPOSE is my
preferred method. In this case it's necessary to generate a BY variable
so that each observation is transposed individually. I would do this in
a view, just for efficiency.
Tested code:
data test;
input var1 var2 var3;
cards;
1 2 3
4 . 5
2 3 4
;
data totransp / view = totransp;
set test;
* Add a suitable BY variable;
__by_obs = _n_;
run;
proc transpose data=totransp out=to_tabul;
by __by_obs;
var v:;
* Should pick up all variables beginning with letter "v";
run;
proc tabulate data=to_tabul;
class _name_ col1;
table _name_, col1*n*f=4.;
run;
Date: Thu, 13 Jan 2000 08:43:08 -0500
From: dennis.catley@CAPITALONE.COM
Subject: Tabulate question
Greetings O wise SAS wizards near and far:
a quick aside to my question below.....Pudge, to me, will always be
remembered as a Boston Red Sock...the big home run is just too
engrained, him waving the ball fair at Fenway.
On to the question....
I had a user ask the following, and for the life of me I just can't
seem to get tabulate to produce a good likeness of his report desires.
Thoughts anyone? And thanks in advance for all efforts!!!
Dennis Catley
Capital One Financial Services, Inc.
-----------------------
Do you know is it possible, or how to generate a table like the
following in SAS?
In the following table, 1-5 are the values of the variables, and n are
the count/frequency of corresponding values.
Var_name 1 2 3 4 5
var1 n n n n n
var2 n n n n n
var3 n n n n n