How to define your variables

April 29th, 2006 andris

Start SPSS, and create a new data file (Choose Type in data in the first dialog window). You now see a file that looks like a Microsoft Excel file. In the bottom of your screen, you see two tabs. We see that the tab “Data View” is selected. This is the place to type in your data. Before we take that step, we have to define our variables. Next to the tab “Data View” we see the tab “Variable View“, click on that tab. When you have clicked this tab, you get the following screen:

SPSS Variable View
(click on thumbnail to get the big version)

For each variable there is a row in this view. In the columns you can find several properties of a variable, such as, name, type, width, etc. Below you will find an explanation of the most important columns.
In the name column you have to define the name of the variable. This is bound to a lot of limitations, the following are the most important:

- The name must start with a letter.
- The name should be 8 characters max (depending on your version of SPSS).
- The name should not be one of the keywords that SPSS uses to make statistical calculations (like AND, NOT, EQ, BY, WITH and ALL).

You can find the other limitations in the SPSS help file. Personally I always try to name my variables as follows: for question 1, I name the variable q1, for question 3a, variable q3a etc.
After you have typed in a name, and pressed “Enter“, the other columns (except Label) are filled in automatically:

SPSS Question 1

(click on thumbnail to get the big version)

The next thing you have to do is adjust these columns (where neccessary):

- Adjusting the Type
When you have hit Enter, the focus goes to the Type column, and a grey box appears in the right part of this cell. If you click on this box, you can select the variable type from a dialog window. The types you should focus on in the beginning are Numeric and String. Use the String type for questions with open answers, use the Numeric type for questions where for example the respondent has a limited number of choices which you have preselected.

- Adjusting Width
If you have selected the String type, than adjust the width to maximum (for some version of SPSS 255 characters, for other versions more). If you have chosen Numeric, you can go with the standard with of 8 characters.

- Adjusting decimals
In most cases this is not neccessary to adjust.

- Adjusting Label
This is the place where you can fill in a describing text for your variables. This can be the text of your question or in some cases of the answer category. This label will appear in output.

- Adding Value Labels
For Numeric type questions, you can predefine the answers. To add variables, click the grey box in the right of the cell. In the dialog window you can add value labels:

Insert value labels

(click on thumbnail to get the big version)

- Adding Missing labels
Here you can add value labels that are irrelevant.

- Adjusting column align and widht
The columns do not have to be changed for starter use of SPSS, so we leave them untouched.

- Adjusting Measurment
This is the last place where you can choose the right measurment for the variable. You can choose between scale, ordinal and nominal. Which measurment you’ve choose for what question, you can read here.

Repeat these steps for all of your questions, and you have defined all your variables!

Files used for this example:

SPSSlog.com example data sheet
SPSSlog.com SPSS file
SPSSLog.com example questionnaire 

Entry Filed under: 0. SPSS, where to start,Questions and answers

4 Comments

  • 1. SPSSlog.com » Enter&hellip  |  May 1st, 2006 at 2:02 am

    [...] We write this post assuming that you have already defined your variables, and that you have not already entered data in another program. If you have, than please refer to the post about importing data into SPSS. [...]

  • 2. SPSSlog.com » Make &hellip  |  May 20th, 2006 at 5:16 am

    [...] After you have done this, you can start define your variables is SPSS. [...]

  • 3. hanadi  |  September 1st, 2008 at 9:13 am

    how can i define the variables of a question that has more than one answer? For example a question with tick all that applies??

  • 4. Juliana Rigol  |  January 8th, 2009 at 12:55 pm

    I’ve saved my datafile and when I open again it lost some lambels and values. Last time the output shows the information:

    ” >Warning. Command name: GET FILE
    >SPSS data file “C:\Documents and Settings\hezer\My Documents\Juliana Chachamovich\NEW DATASET 7 JAN 09.sav” is written in a character encoding (ISO_8859-1:1987) incompatible with
    >the current LOCALE setting. It may not be readable. Consider changing LOCALE
    >or setting UNICODE on. (DATA 1721)”

    I don’t know where should I save the file. You what should I do?? Thanks a lot


Calendar

April 2006
M T W T F S S
« Mar   May »
 12
3456789
10111213141516
17181920212223
24252627282930

Most Recent Posts