Setting up a new variable in SPSS

At first glance, SPSS looks similar to Microsoft Excel. Therefore, you might think you can type your data into the spreadsheet in the same way as you can in Excel. However, this isn’t the case. With SPSS, you need to define your variables carefully, otherwise you run the risk that your graphs and statistical tests will be nonsensical.  The data editor (the SPSS equivalent of a worksheet) opens automatically when you open SPSS. 

  

Once in the Data Editor:

 Variables are placed in columns and cases of data are placed into different rows.  Click “variable view” at the bottom left of the data to enter variable view. This is where you will set up new variables. The top row gives you several options:

  

NAME:

What you want to call your variable (i.e. names, pets, occupation).

VARIABLE TYPE

What type of data you want to enter. 



Click the square to the right of the box to open a dialog box for options.  You are most likely to use either string variables, or numeric variables.

Set the number of characters in your variable in the “characters” box on the Variable Type screen.

Most of these variables are self-explanatory (like dollar, date, or scientific notation), but there are a couple that aren’t including:


String variable:

Use when you want to type letters. For example, peoples’ names, breeds of dog, occupations. You can also include numbers or symbols, but they will be treated by SPSS as text. For example, zip codes are numeric but you may want to treat them as text (i.e. you don’t actually want to perform calculations on them like 90210 * 10 !).

Comma:

Numeric variables that are separated every three places by a comma. For example, 100,000.00 or 999,988,565.21.



Dot:

Similar to comma, but the dot is used to separate the three places and a comma is used to indicate a decimal. For example. 100.000,00 and 999.988.565,21. Not used in the UK or USA, but common in some other countries.

LABEL: 

Not strictly necessary but it can help you remember what the variable means; it allows you to put in a description. For example, if your variable NAME is “Type” then you can use the label “Type of Pet.” This can help you a year down the road when you have forgotten what the label “Type” means!



VALUES

Valid if you have a numeric variable. If you are using numbers to groups, you can click the box to assign labels. For example: 1. Junior 2. Senior.

Tip: Once you have assigned these values, you can toggle them in the data editor to show either the numbers or the names. The toggle button looks like to arrows with 1 and A on them.

MEASURE:

Tell SPSS what type of variable you have (for example, a nominal variable).