Defining missing values for string and numeric variables?

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Posts: 1
Joined: Tue Jul 17, 2012 6:28 am

Defining missing values for string and numeric variables?

Postby Oceansoul » Tue Jul 17, 2012 6:37 am

Hello everybody,

I am very new to SPSS and full of questions. Most I´ll try to answer for myself but I am already stuck at such a simple thing as defining missing values for string AND numeric variables. I hope I can find some help here (all the more since my time is short ... diploma thesis).

So, I have a data set of several thousand variables and trying to define their missing values. Natuarrly I can´t do this via the GUI. But I can´t figure out how do do it with a syntax. The MISSING VALUES ALL command is of no use either, since it tells me that I have to declare the values for strings and numerics seperately (just not how!!).

So is there a way to loop through all my variables, determine if it´s string or numerical and then define a missing value accordingly?

Thanks in advance (for this and all my questions to come :))
Posts: 28
Joined: Mon Mar 30, 2009 8:20 pm

Re: Defining missing values for string and numeric variables

Postby Erikyo » Wed Jul 25, 2012 5:10 pm

Just play with it ! Visit Variable views

Analyse - Reports - Codebook (since you have many variables)
Analyse - Descriptive statistics - Frequencies
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Defining missing values for string and numeric variables

Postby Penguin_Knight » Wed Jul 25, 2012 5:59 pm

1) Go to you variable view tag
2) Highlight the column "Type"
3) Right click and choose "Sort Ascending" or "Sort Descending"
4) A question will pop up asking if you'd like to save your attribute, say yes can name it something. A new criterion will then appear on your Variable View, that new column contains the order BEFORE you sort the value. After renaming the missing, you can then come back this old order by sorting with it.
5) With the different types grouped together, you can use syntax to rename the missing with the "TO" option to represent all your variables as a vector, as long as you know where is the first and last variables of the cluster:

Code: Select all

MISSING VALUES firstNumericVar TO lastNumericVar (-9) .
MISSING VALUES firstStringVar TO lastStringVar ("Missing") .
This will only work if you would like to assign the same missing across the whole type of variables.

Who is online

Users browsing this forum: No registered users and 3 guests