A real world example of the need for labled missing values.

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

A real world example of the need for labled missing values.

Art Kendall
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

Art Kendall
How to have labeled missing values on date variables.
New file.
data list list /MyDate (adate10).
Begin data.
12/25/2021
7/4/2021
5/5/2000
12/25/2021
7/4/2021
5/5/2000
12/25/2021
7/4/2021
5/5/2000
10/15/1582
10/16/1582
12/25/2021
7/4/2021
5/5/2000
10/15/1582
10/16/1582
10/17/1582
12/25/2021
7/4/2021
5/5/2000
10/15/1582
10/16/1582
10/10/1800
end data.
display dictionary.
missing values MyDate ('10/15/1582' THRU '10/20/1582', '10/10/1800').
Value labels MyDate
'10/15/1582' 'unknown'
'10/16/1582' 'refused to answer'
'10/10/1800' 'forgot to ask'.
display dictionary.
frequencies MyDate.
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

jkpeck
Note this requirement, quoting the CSR,
values must be expressed in the same date format as the defined date format for the variable.
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

parisec
In reply to this post by Art Kendall
Thanks Art. This is a nice bit of code to have handy!

Carol
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

Art Kendall
For a long time I was mistaken that dates could not have missing values.
I had tried tried day 0 as missing.  I later found out that we can have many labelled missing values as long as we start them at day 1.


missing values MyDate(10/14/1582).

I was going to test the syntax above for day 0.  But for some reason SPSS 27 is coming up with a Java error and SPSS 24 will not start. The timing of this is not as bad as it could be since I have several SPSS projects that may be starting, I have none at the moment.
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

Art Kendall
I finally downloaded SPSS 28 and updated the example syntax to force error messages for Day 0.

TMissing_Values_for_Dates.sps
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: A real world example of the need for labled missing values.

parisec
In reply to this post by Art Kendall
I was also under the same impression, that you could not label dates as missing, which is why i was really happy to see this code!