how many decimal places does SPSS accept in the data sheet?
Example from a csv file: var1;var2;var3 1.123456789123456789123456789123456789;1.123456789123456789123456789123456789;1.123456789123456789123456789123456789 SPSS first reads it as STRING. Then by trying to convert it into Numeric (ALTER TYPE var1 to var3 (F30.28).) it gives the following error message: Warnings Text: (End of Command) Command: ALTER TYPE The number of decimal digits exceeds the maximum number allowed for the specified format code. Execution of this command stops. Is F(40.16) the maximum?
Dr. Frank Gaeth
|
Ok, I got it. @JCW: Thanks for the info!
• For all numeric formats, the maximum width is 40. • For numeric formats where decimals are allowed, the maximum number of decimals is 16.
Dr. Frank Gaeth
|
In reply to this post by drfg2008
At 11:56 AM 8/3/2013, drfg2008 wrote:
>how many decimal places does SPSS accept in the data sheet? > >Example from a csv file: > >var1;var2;var3 >1.123456789123456789123456789123456789;1.123456789123456789123456789123456789;1.123456789123456789123456789123456789 > >SPSS reads it as STRING. Then by trying to convert it into Numeric >(ALTER TYPE var1 to var3 (F30.28).) it gives an error message. SPSS stores numeric data in binary with 53 bits precision, slightly less than 16 decimal digits. What that means for you depends on how the long numbers arise in your work, and what you need to do with them. For example, . They may be identifiers, and not need to be processed numerically. For that, retaining them as strings may suffice -- though, using any non-integer numeric value as an identifier is dangerous, and you should be careful of truncation or rounding errors in the low-order digits. . The actual values you need to work with may be differences between these high-precision values, or differences from same base value, and the differences may have lower precision, within SPSS's representation range. If so, you may be able to calculate the differences in your source system, and read only the differences into SPSS; or, harder but not impossible, read the numbers into SPSS as strings, and write what amounts to multiple-precision code in SPSS to calculate the differences. . You really may have values with extremely high precision. In that case, you may not be able to use SPSS (or other standard software packages, as most use the same numeric representation); but that will depend on what you need to compute from the values. So, please fill us in a little more on your needs. (And, if you're pushing the limits of SPSS's precision, remember: most statistical computations are not accurate to full machine precision. Algorithms have improved in recent years, and SPSS's are probably pretty good, but do not count on accuracy reaching, or even closely approaching, the full 53 bits.) ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by drfg2008
The point to remember here is not how many
decimals you can have but how many significant figures. Double precision
floating point numbers, which is how Statistics stores numeric data, can
maintain approximately 16 significant figures. Any digits beyond
that, decimal or otherwise, would be discarded. Statistics imposes
a limit on the format just to reduce the confusion level a little.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email], Date: 08/03/2013 11:47 AM Subject: Re: [SPSSX-L] decimal places Sent by: "SPSSX(r) Discussion" <[hidden email]> Ok, I got it. @JCW: Thanks for the info! • For all numeric formats, the maximum width is 40. • For numeric formats where decimals are allowed, the maximum number of decimals is 16. ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/decimal-places-tp5721462p5721466.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |