BookmarkSubscribeRSS Feed
acemanhattan
Quartz | Level 8

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;

3 REPLIES 3
Astounding
Opal | Level 21

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.

JamesM1962
Calcite | Level 5

Do you have missing values in current_ctg and/or yearmo?

acemanhattan
Quartz | Level 8

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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 864 views
  • 0 likes
  • 3 in conversation