1 4202 Marketing Research
SPSS LAB 1
A. SPSS Lab I: introduction……………………………………………………………………………………………………………………………………. 1
B. Starting SPSS…………………………………………………………………………………………………………………………………………………… 2
C. Using SPSS: creating a dataset ………………………………………………………………………………………………………………………….. 2
D. Naming, describing, and defining the scale level of variables ……………………………………………………………………………….. 3
E. Adding (more) variables to a SPSS dataset………………………………………………………………………………………………………….. 4
F. Adding the responses from the questionnaire …………………………………………………………………………………………………… 5
G. Preliminary analyses: simple summary statistics ( = descriptive statistics)……………………………………………………………… 6
H. Recoding an existing variable into a new variable……………………………………………………………………………………………….. 7
I. Computing new variables using existing variables………………………………………………………………………………………………… 8
J. Constructing a Histogram for interval or ratio scaled variables ……………………………………………………………………………… 9
K. Closing SPSS……………………………………………………………………………………………………………………………………………………. 9
SPSS (‘originally Statistical Package for the Social Sciences’) is one of the first software packages for basic and advanced statistical
analysis. It has been around since 1966. The current versions of SPSS include almost all popular analysis techniques, making it
extremely useful for analyzing questionnaires. One characteristic of questionnaires is that variables are measured on different levels
(nominal, ordinal, interval, ratio) and having one software package that can ‘handle’ all of those is very convenient.
If you decide to pursue a career in marketing research, or expect to collaborate with marketing researchers, you will need to have
some basic understanding of analyzing marketing data, in particular primary data collected through questionnaires. Most firms will
work with SPSS, or packages such as SAS, JMP, Minitab, S-Plus, or Excel/Stattools for that purpose. These packages are very similar
and allow for the same basic statistical research techniques. In addition, the output is generally (statistically) standardized. Hence, if
you learn one package well, you will find it easy to learn or use other software too.
SPSS is a Windows (or OSX, Linux) based program and its menus etc. work like most programs that you know (for instance, Excel). In
addition it has a very good help function. You will find the help function useful and I recommend that you try it out. A Mac version is
also available.
OSU students can download SPSS (and other) Statistics packages free of charge from the OCIO website (see Carmen for details).
This tutorial provides you with an introduction to SPSS and some basic variable manipulations. For this tutorial you use a (very)
small-scale questionnaire among tennis players (Huizingh, 1995). You can find a copy of the questionnaire in the appendix to this
tutorial. The latter part of the lab will use a dataset from a questionnaire we saw in class.
CONTENTS
A. SPSS LAB I: INTRODUCTION
2 4202 Marketing Research
SPSS is started just like Word, Excel etc.
► Start SPSS (IBM SPSS Statistics)
For the first assignment, we need to create a
new dataset. Once you start SPSS,
► If you get the window below
– Select “New Dataset”
SPSS has two main ‘views’ of the main window: Data View and Variable View (see fig.’s below)
Variable View | Data View |
Set up new variables (e.g., from questions), define scale levels, label values according to coding scheme |
View raw data, manipulate data, input data |
DATA VIEW
► Select ‘Data view’ (see bottom left, ‘Data view’ vs. ‘Variable view’)
► You should see: a spreadsheet (much like Excel) with empty ‘cells’
► The rows are numbered (1,2,3,4,…). Each row represents one respondent’s answers to questions (scores) of one respondent
► The columns are indicated by ‘var’. Each column represents a variable (question) that is asked in a questionnaire (for instance,
age, income, etc.).
► The top shows the name of current data file. Right now it is called “Untitled2”
VARIABLE VIEW
► Now select ‘Variable view’ (bottom left)
► You should see: a spreadsheet showing you information about the variables in your dataset
► The rows are numbered (1,2,3,4,…). Each row represents a variable in the dataset
► The columns are indicated by ‘Name’, ‘Type’, etc. Each column represents different pieces of information about the variables
(variable attributes)
► The top shows the name of current data file. Right now it is called “Untitled2”
MENU ITEMS
The menu items at the top of your SPSS window (‘File’, ‘Edit’,…, ‘Help’) give you many choices of things you can do. Using these
menus is similar to standard Windows programs. In due course you will learn how to use several of them. Also, you can access these
functions regardless of the view (they work from ‘Data View’ and from ‘Variable View’). Later on, you will see the ‘Output Viewer’
window. All analysis functions are also accessible from within the ‘Output Viewer’.
You are now ready to create a dataset from the ‘tennis’ questionnaire results. You only use the first 10 respondents for this
assignment. (see Carmen for a PDF file “LAB_1_part1_Data” containing scans of 10 respondents’ filled out questionnaires).
► Select ‘Data view’.
B. STARTING SPSS
SPSS MAIN WINDOW: THE SPSS DATA EDITOR
C. USING SPSS: CREATING A DATASET
3 4202 Marketing Research
► Type the number ‘1’ in cell (1,1), i.e. the cell in the uppermost left corner of your spreadsheet.
SPSS automatically creates a variable with the name ‘VAR00001’.
► Type the numbers 2,3,4,5,6,7,8,9,10 in this column (underneath each other).
It is a very good idea to save your data file every now and then (but often!).
► Go to ‘File’ and select ‘Save as’. A window opens with title Save Data As (see below)
► Choose a name for the datafile: tennis
► Carefully decide where you save it (i.e. ‘Look in’) – make sure you are able to access this file later on
► Choose “SPSS (*.sav)” (default) under “Save as type”
► Press “Save” (note: a new ‘Output’ window opens, please leave it open and go back to the original ‘SPSS Data Editor’ window)
You created a file <<tennis.sav>>. In the top bar of your SPSS Data Editor window you now see ‘tennis.sav – SPSS Data Editor’.
► Copy the file onto a usb stick/drop box/email account at the end of this lab if you need to continue the next day.
Choosing a good name and a clear description for a newly created variable is extremely important.
► Select ‘Variable view’ in the ‘SPSS Data Editor’ window
You see that SPSS automatically inserted the newly created variable ‘VAR00001’ in the first row. The attributes (‘Name’, ‘Type’,
‘Width’, etc.) are automatically filled in with default values.
► Change the name of the new variable. Remember: this variable is the respondent ID (there are 10 respondents)
► Double click on ‘VAR00001’ and type in the new name ‘Respnum’ (SPSS does not allow spaces in variable names!)
► Hit ‘Enter’.
The next three columns (‘Type’, ‘Width’, ‘Decimals’) are not much of your concern right now. You leave the default values as they
are. If you really want to be super-accurate, you can set Decimals to 0 for the respondent ID, since the variables only takes on
integer values such as 1,2,3 – but not 1.432)
The variable attribute ‘Label’ is of great importance. Here you enter a description of the variable. It helps you remember what the
variable is about and it helps your team members to understand the meaning of the variables once they use the dataset you created
or modified.
► Enter a description for this variable under ‘Label’: ‘Respondent ID number’
The next four columns (‘Values’ — ‘Align’) do not need to be changed right now.
The last attribute ‘Measure’ is of great importance. Here you select the scale level (nominal, ordinal, interval, ratio) of the variable.
D. NAMING, DESCRIBING, AND DEFINING THE SCALE LEVEL OF VARIABLES
4 4202 Marketing Research
NOTE: SPSS defines both interval and ratio as ‘scale’ (see table below). This is because most statistical techniques apply the same
way to both interval and ratio scaled data.
Scale Level | SPSS Scale level |
Nominal | Nominal |
Ordinal | Ordinal |
Interval | Scale |
Ratio |
► Select the correct scale level for this variable
► Note that the attribute ‘Measure’ must be correct for SPSS to function correctly! If you are having a problem with a method not
working you should first check to make sure the measure is correct!
Questions in the questionnaire (see attached ‘Lab1_part1_questionnaire tennis habits.pdf’) need to be translated into variables
in SPSS. For thisassignment you do not use all questions in the tennis questionnaire but only the ones that are listed in the table
below.
You should now add the first variable ‘TennisMonth’ to the dataset (question 1)
► Select ‘Variable view’
► Double click the cell for the second variable in the column ‘Name’ (the cell below ‘Respnum’).
► Type ‘TennisMonth’ and hit ‘Enter’ (SPSS does not allow spaces in variable names!)
► Type in the description for this variable (see table below) in the column ‘Label’
► Select the correct scale level in the column ‘Measure’ (note: this is a ratio scale, which is indicated in SPSS by ‘Scale’ – see
upper table).
You should now add the second variable ‘NewShoe’ to the dataset (question 5)
► Make sure to select ‘Variable view’
► Double click the cell for the third variable in the column ‘Name’ (the cell below ‘TennisMonth’).
► Type in ‘NewShoe’ and hit enter (SPSS does not allow spaces in variable names!)
Only use these 5 questions from the tennis questionnaire for this tutorial; the number under “QUESTION” indicate the question number
on the survey. You will have 6 rows on ‘Variable view’, including the “Respnum” and the following 5 questions.
QUESTION | NAME VARIABLE | DESCRIPTION | CODING VALUES |
— | Respnum | Respondent ID number | |
1. | TennisMonth | How often plays tennis | |
5. | NewShoe | Bought new shoes? | 1 = ‘Yes’ 2 = ‘No’ |
6. | ShoePrice | Category price new shoes | 1 = ‘<100’ 2 = ‘100-250’ 3 = ‘> 250’ |
8. | Sex | Gender | 1 = ‘Male’ 2 = ‘Female’ |
9. | Age | Age |
Interpretation last column: the coding values describe how the questions in the questionnaire may be coded into SPSS variables.
Examples:
1. A male respondent gets assigned a number ‘1’ for the variable ‘Sex’ (question 8).
2. A respondent that bought a new tennis shoe last year gets assigned the number ‘1’ for the variable ‘NewShoe’
(question 5).
3. If that shoe was $150 (s)he gets assigned the number ‘2’ for the variable ‘ShoePrice’ (question 6).
► Type in the description (see table above) for this variable in the column ‘Label’
► For this variable (unlike the previous two) you need to include the coding values
o 1 = ‘Yes’,
o 2 = ‘No’. You add these in the column ‘Values’.
► Coding Values
1. Select (by clicking on it) the cell in the column ‘Values’ for the variable ‘NewShoe’
E. ADDING (MORE) VARIABLES TO A SPSS DATASET
5 4202 Marketing Research
2. Click on the light blue box that appears
A new window opens called ‘Value labels’
3. Next to ‘Value’, type the number ‘1’
4. Next to ‘Label’ type ‘Yes’
5. Click ‘Add’ (not ‘OK’!)
6. Repeat steps 3, 4, and 5 for the second label (2 = ‘No’)
7. Click ‘OK’
► Select the correct scale level in the column ‘Measure’ for the variable ‘NewShoe’
(HINT: this variable has only two values (Yes/No) that are labels) (see figure below)
You should now add the remaining three variables: ‘ShoePrice’ (question 6), ‘Sex’ (question 8), and ‘Age’ (question 9).
► For the variables ‘ShoePrice’, ‘Sex’, and ‘Age’ add: a ‘Name’, ‘Label’, ‘Values’ (if applicable) and ‘Measure’. Once you are done,
make sure to save your datafile.
ANSWER QUESTION 1 ON YOUR ANSWER SHEET
You will now enter the data for 10 respondents to create this dataset.
► Select ‘Data view’ and take a look at the spreadsheet (fig. below)
You see the column ‘Respnum’ with the values 1-10. SPSS added the new variables ‘TennisMonth’ – ‘Age’. You find lot’s of dots in
the cells. A dot in SPSS means ‘missing value’. This is because you have not yet keyed in any questionnaire
► Select from the menu ‘View’ the option ‘Value labels’
(the button in front of ‘Value Labels’ should be selected, see figure below)
F. Adding the responses from the questionnaire
INITIAL STEP BEFORE ADDING QUESTIONNAIRE RESULTS
ADDING QUESTIONNAIRE RESPONDENT 1
6 4202 Marketing Research
► Select ‘Data view’ in SPSS
► Select the cell ‘TennisMonth’ for the first respondent.
► Enter the value ‘2’ and hit TAB
(if you hit ‘ENTER’ you move to the cell ‘TennisMonth’ for respondent #2).
► Select ‘Yes’ for the variable ‘NewShoe’ and hit TAB
► Select ‘<100’ for the variable ‘ShoePrice’ and hit TAB
► Select ‘Female’ for the variable ‘Sex’ and hit TAB
► Enter the value ‘33’ for the variable ‘Age’
You should now add the results for the other 2-10 respondent.
► Save your file! You will upload this completed dataset as part of your Lab 1 assignment, so make sure to save it somewhere you
can access it again!
Once the questionnaires are entered in SPSS, you start to analyze the data. The first step is always obtaining simple summaries of
the data (descriptive statistics).
Research question: how much did respondents spend on tennis shoes last year?
This question can be answered by computing a frequency table for the variable ‘ShoePrice’ (question 6 in the questionnaire).
► Go to the menu item ‘Analyze’
► Select ‘Descriptive Statistics’
► Select ‘Frequencies’ (see fig. on right)
A new window appears titled ‘Frequencies’
► Select ‘ShoePrice’ and press the arrow button
‘ShoePrice’ will now show up in the ‘Variable(s)’ list
► Hit ‘OK’
A new window ‘Output1 – SPSS viewer’ opens (see figure below). SPSS prints in this window all your (future) output. Note than you
also have access to all functions (e.g., Analyze) from within the output viewer. It now printed a frequency table for the variable
‘ShoePrice’. The title of the table is the text you entered under ‘Label’ (in ‘Variable view’).
G. Importing a Data Set
COMPUTE A FREQUENCY TABLE FOR ‘SHOEPRICE’
7 4202 Marketing Research
The table shows for each of the three categories (‘<$100’, ‘$100-$250’, ‘>$250’) the number of respondents that selected that
answer. It also computes three different percentages in the columns.
► You should take a close look at this table and make sure you understand all numbers
ANSWER QUESTION 2 YOUR ANSWER SHEET
► Obtain a frequency table for the variable ‘gender’
ANSWER QUESTION 3 YOUR ANSWER SHEET
Save your output file
► In the output window, select ‘File’ and ‘Save as’
► Choose an appropriate location and file-name
► Save your file as .SPV (default ‘Viewer Files’)
► Hit ‘OK’
The number of respondents that bought shoes that were more expensive than $250 is very small. It makes sense to merge the
categories ‘2=100-250’ and ‘3=>250’ for the variable ‘ShoePrice’ (question 6 of the questionnaire). Hence, we create a new variable
that has only two categories: ‘1 = <100’ and ‘2 = 100 or more’.
Construct a new variable ‘ShoePrice2’ that has two categories ‘1=<100’ and ‘2 = 100 or more’
► Go to the menu ‘Transform’
► Select ‘Recode into Different Variables’ (see fig)
A new window opens titled ‘Recode into Different Variables’
► Step 1: select the variable to recode and determine the name for the
new variable
o Select the variable that has to be recoded (‘ShoePrice’) in the
area ‘Input Variable -> Output Variable’
o In the area under ‘Output Variable’ enter the new name
‘ShoePrice2’
o Below that, enter a label (description) for the new variable, for
instance ‘Recoded category price new shoes’
o Hit ‘Change’ (see figure right)
The new variable ‘ShoePrice2’ now appears in the area ‘Input Variable ->
Output Variable’. The next step is to tell SPSS how to do the recoding.
Before you can do this, you first need to write down the recoding schema
yourself.
ANSWER QUESTION 4A ON YOUR ANSWER SHEET
► Step 2: tell SPSS how it should recode the existing variable ‘ShoePrice’ into the new variable ‘ShoePrice2’.
o | Click on ‘Old and New Values…’ A new window opens. |
o Create category 1 for ‘ShoePrice2’ (follow steps A, B, C below)
Respondents that bought a tennis shoe less than $100 get the number ‘1’ on the scale ‘ShoePrice’. This number is the same
on the new scale ‘ShoePrice2’.
Follow the steps A – C below.
A. Under ‘Old Value’, select ‘Value’ (default) and enter ‘1’
B. Under ‘New Value’, select ‘Value’ (default) and enter ‘1’
C. | Press ‘Add’ (not ‘Continue’!) ‘1 –> 1’ should now appear in the box ‘Old –> New:’ |
H. RECODING AN EXISTING VARIABLE INTO A NEW VARIABLE
8 4202 Marketing Research
o Create category 2 for ‘ShoePrice2’ by
repeating steps A, B, and C, see below.
Respondents that bought a shoe that was
$100-$250 get a ‘2’ and respondents that
bought a shoe that was >$250 get a ‘3’ on the
scale ‘ShoePrice’. These respondents are
merged into one category for ‘ShoePrice2’
and get the value ‘2’.
A. Under ‘Old Value’, select ‘Range’
and enter ‘2 through 3’
B. Under ‘New Value’, select ‘Value’
and enter ‘2’
C. Press ‘Add’ (not ‘Continue’!) (see
figure)
o After step C, press ‘Continue’ (see last fig. on
previous page)
The Window ‘Recode into different variables: old and new values’ closes and you return to the window ‘Recode into different
variables’
► Step 3: press ‘OK’
SPSS creates the new variable ‘ShoePrice2’, it jumps to the ‘SPSS Viewer’ window
► Step 4: always check your computations in the ‘SPSS Data Editor’ window.
o Go to ‘Data View’ and check for respondents 1—4 that the recoding worked (the variable ‘ShoePrice’ appears in the
fourth column, the new variable ‘ShoePrice2’ appears at in the last column at the end of the dataset)
► Step 5: always add a description, value labels, and the scale level for a newly created variable
o Select ‘Variable View’
o Check the description for ‘ShoePrice2’ in the column ‘Label’
o Add the labels for the values ‘1 = <100’ and ‘2 = 100 or more’ in the column ‘Values’
o Add the correct scale level in the column ‘Measure’
ANSWER QUESTIONS 4B, 4C, AND 4D ON YOUR ANSWER SHEET
Research question: approximately how often a year do people play tennis?
You can easily compute new variables in SPSS from existing variables. You can answer this question using the variable ‘TennisMonth’
(question 1 on questionnaire).
Construct a new variable ‘TennisYear’ from the existing variable
‘TennisMonth’
► Choose the menu item ‘Transform’ / ‘Compute Variable’
A new window titled ‘Compute variable’ opens (see also figure
below)
► Type the new name ‘TennisYear’ (no spaces!) in the box
‘Target variable’
► You can estimate annual tennis frequencies by multiplying
monthly tennis by 12. This formula is entered in the box
‘Numeric expression’
1. Select the variable ‘TennisMonth’ from the variable
list and press the arrow button.
2. You can use the key pad in the ‘Compute variable’
window (see figure) to enter ‘* 12’
► Press ‘OK’
Always check new computations
► In the SPSS Data Editor, select ‘Data View’
You find that a new variable ‘TennisYear’ has been added at the end of the dataset.
I. COMPUTING NEW VARIABLES USING EXISTING VARIABLES
9 4202 Marketing Research
► Check a few computations by hand (for instance, the first respondent plays tennis twice a month, so you should find 2*12 = 24
times a year)
Describe and define the new variable ‘TennisYear’
Choosing a good name, a clear description, and selecting the measurement level for the new variable ‘TennisYear’ is extremely
important.
► Go to ‘Variable view’ and add a ‘Label’, the ‘Values’ (if applicable), and select a measurement level under ‘Measure’
Research question: what is the frequency distribution of the variable
‘TennisYear’?
An interval or ratio scaled variable may be described graphically by a
histogram.
Construct a histogram for the variable ‘TennisYear’
► In the ‘SPSS Data Editor’ window, select ‘Graphs – Legacy Dialogs –
Histogram’
A new window opens called ‘Histogram’
► Select the ‘TennisYear’ variable and press the arrow button at ‘Variable’
► Hit ‘OK’ (see figure)
Your histogram is printed in the ‘Output – SPSS Viewer’ window
ANSWER QUESTIONS 5A AND 5B ON YOUR
ANSWER SHEET
SPSS is closed as any Windows program. When you close SPSS, it will ask you whether you want to save the datafile and the output.
► Save the datafile in the ‘SPSS Data Editor’ window
► Save the output in the ‘SPSS viewer’ window
► Close SPSS
You have completed the Lab. I hope this lab was helpful in practicing some basic data
manipulation and summarization.
Submit your completed worksheet, and the tennis.sav file on Carmen under the Lab 1
Assignment.
APPENDIX: QUESTIONNAIRE TENNIS HABITS
J. CONSTRUCTING A HISTOGRAM FOR INTERVAL OR RATIO SCALED VARIABLES
K. CLOSING SPSS
10 4202 Marketing Research
This questionnaire is being conducted as part of a project for Marketing Research. We are interested in individuals’
tennis habits. Your participation in this survey is voluntary and your answers to the following questions willremain
confidential. Thank you for much for helping with this study.
1. Approximately how often a month do you play tennis? times a month
2. What type of game do you play? (Select one)
Single
Double
Both single and double
3. Approximately how much did you spend last year on renting a tennis court?
dollars
4. Approximately how much did you spend last year on tennis clothes?
dollars
5. Did you buy new tennis shoes last year? (Circle one) Yes No
6. If you answered “yes” to the previous question, what was the price of these shoes (select one)?
Less than $100
In between $100 — $250
More than $250
7. Do you go to tennis tournaments (select one)?
Almost never
Sometimes
Often
8. What is your gender? (Circle one) Male Female
9. What is your age? years
10. What is your monthly income after tax? dollars
— Thank you for your cooperation —