Missing data script

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

Missing data script

David-214
Hi, I've been looking everywhere and as a new user cant find an example.

Does anyone have a script or macro for SPSS that that will detect all cases
in the file with missing data, and then sort the file so that the cases with
missing data are at the top?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Missing data script

Richard Ristow
At 03:20 PM 9/15/2006, David wrote:

>Does anyone have a script or macro for SPSS that that will detect all
>cases in the file with missing data, and then sort the file so that
>the cases with missing data are at the top?

Here's how I'd do it, assuming that by 'script' you mean a syntax file,
not a Sax Basic script. (You really want a syntax file.) Untested:

COMPUTE MISSINGS = NMISS(<variable list>).
SORT CASES BY MISSINGS(D).

Replace "<variable list>", braces and all, by the list of variables you
want to test.

This will put the file in descending order by the number of missing
values in the variables in "<variable list>".
Reply | Threaded
Open this post in threaded view
|

Re: Missing data script

Hal 9000
Speaking for lazy people around the world, I'll emphasize that if the vars
you want to identify missing values for are contiguous in your variable
list, be sure to specify them as...

compute missings = nmiss(v1 to v500).

(I never met a shortcut I didn't like).
-Gary


On 9/15/06, Richard Ristow <[hidden email]> wrote:

>
> At 03:20 PM 9/15/2006, David wrote:
>
> >Does anyone have a script or macro for SPSS that that will detect all
> >cases in the file with missing data, and then sort the file so that
> >the cases with missing data are at the top?
>
> Here's how I'd do it, assuming that by 'script' you mean a syntax file,
> not a Sax Basic script. (You really want a syntax file.) Untested:
>
> COMPUTE MISSINGS = NMISS(<variable list>).
> SORT CASES BY MISSINGS(D).
>
> Replace "<variable list>", braces and all, by the list of variables you
> want to test.
>
> This will put the file in descending order by the number of missing
> values in the variables in "<variable list>".
>