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
Opal | Level 21

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 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
  • 2 replies
  • 606 views
  • 0 likes
  • 3 in conversation