Dear Members,
I have encountered a problem while computing sum and mean in SAS for particularly a set of four numbers (0.3, -0.2, -0.1, 0). While I pass these numbers to Proc means the output gives sum as -2.77556E-17 and mean as -6.93889E-18. While actually the sum should be zero and hence the mean should be zero.
I have also tested with different order combination of above 4 numbers (there are 24 combination of arranging different order) where for some of the combination I am getting sum as -5.55112E-17 and mean as -1.38778E-17. The same problem occurs in Proc Summary, even tested with Proc GLM, PROC mixed, which gives different answers in LSmeans.
But Proc Univariate gives the correct result with mean and sum as zero.
If any one can give some insight what is happening with this four magic numbers. Also I have cross checked with Excel and R and facing the same problem for different order combination of above 4 numbers.
PS Attached PROC MEANS and PROC UNIVARIATE output for reference.
Kind Regards,
Rajesh kumar
... View more