I have a problem with quite a simple proc step.
proc tabulate data=some_data;
class time;
var boolean1;
table time, n boolean
Time | Number of obs in a given time (n) | sum of boolean variable | What i want |
---|---|---|---|
1 | 100 | 10 | (10/100)*100% |
2 | 200 | 50 | (50/200)*100% |
3 | 300 | 60 | (60/300)*100% |
4 | 400 | 80 | (80/400)*100% |
... | .. | ... |
But actually, I want to get the percent of the sum of boolean variable over a number of observations in a given period.
I tried boolean*rowpctn, different denominators for pctn<>, but none of this worked.
Could you please help me?
To me, it looks like you're asking for
TABLE time, boolean1 * (N Sum Mean);
Tom
To me, it looks like you're asking for
TABLE time, boolean1 * (N Sum Mean);
Tom
Thanks. I tried this before, but somehow I didn't notice that I have to apply "percent" format and I thought the figures are wrong .
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.