identifying missing cases

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

identifying missing cases

lts1
Hi SPSSers,
 
I am trying combine the "If (Any," command with they key word missing but have only succeeded in generating error messages. So, I resorted to the following:
 
IF  (MISSING (v1) OR MISSING (v45) OR MISSING (v63) OR MISSING (v78)
OR MISSING (v126) OR MISSING (v154))  Miss=1.
 
But it's cumbersome, and I have a lot more than 6 variables. Can anyone tell me how to simplify this?
 
Thanks in advance.
 
    Best,
        Lisa
 
 
Reply | Threaded
Open this post in threaded view
|

Re: identifying missing cases

Albert-Jan Roskam
Hi,

This vaguely reminds me of an earlier post.

* not sure if this is correct (was it Bruce who posted this before?).
compute miss =  any($sysmis, v1 to v1000). 

* this will work.
do repeat #x = v1 to v1000.
+if ( missing(#x) ) miss = 1.
end repeat.

when I make syntax errors, 9 out of 10 times they are related to missing values. So double check this code. ;-)

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Sun, 8/1/10, Lisa T. Stickney <[hidden email]> wrote:

From: Lisa T. Stickney <[hidden email]>
Subject: [SPSSX-L] identifying missing cases
To: [hidden email]
Date: Sunday, August 1, 2010, 8:36 PM

Hi SPSSers,
 
I am trying combine the "If (Any," command with they key word missing but have only succeeded in generating error messages. So, I resorted to the following:
 
IF  (MISSING (v1) OR MISSING (v45) OR MISSING (v63) OR MISSING (v78)
OR MISSING (v126) OR MISSING (v154))  Miss=1.
 
But it's cumbersome, and I have a lot more than 6 variables. Can anyone tell me how to simplify this?
 
Thanks in advance.
 
    Best,
        Lisa
 
 

Reply | Threaded
Open this post in threaded view
|

Re: identifying missing cases

John F Hall
In reply to this post by lts1
Try
 
count xx = v1 v45 v63 v78 v126 v154 (missing) .
recode xx (1 thru hi = 1) .
freq xx .
----- Original Message -----
Sent: Sunday, August 01, 2010 8:36 PM
Subject: identifying missing cases

Hi SPSSers,
 
I am trying combine the "If (Any," command with they key word missing but have only succeeded in generating error messages. So, I resorted to the following:
 
IF  (MISSING (v1) OR MISSING (v45) OR MISSING (v63) OR MISSING (v78)
OR MISSING (v126) OR MISSING (v154))  Miss=1.
 
But it's cumbersome, and I have a lot more than 6 variables. Can anyone tell me how to simplify this?
 
Thanks in advance.
 
    Best,
        Lisa
 
 
Reply | Threaded
Open this post in threaded view
|

Re: identifying missing cases

Bruce Weaver
Administrator
In reply to this post by Albert-Jan Roskam
If the OP wants MISS=0 when it is not 1, then this one-liner will work:

compute miss = nmiss(v1,v45,v63,v78,v126,v154) GT 0.
exe.


Albert-Jan Roskam wrote
Hi,

This vaguely reminds me of an earlier post.

* not sure if this is correct (was it Bruce who posted this before?).
compute miss =  any($sysmis, v1 to v1000). 

* this will work.
do repeat #x = v1 to v1000.
+if ( missing(#x) ) miss = 1.
end repeat.

when I make syntax errors, 9 out of 10 times they are related to missing values. So double check this code. ;-)

Cheers!!

Albert-Jan



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Sun, 8/1/10, Lisa T. Stickney <Lts1@ptd.net> wrote:

From: Lisa T. Stickney <Lts1@ptd.net>
Subject: [SPSSX-L] identifying missing cases
To: SPSSX-L@LISTSERV.UGA.EDU
Date: Sunday, August 1, 2010, 8:36 PM



 
 

Hi SPSSers,
 
I am trying combine the "If (Any," command
with they key word missing but have only succeeded in generating error
messages. So, I resorted to the following:
 
IF  (MISSING (v1) OR MISSING (v45) OR MISSING
(v63) OR MISSING (v78)
OR MISSING (v126) OR MISSING (v154)) 
Miss=1.

 
But it's cumbersome, and I have a lot more than 6
variables. Can anyone tell me how to simplify this?
 
Thanks in advance.
 
    Best,
        Lisa
 
 

--
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/).