Hi. I am trying to create a summary dataset of the following:
var1 var2 var3 var4 var5
var1 is the main variable and vars2-5 contain text values. What I would like is a report that shows the frequencies of var2 values against var1, var3 against var1, etc.
Proc Freq summarised the frequencies nicely one variable at a time BUT there are 50 vars and this method created 50 different datasets which is not practical to work with. Is there a way of doing this in one step and creating only one dataset? I have a feeling Proc Tabulate might do the trick, but I am struggling as I cannot put var2-5 under VAR as they are text fields and classing them with var1 creates a complex cross-matrix that does not give me what I need (unless there is a trick with the syntax in Proc Tabulate). Any ideas?
The output from this job is too lengthy to show here, but you get a flat list for the first table region*product and then another flat list for product*subsidiary. The information for each crossing is differentiated by a TABLE variable that shows which table statement created the observation. In addition, you can sometimes get the kind of summarizing you want from PROC MEANS. I'm not sure you need TABULATE...although, TABULATE will allow you to nest or cross character variables but you are limited to the N or PCTN statistic.
proc tabulate data=sashelp.shoes;
class region product subsidiary;