Visually Examining Large Data Files

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

Visually Examining Large Data Files

Matthew Boswell
We have a longitudinal dataset that covers the 50 US states for about 24
years (1980-2004) with about 10 variables for each case.  The case is the
state for that year, so:

STATENAME  ID    YEAR    AA .. WW  XX  YY  ZZ
AL         1     1980    15     0   3  1   1
AK         2     1980    7      4   4  1   1
AR         3     1980    8      0   1  1   1


We need to inspect each occurence of "0", it might be a missing value from
the original data set, or it might be an actual "0" (how we are making this
determination is for another posting!!!).  What I would like to do is just
get a paper listing of all these 0 values.  However, I also need to get the
state and the year with them, as well as the variable name, of course.
CROSSTABS was the only thing I could think of, but it did not come out
usable.  Is there any way to create a table of all the 0 values?

Thanks!
Matt B.
Reply | Threaded
Open this post in threaded view
|

Re: Visually Examining Large Data Files

David Wasserman
Try this (untested):

TEMPORARY.
SELECT IF ANY(0, AA TO ZZ).
PRINT STATENAME ID YEAR AA TO ZZ.
EXECUTE.

Of course, this will list all the variables from AA to ZZ, and you'll need
to examine them to see which one (or ones) is (or are) 0.

Other solutions that will list only the variables with a value of 0 are much
more verbose.  You could repeat the syntax above with AA eq 0 for the first,
BB eq 0 for the second, etc., instead of ANY(0, AA TO ZZ), and list only the
tested variable.

This is one of the occasions in which EXECUTE is required, as PRINT will
otherwise wait for a procedure before executing.

David Wasserman
Custom Data Analysis and SPSS Programming



----- Original Message -----
From: "Matthew Boswell" <[hidden email]>
To: <[hidden email]>
Sent: Sunday, December 17, 2006 2:44 PM
Subject: Visually Examining Large Data Files


> We have a longitudinal dataset that covers the 50 US states for about 24
> years (1980-2004) with about 10 variables for each case.  The case is the
> state for that year, so:
>
> STATENAME  ID    YEAR    AA .. WW  XX  YY  ZZ
> AL         1     1980    15     0   3  1   1
> AK         2     1980    7      4   4  1   1
> AR         3     1980    8      0   1  1   1
>
>
> We need to inspect each occurence of "0", it might be a missing value from
> the original data set, or it might be an actual "0" (how we are making
> this
> determination is for another posting!!!).  What I would like to do is just
> get a paper listing of all these 0 values.  However, I also need to get
> the
> state and the year with them, as well as the variable name, of course.
> CROSSTABS was the only thing I could think of, but it did not come out
> usable.  Is there any way to create a table of all the 0 values?
>
> Thanks!
> Matt B.
>