Good afternoon,
I have a quick question, and was wondering if someone in the community could help.
I am running proc tabulate on some data. To be sure the code ran as intended, I manually computed a few cells.
Attached is a snapshot from proc tabulate, which reports a 3.69 row percent, a numerator of 642,583 and denominator of 16,780,658.
As a hedge, I manually computed 642,583 / 16,780,658 and came up with 3.83%. I ASSUME the following code is incorrect.
Thoughts on the apparent discrepancy? Thanks.
-----------
proc tabulate
data=DSN format=comma20.2;
CLASS STATE / ORDER=UNFORMATTED MISSING;
CLASS Flag1 / ORDER=UNFORMATTED MISSING;
CLASS D120_flag / ORDER=UNFORMATTED MISSING;
TABLE /* Row Dimension */
STATE*(
D120_flag*(
N
RowPctN)
ALL={LABEL="Total (ALL)"}*N)
ALL={LABEL="Total (ALL)"}*(
N
RowPctN
D120_flag*(
N
ColPctN)),
/* Column Dimension */
Flag1;
;
* freq cur_upb_amt;
run;
;
Thanks.
The coding error has been identified.
Row values were not totaled. So, the denominator used in the calculation was not the 'total'.
The calculation makes sense now that this adjustment was made.
Manual checks. What would we do without them.
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.