Defining missing values for multiple variable in prepartion for an MVA

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

Defining missing values for multiple variable in prepartion for an MVA

AndrewM
I have a large data set where many of the cells are blank (these are string variables) and SPSS is not recognizing them as blanks when I run an missing value analysis.

I found the syntax below online to user define the blanks in a variable as missing. (The variable in dataset as an example is q63_1.)  See below.

MISSING VALUES q63_1 (' ')

It worked!  

But now I need to do this for about 200 variables, i.e. q64_1, q65_, q66_1 and so on.  Any suggestions on how to do this en masse?  I've heard of DO REPEAT and I was wondering if this could this work here?  If so, how? Or other suggestions and syntax?

As I mentioned in my earlier post...I'm a newbie!
Reply | Threaded
Open this post in threaded view
|

Re: Defining missing values for multiple variables

Richard Ristow
At 07:26 PM 12/6/2012, AndrewM wrote:

>I have a large data set where many of the cells are blank (these are
>string variables) and SPSS is not recognizing them as [missing] when
>I run a missing value analysis.
>
>I found the syntax below online to define the blanks in a variable
>as missing. (The variable in dataset as an example is q63_1.)
>
>MISSING VALUES q63_1 (' ')
>
>But now I need to do this for about 200 variables, i.e. q64_1, q65_,
>q66_1 and so on.  Any suggestions on how to do this en masse?

The MISSING VALUES command accepts a list of variables. You could say

MISSING VALUES q63_1 q64_1 q65_ q66_1 (' ').

If any of the variables you want to set missing values for are in
sets that are contiguous in the file, you can shorten further. For
example, if q64_1 to q68_2 are contiguous, you could write

MISSING VALUES q63_1, q64_1 TO q68_2, q75 (' ').

>I've heard of DO REPEAT and I was wondering if this could this work here?

It could, but it's easier to write one MISSING VALUES statement for
all the variables (as above) than to use DO REPEAT on the same list
of variables to generate separate MISSING VALUES statements.

=====================
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