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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.