Hi Team,
Iam using Proc Report for creating a table. I have created a small dataset. i have 4 levels of a variable (L,P,S,W) and then sub_types within each level
O,V,U
the desired output is attached. Iam trying to find frequencies of only the 1's, Iam not interested in the 0's
Also, is there a way to output the data in a desired fashion, for eg.,
i want par6, par7 and part8 to be followed by part1 etc.,
Thank you,
Hi Reeza,
I created a dataset and an output but i was not able to post 2 spreadsheets. i have the dataset and the output in one spreadsheet in different tabs. Hopefully this should give us a better picture.
Thank You.
When you have a variable that is always 0 or 1, change the approach. To get a single statistic per variable:
To get the frequencies of the "1" values, get the sum.
To get the percentage of "1" values, get the mean.
You may have to adjust your computations, if your variable could take on other values, such as a missing value.
Good luck.
Thank You very much.
hi Reeza,
i think i figured it out, i ran a means within the table statement.
Thank you
proc tabulate data = test out = test1; by procedure1;
var par1 par2....;
class type sub_type;
table all*n (par1 par2 ) *mean = '' *f=pct100fmt.
, type = '' * sub_type= '' /nocellmerge;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.