BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
xyxu
Quartz | Level 8

I use PROC EXPAND to compute moving sum of an indicator variable. For most of observations, the value is zero. However, the resulting sum is not zero. They are extremely small nonzero values, such as -5.69382E-59.

 

Why does it happen? How to make them "behave as they should"?

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

I also noticed that rounding errors seem to accumulate more quickly with proc expand than in other SAS procs. Sometimes, unbeknownst to you, the values are the result of a spline interpolation, which tends to be less precise. Requesting a different interpolation method may improve things.

PG

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

SAS stores numbers in 8 bytes of storage. That means it can hold numbers up to 15 digits long accurately. Anything beyond 15 digits, and that includes decimal places, will be subject to "random" discrepancies. That includes PROC EXPAND.

 

Here is a more detailed explanation: http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t...

 

PGStats
Opal | Level 21

I also noticed that rounding errors seem to accumulate more quickly with proc expand than in other SAS procs. Sometimes, unbeknownst to you, the values are the result of a spline interpolation, which tends to be less precise. Requesting a different interpolation method may improve things.

PG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 895 views
  • 0 likes
  • 3 in conversation