Why would the difference between these two pieces of code cause the aggregate sum of all observations' mmos to be different?
I understand that we shouldn't expect the observations to individually be the same, but shouldn't the aggregate totals be?s
proc summary noprint missing nway data=v_mmr_&state;
Class inc_year lob plan_number SCC tin tin_nm_rllp stat;
Var mmos_:;
output out=mmrsum_&state (drop=_type_ _freq_) sum=;
quit;
proc summary noprint missing nway data=v_mmr_&state;
Class inc_year lob plan_number SCC tin tin_nm_rllp stat current_ctg yearmo;
Var mmos_:;
output out=mmrsum_&state (drop=_type_ _freq_) sum=;
quit;
The totals should be the same, sort of. A couple of related questions, though:
How different are they?
How many observations are there in each output data set?
Since you're already using the MISSING option, I would suspect this is a matter of floating point arithmetic. Adding up imprecisely stored sets of values should get very nearly (but not necessarily exactly) the same total.
Good luck.
Do you have missing values in current_ctg and/or yearmo?
So I think the issue is that when I tried to compare the two datasets in Excel, the first dataset is small enough for Excel but the second one isn't.
When I compare them in SAS they end up being the same.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.