I have a dataset and I need to run a proc-freq cross-tabulation (two-way frequency table) of one variable by all variables in the dataset.
Is there a way to do this without writing a step for each cross-tabulation? I have 70+ variables I need to run against sectorcollapsed.
proc freq data=cath.characterlabels;
table sectorcollapsed*location;
run;
I used a by-step, which didn't give me the output I needed, as it did tables separately for each category of the by variable (So I have 70*4 tables, which I do not want)
I would like the output of each variable to look exactly similar to what the tables code would give for each cross-tabulation with the following:
| Location1 | Location2 | Location3 | | Total |
Sector1 | Frequency Percent Row Pct Col Pct | .... | .... | | |
Sector2 | | | | | |
Sector3 | | | | | |
| | | | | |
| | | | | |
(Count (n), Frequency(%), RowPct, ColPct, and then the total.
Any help would be greatly appreciated!