I have noticed a discrepancy when applying a format to a mean where the last digit is 5. In the example below two means are calculated, both giving a result of exactly 90.55. However when the results are formatted to 6.1, one mean shows as 90.5 and the other as 90.6. data problem;
input gp x;
datalines;
1 92.8
1 93.4
1 94.6
1 81.4
2 90.55
2 90.55
2 90.55
2 90.55
;
run;
proc means data=problem mean;
by gp;
var x;
output out=means mean=x;
run;
proc print data=means;
format x 6.1;
run; The output from this code is as follows: --------------------------------------------- gp=1 ---------------------------------------------
The MEANS Procedure
Analysis Variable : x
Mean
90.5500000
--------------------------------------------- gp=2 ---------------------------------------------
Analysis Variable : x
Mean
90.5500000
Obs gp _TYPE_ _FREQ_ x
1 1 0 4 90.5
2 2 0 4 90.6 Can anyone explain this please?
... View more