Hello,
I am trying to put together a bunch of partial proc freq tables and would like to do this automatically if possible. What I have is a bunch of proc freqs that are cross tabs of two different binary indicator variables. An example is:
Table of iah by prov | |||
iah | prov | ||
Frequency Percent Row Pct Col Pct | 0 | 1 | Total |
0 | 168177 34.08 34.15 99.67 | 324327 65.73 65.85 99.88 | 492504 99.81 |
1 | 553 0.11 59.08 0.33 | 383 0.08 40.92 0.12 | 936 0.19 |
Total | 168730 34.19 | 324710 65.81 | 493440 100.00 |
From this (and about 20 more) I want to grab the bolded red numbers from each of the 20 tables to make a new dataset/table that I can print and have to output to excel. I just don't know how to reference these values.
Thanks
If this is to make a report you might look at a different proc.
Maybe something like:
proc tabulate data= have;
class prov;
var prog_1 prog_2 prog_3 ...; /* if they are all named prog_ you could use a variable list like prog_: */
table Prog_1 prog_2 prog_3 ,
(prov All='Total') * sum="";
run;
This wll work for variables coded 0/1 as the sum would be the count of 1 values.
Can you please post a sample of what you want your output to look like, as well as how you're running your multiple proc freqs or table statements.
Definitely, yeah I have never had an output related question like this before.
So for the proc freq I guess it isn't multiple proc freqs (I could do a macro though if necessary), but the command is like this.
proc freq data=test; table prog_1*prov prog_2*prov prog_3*prov;run;
and what I want is a table to be like the following
prov=1 prov=0 prov total
prog_1=1 2 3 5
prog_2=1 4 2 6
prog_3=1 7 0 7
Does this help?
If this is to make a report you might look at a different proc.
Maybe something like:
proc tabulate data= have;
class prov;
var prog_1 prog_2 prog_3 ...; /* if they are all named prog_ you could use a variable list like prog_: */
table Prog_1 prog_2 prog_3 ,
(prov All='Total') * sum="";
run;
This wll work for variables coded 0/1 as the sum would be the count of 1 values.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.