I currently have a very large dataset in SPSS where some variables have up to 8 decimal places. I know how to change the options so that SPSS only displays variables to 2 decimal places in the data view and output. However, SPSS still applies the 8 decimal precision in all calculations. Is there a way to change the precision to 2 decimal places without having to manually change every case?
2 Answers
You'll have to round each of the variables. You can loop through them like this:
do repeat vr=var1 var2 var3 var4 var5.
compute vr=rnd(vr, 0.01).
end repeat.
If the variables are consecutive in the file you can use to
like this:
do repeat vr=var1 to var5.
....

- 10,898
- 11
- 40
- 44
SPSS Statistics treats all numeric variables as double-precision floating point numbers, regardless of the display formats. Any computations (other than those in one older procedure, ALSCAL) are done in double precision, and you don't have any way to avoid that.
The solution that you've applied will not actually make any calculations use only two decimals of precision. You'll start from that point with numbers rounded to approximately what they would be to two decimals, but most of them probably aren't exactly expressable as double precision floating point numbers, so what you're actually using isn't what you're seeing.

- 576
- 3
- 5