Double occurence of 0 (Zero)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Double occurence of 0 (Zero)

Staffan Lindberg

Hi!

 

I’ve been inactive on this list for a long time but am now trying to revive my memory. I’ve got a question from my son who is a SAS-programmer. He got a SPSS-file with an age variable  (probably the result of translation from another data base system such as DBMSCOPY or similar). There he got a frequency table of the age variable with 2 occurences of 0 (zero). I remember having this problem a long time ago but do not remember the explanation for it.

 

Can anybody help?

 

best

 

Staffan Lindberg

Sweden

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Double occurence of 0 (Zero)

Jon Peck
The values are actually different but the formatting makes them appear to be the same.  Increase the number of decimals in the variable format to see the different values.

On Tue, Feb 6, 2018 at 10:31 AM Staffan Lindberg <[hidden email]> wrote:

Hi!

 

I’ve been inactive on this list for a long time but am now trying to revive my memory. I’ve got a question from my son who is a SAS-programmer. He got a SPSS-file with an age variable  (probably the result of translation from another data base system such as DBMSCOPY or similar). There he got a frequency table of the age variable with 2 occurences of 0 (zero). I remember having this problem a long time ago but do not remember the explanation for it.

 

Can anybody help?

 

best

 

Staffan Lindberg

Sweden

===================== 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
--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Double occurence of 0 (Zero)

Rich Ulrich

Jon,

I'm pretty sure that you have nailed it, number of decimals.


The question does remind me that I used a computer system once, which

distinguished between "zero" and "minus-zero"; and I ran a program which

assumed Fortran would read blanks as minus-zero for Missing and then tested

for Missing. My available Fortran did not implement "read" that way, so I had to

re-punch the data cards to replace blanks with "-0" in order to designate the Missing.


I think they don't make computers like that any more.

--

Rich Ulrich


From: SPSSX(r) Discussion <[hidden email]> on behalf of Jon Peck <[hidden email]>
Sent: Tuesday, February 6, 2018 12:34:16 PM
To: [hidden email]
Subject: Re: Double occurence of 0 (Zero)
 
The values are actually different but the formatting makes them appear to be the same.  Increase the number of decimals in the variable format to see the different values.

On Tue, Feb 6, 2018 at 10:31 AM Staffan Lindberg <[hidden email]> wrote:

Hi!

 

I’ve been inactive on this list for a long time but am now trying to revive my memory. I’ve got a question from my son who is a SAS-programmer. He got a SPSS-file with an age variable  (probably the result of translation from another data base system such as DBMSCOPY or similar). There he got a frequency table of the age variable with 2 occurences of 0 (zero). I remember having this problem a long time ago but do not remember the explanation for it.

 

Can anybody help?

 

best

 

Staffan Lindberg

Sweden

===================== 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
--
Jon K Peck
[hidden email]

===================== 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
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Double occurence of 0 (Zero)

Jon Peck
I remember such a system. -- long extinct.  But in such a system, Statistics would still consider those two values to be the same, I think, and put the count in a single row, as long as it was not a string variable.

On Tue, Feb 6, 2018 at 11:11 AM Rich Ulrich <[hidden email]> wrote:

Jon,

I'm pretty sure that you have nailed it, number of decimals.


The question does remind me that I used a computer system once, which

distinguished between "zero" and "minus-zero"; and I ran a program which

assumed Fortran would read blanks as minus-zero for Missing and then tested

for Missing. My available Fortran did not implement "read" that way, so I had to

re-punch the data cards to replace blanks with "-0" in order to designate the Missing.


I think they don't make computers like that any more.

--

Rich Ulrich


From: SPSSX(r) Discussion <[hidden email]> on behalf of Jon Peck <[hidden email]>
Sent: Tuesday, February 6, 2018 12:34:16 PM
To: [hidden email]
Subject: Re: Double occurence of 0 (Zero)
 
The values are actually different but the formatting makes them appear to be the same.  Increase the number of decimals in the variable format to see the different values.

On Tue, Feb 6, 2018 at 10:31 AM Staffan Lindberg <[hidden email]> wrote:

Hi!

 

I’ve been inactive on this list for a long time but am now trying to revive my memory. I’ve got a question from my son who is a SAS-programmer. He got a SPSS-file with an age variable  (probably the result of translation from another data base system such as DBMSCOPY or similar). There he got a frequency table of the age variable with 2 occurences of 0 (zero). I remember having this problem a long time ago but do not remember the explanation for it.

 

Can anybody help?

 

best

 

Staffan Lindberg

Sweden

===================== 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
--
Jon K Peck
[hidden email]

===================== 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
--
Jon K Peck
[hidden email]

===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Double occurence of 0 (Zero)

Rich Ulrich
In reply to this post by Staffan Lindberg

The standard internal SPSS format for a number is single- or double-precision floating point,

regardless of what SPSS or another package says to use as the format to display it. 

Use the E-format to show all decimals - whatever the documentation says is the maximum. 


Ordinary, rational fractions are stored imprecisely unless they represent a power of 2, like 1/2, 1/4, ....


An age of one day, transformed to  "1/365 years", will look like zero; that is usually fixed by using

Truncate( )  or Round( ) when doing the Compute.


Trickier to spot - subtracting fractions can give something very /near/ to an integer, but not exactly.

Thus, if you subtract (1/3+1/3)  from 2/3, you may or may not get zero, depending on the exact

internal representations. The difference will be last couple of reportable digits.


--

Rich Ulrich



From: SPSSX(r) Discussion <[hidden email]> on behalf of Staffan Lindberg <[hidden email]>
Sent: Tuesday, February 6, 2018 12:31:47 PM
To: [hidden email]
Subject: Double occurence of 0 (Zero)
 

Hi!

 

I’ve been inactive on this list for a long time but am now trying to revive my memory. I’ve got a question from my son who is a SAS-programmer. He got a SPSS-file with an age variable  (probably the result of translation from another data base system such as DBMSCOPY or similar). There he got a frequency table of the age variable with 2 occurences of 0 (zero). I remember having this problem a long time ago but do not remember the explanation for it.

 

Can anybody help?

 

best

 

Staffan Lindberg

Sweden

===================== 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
===================== 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