Dear all,
I would like to calculate mutiple percentage by treatment and put it to one table . Is there any efficeint way for this ?
proc freq data = t ;
tables treatment *( d1 d2 d3 ................................ d100) ;
run;
With the following output table :
treatment disease count percentage
1 d1
d2
d3
.......
2
d1
d2
d3
..........
4
Thank you,
Ivy
Transpose your data and use proc freq.
Yes it does.
Why do you think it won't work? In fact, I think it was also suggested yesterday when you were looking for the maximum value.
The word year doesn't appear in your initial post...
Please post sample data and sample expected output. You can make fake data for 5 or 10 d's rather than the full 100.
Thank you, Reeza.
Sample data:
treatment id d1 d2 d3
a 1 0 1 0
a 2 1 0 0
a 3 1 0 1
a 4 0 1 0
b 1 0 0 0
b 2 1 0 0
b 3 0 1 1
b 4 1 0 0
Output :
Treatment_a Treatment_b P-value
d1 (percent)
d2
d3
Because you've coded your data as binary, transpose and use proc means. Sum will provide count and mean will provide the percentage.
I have no idea what you want anymore...good luck.
What test will you be running to get a p-value?
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.