I have a dataset like this
Id var cat n value
1 var1 cat1 1 A
2 var2 cat2 2 B
3 var3 cat3 1 C
4 var4 cat1 1 A
5 var5 cat2 2 B
6 var6 cat3 2 C
7 var7 cat1 1 A
8 var8 cat2 1 B
9 var9 cat3 2 C
The required o/ p looks like this
A B C
N=1 n=2 n=1 n=2 n=1 n=2
Cat1
Var1 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var4 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var7 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Cat2
Var2 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var5 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var8 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Cat3
Var3 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var6 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Var9 xx (xx) xx(xx) xx (xx) xx(xx) xx (xx) xx(xx)
Where xx(xx) refers to counts of each var with percentages in braces.
Someone please help me with a soln.
Thanks
My eyes don't really relate to the desired solution you have typed. I can't grasp it unless you type it in with appropriate spacing so it actually looks like a real table that SAS might output.
I suggest you spend some time providing such a properly spaced output that looks like an actual table by typing what you want into the window that appears when you click on the {i} icon, which will preserve the spacing, and make the results look like an actual table.
hi ,
This is the mock o/p.Values i have written are not accurate but it should follow the same format throughout.
how can i do this?
Hi mam,
I have edited my post.Hope that is in a proper way to understand.
It looks like a STDM report.
Here is an example , Hope you could learn something from it.
https://communities.sas.com/t5/SAS-Programming/Table-format-final-output/m-p/552646#M153624
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 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.
Ready to level-up your skills? Choose your own adventure.