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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.