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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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