delete cases in SPSS

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

delete cases in SPSS

Devon
I want to delete all cases that have missing values on any variable. That
is, I want only cases that have values on all my variables. How do you do
that in spss? Can anyone help!? syntax or otherwise.

Thanks,
Devon

=====================
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: delete cases in SPSS

Bruce Weaver
Administrator
Devon wrote
I want to delete all cases that have missing values on any variable. That
is, I want only cases that have values on all my variables. How do you do
that in spss? Can anyone help!? syntax or otherwise.

Thanks,
Devon
If all of the variables are numeric, you can use the NMISS function.  Something like:

select if nmiss(firstvar to lastvar) =0.
exe.

Replace "firstvar" and "lastvar" with the names of the first and last variables in your file.  I don't have SPSS on this PC, so I can't check, but you might be able to use the keyword ALL inside the parentheses too.  I.e.,

select if nmiss(all) =0.
exe.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: delete cases in SPSS

Richard Ristow
At 09:52 PM 10/27/2010, Bruce Weaver wrote:

If all of the variables are numeric, you can use the NMISS function.
Something like:

select if nmiss(firstvar to lastvar) =0.
exe.

Yes. Except (to point this out from time to time) the 'exe.' statement is NOT necessary, nor helpful; and can slow processing significantly, for large files.
===================== 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