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"?
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.
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...
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.