differences in rounding in procedures -- from a LinkedIN list

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

differences in rounding in procedures -- from a LinkedIN list

Art Kendall
A user post said that he obtained
a rounded value of 17 from 40 cases, 7 with a 100, 33 with a 0
another user with version 20 obtained 17.4999999999999960 from ctables,
frequencies, descriptives but obtained a correct value from EXPLORE!
I was unable to replicate it.
I have version21 without the patch. Windows8 64-bit quad processor
homebrew PC.

  please post  platform  that you used to get a 17 for rounded

Using the syntax below I get

procedure      xmean             rounded

examine1      17.500000000000100 18
ctables1      17.500000000000090 18
descriptives1 17.500000000000090 18
frequencies1  17.500000000000100 18
aggregate     17.500000000000000 18
. .
examine2      17.500000000000100 18
ctables2      17.500000000000090 18
descriptives2 17.500000000000090 18
frequencies2  17.500000000000100 18

input program.
loop #i = 1 to 7.
compute x = 100.
end case.
end loop.
loop #i = 1 to 33.
compute x = 0.
end case.
end loop.
end file.
end input program.
formats x (f20.15).
dataset name madeup.
EXAMINE VARIABLES=x
/PLOT NONE
/STATISTICS DESCRIPTIVES
/CINTERVAL 95
/MISSING LISTWISE
/NOTOTAL.

CTABLES
/VLABELS VARIABLES=x DISPLAY=BOTH
/TABLE x [S][MEAN f20.15].

DESCRIPTIVES VARIABLES=x
/STATISTICS=MEAN.
frequencies variable = x/format= notable /statistics= mean.
compute constant=1.
dataset declare aggfile.
aggregate outfile=aggfile/break= constant
/xmean= mean(x).
dataset activate aggfile.
formats xmean(f20.15).
list.

dataset activate madeup.
EXAMINE VARIABLES=x
/PLOT NONE
/STATISTICS DESCRIPTIVES
/CINTERVAL 95
/MISSING LISTWISE
/NOTOTAL.

CTABLES
/VLABELS VARIABLES=x DISPLAY=BOTH
/TABLE x [S][MEAN f20.15].
DESCRIPTIVES VARIABLES=x
/STATISTICS=MEAN.
frequencies variable = x/format= notable /statistics= mean.

--
Art Kendall
Social Research Consultants

Art Kendall
Social Research Consultants