23
SPSS: Basics & Entering a survey (created by P. Stikker) SPSS: Basics & Entering a survey In this document the basic window of SPSS is explained and how to enter a survey. For more information, you can visit the companion website at http://PeterStatistics.com.

SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

SPSS: Basics & Entering a survey In this document the basic window of SPSS is explained and how to enter a survey.

For more information, you can visit the companion website at http://PeterStatistics.com.

Page 2: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Introduction SPSS was first released in 1986 and was short for ‘Statistical Package for the Social Sciences’. It was intended for social scientists, but it developed further

and is used in all fields these days. In 2009 IBM acquired the software and tried to change the name to PASW Statistics (Predictive Analytical SoftWare), but

this didn’t really catch on and it’s called SPSS again (IBM SPSS to be exact).

The latest version when this reader was created is 24, however all techniques used in this reader will also work on version 19 or later. Earlier versions have

not been tested. SPSS is available for Windows, Mac and Linux. It is a bit expensive for an individual to purchase since a single license will cost around €3000.

You can often download a trial version from the SPSS website for free, but it will only work for a limited number of days (usually around two weeks). If you

are a student, your university might have purchased the license for its students, and you should be able to get a huge discount (e.g. at my university

students can purchase SPSS for €13).

1 Open SPSS Please see the IBM website for installation instructions. Once you’ve installed SPSS and open the program you might first be greeted with the screen shown

below.

As the screen mentions this has to do with character encoding and unless you want to use the file also on a SPSS version 16 or earlier, I’d suggest to:

Click on

We are now greeted with another screen (a so called splash screen). This is slightly different in each version of SPSS.

Page 3: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Version 21 (Windows) Version 22 (Windows) Version 23 (Windows) Version 24 (Linux)

The idea remains the same in each version. I usually just click it away.

Click on (or on , or press [ESC] on the keyboard)

Finally, we are at the core of SPSS.

Page 4: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Notice that this looks a lot like a spreadsheet (e.g. Excel), but this program works completely different.

What you see is a so-called data file (an empty one). SPSS has a few different files and the two that we will see in this course are the data file (which have

.sav in the file name) and ‘Output file’ (which have .spv at the end of the file name). As you might guess a data file is the file where the actual data is stored,

while an output file is a file where the results of statistical analysis on the data is stored.

Page 5: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

One big difference with Excel is that there is no live connection between the output and the data. If you change the original data, then the output will not

change accordingly, and you will have to redo the analysis. This might sound strange, but on the other hand you shouldn’t be changing your survey data just

because you don’t like the results of an analysis.

Page 6: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Another thing to notice is that the menu bar for the output and data file are the same. You can start another analysis in the output file and SPSS will assume

that the latest data file that you have open is where you want to perform the analysis on.

By default the first thing that is shown from an analysis in the output is the so-called SPSS Syntax. In the example it was:

FREQUENCIES VARIABLES=V20

/PIECHART FREQ

/ORDER=ANALYSIS.

This is the programming language of SPSS. Although this has some advantages we will not discuss it in this course. We prefer to explain the point-and-click

interface of SPSS than learning coding.

Let’s get started with entering our first survey.

Page 7: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

2 Entering standard survey questions in SPSS To learn how to enter a survey in SPSS it might be easiest to do it with an example. In below a very short survey with only four questions.

Q1: What is your gender? O femaleO male Q2: What is your age? ____(year) Q3: What is your name? ______________ Q4: What do you think of statistics? O very boring O boring O fun O a lot of fun

Each of these questions can be considered a variable. If you look in the data file at the bottom of SPSS you see two tabs: . Currently the

data view is selected, but to enter variables, we will need to switch to the Variable view.

Click on

We are shown a new screen.

In the variable view each row will represent one variable. Since we have four variables, we will fill out the first four rows.

As the first column is titled ‘Name’ we need to give a name to our variables. This needs to be short, cannot contain a space, not allowed to start with a

number and no special characters such as %. If you enter a name and move to another cell some of the other columns will automatically be filled out, but

this is not always correct.

In the example I’ll use gender as a name for the variable of the first question, age for the second, name for the third and opinion for the fourth.

Page 8: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Note: in version 21 the width will automatically be set to 6 and not 8. This is not important, so 8 or 6 is both fine.

Enter the names of the variables as shown above.

The next column we are going to fill out is the Label. This is a longer description of the variable, or in some cases the entire original question. There are no

limits here, so you can use spaces, special characters, start with a number, etc.

In the example I’ve chosen to only give a description and not the entire question.

Enter the labels for each of the variables as shown above.

Now that we have entered the questions (in this case also variables), we need to enter the possible values. This can be done in the column ‘Values’.

In below the instructions on how to add the values for the variable gender using 1 = female and 2 = male.

1. Click in the Values for gender and click on

1

Page 9: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

2. At ‘Value’ type 1

3. At ‘Label’ type female

4. Click on

5. At ‘Value’ type 2

6. At ‘Label’ type male

7. Click on

8. Click on

Use the technique from the previous steps to also add the values for the opinion variable. Use 1 = very boring, 2 = boring, 3 = fun and 4 = a lot of

fun.

After you have done this, the screen should look the same as shown below.

2

3

4

5

6

7

8

Page 10: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Note that in statistics we often assign numbers and not letters (e.g. m = male and f = female), although this is also possible to do with SPSS.

The next thing we can adjust is the measurement level for each of the variables. This is done in the column Measure. The variable gender is a nominal

variable, age is a ratio variable, name is nominal and opinion is ordinal. SPSS does not distinguish between interval and ratio, and simply calls each of these

two scale.

Click for each of the variables in the Measure column and select the appropriate measurement level in from the pull down menu.

Let’s turn our attention to the columns we skipped so far. The Type column indicates what will be typed in the data view for this variable. The two most

common options are either text or numbers. Note that although gender and opinion the values were text, we assigned numbers to the options, so we will

be typing in numbers. The type for each of the variables is indeed Numeric (numbers), except for the variable name, so we need to change that.

Page 11: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

1. Click in the Type column for the variable name, and click on

2. Click on the option

3. At Characters you have to give an estimate on how many characters you will need. For example the name Peter Stikker, will need 5 characters for Peter, 8 for Stikker and 1 more for the space in between, so 14. But there will probably be longer names, so enter 30 for now. Don’t worry too much, if it needs to be more you can always adjust it later.

4. Click on

Note: See optional chapter 0 for more information about the other types.

Our Variable View is starting to take its final form. Note that for the age variable the width has now increased to 30.

1

2

3

4

Page 12: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

This was also the amount of characters we entered when we changed the type to String. This is what the Width column is for. It indicates how many

characters for a string variable can be entered. For variables with the type set to Numeric the width has no influence (as confirmed by IBM), so you can

either change it to 0 for those, or just leave it as is.

Moving on to the Decimals column. This column as the name implies is where you can enter how many decimals should be shown. Note that this is not the

same as how many decimals can be entered. In the example none of the variables requires any decimals (only small children might say they are 1.5 years

old).

Change the decimals to 0 for all the variables

For the variable set to type String the decimals are automatically disabled. For gender and opinion the numbers for the values are now also without

decimals. Remember though that you will still be able to enter decimals later, but they simply will not be visible.

The column Missing is an option to make a difference between a respondent forgetting to enter a score and the researcher forgetting to enter a score. To be

able to tell the difference we can as a researcher still type something in, in case a respondent forgot to answer a question. What we type in, is then known

as the missing value.

1. Click in the Missing column of the gender variable, and click on

1

Page 13: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

2. Click on

3. Type 999 in the first box.

4. Click on

Now if a respondent did not give his/her gender, we will enter 999. Because we entered this as a missing value, SPSS then knows that 999 is not a type of

gender. If there is a blank (empty) score somewhere, then we will know that we forgot to enter something.

There are three different boxes, because you can use different values for different things. For example 999 if someone did not answer the question 998 if

they had to skip the question, and 997 if they answered incorrectly.

You can use any number you like as a missing value, but it should not be one of the values (e.g. for age using 28 as a missing value is not correct since

someone might be 28 years old).

Some researchers add the missing value also as one of the values. This allows to also label the missing value(s).

It is recommended to use the same missing value for all variables.

Copy the Missing value to age and opinion.

Unfortunately you cannot copy the missing value from a numeric type to a string type, so for name we will have to enter it separately.

Enter as a discrete missing value for name 999.

2

3

4

Page 14: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

The Columns column is actually not so important. It shows how wide the column of the variable will appear in the Data View.

Just so you will see what it does, change the Columns for name to 20.

Also the Align column is not very important. It allows to adjust if the scores in the Data View for the variable will be shown to the left, center or right of the

column. We’ll leave them as they are.

The last column is Role. This column got added in version 19 and is only useful if you intend to use some specific SPSS options. We will not be using any of

those, so simply leave them as they are (should all be ‘Input’). Which means we are done with entering our simple survey. The final result should look like.

If we now switch to the Data View a few things have changed.

Page 15: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

The names of the variables appear now on top. If you hover your mouse over a column title (DON’T click on it), the label will appear for a short while.

The column for name is a bit wider than the others. This is because we changed the ‘Columns’ for this variable to 20 and left the others at 8.

In the Data View, each row represents one case (one respondent). In below my personal scores.

Note that the age is actually 38,2 and not 38. As mentioned before the decimals column in the variable view is only to mention how many decimals will be

shown, not how many can be entered.

All the numbers are also aligned to the right of the column, while my name is aligned to the left. This is what the column Align does in the Variable view.

It might be difficult to remember how each variable was coded. When entering your scores, it can therefor be helpful to turn on the so called ‘value labels’.

This can be done either by using the menu bar or the shortcut icon:

Page 16: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

Use the menu bar: View – Value Labels Use the shortcut icon

As shown below with the Value Labels on the labels of the values are shown.

You can now still use the numbers, but also type the first letter (but this is case sensitive), or select from a pull down menu.

Page 17: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

3 Multiple answer questions and/or a ‘please specify:_____’ option On some surveys respondents are given an option to add a value that was not one of the original choices. For example the question below.

Q5: Which type of holiday do you prefer? O summerO winter O other, please specify_______

Some respondents will check the ‘other’ option, but not specify anything. If they do, this creates a string (of characters) and we cannot assign a new value to

each. To enter a question like this into SPSS we need to see the ‘please specify_____’ as a separate variable, as shown below.

Note that the option ‘other’ is still one of the possible values.

Entering a few cases in the Data View and the result might look like.

Page 18: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

From this we can see that Jane Christie selected the ‘other’ but did not specify anything.

Another tricky type of questions is when respondents are allowed to choose more than one option, as in the example below.

Q6: Which TV series do you watch? (multiple answeres allowed) □ Game of Thrones □ Walking dead □Teletubbies□ Coupling □Southpark

To enter a question like this into SPSS, you need to rephrase it for SPSS (the question can of course remain as is on the real survey). Each option should now

be considered as a separate variable. Question 6 then becomes the following five questions:

Om een vraag met meerdere antwoorden in te voeren in SPSS zul je de vraag moeten herformuleren voor SPSS. Elke optie moet als een aparte variabele

worden beschouwd. Vraag 6 wordt dus eigenlijk opgesplitst in vijf aparte vragen:

Q6-1: Do you follow the TV series Game of Thrones? O YesONo

Q6-2: Do you follow the TV series Walking dead? O Yes O No

Q6-3: Do you follow the TV series Teletubbies? O Yes O No

Q6-4: Do you follow the TV series Coupling? O Yes O No

Q6-5: Do you follow the TV series Southpark? O Yes O No

These five variables can now easily be added in the Variable View.

Page 19: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

TIP 1: You can copy-paste in SPSS, so also the values

TIP 2: It is usually good to keep the order of the values as they appear on the survey, the exception being yes/no variables. In those cases it is recommended

to use 0 for no and 1 for yes.

In some cases you have both a multiple answer question and the ‘specify’ option as in the example question below.

Q7: Which airline do you frequently use? (multiple answers allowed) □ KLM □Transavia□ Delta □Other, please specify ______

As with the regular multiple answer question, each option becomes a separate no/yes variable (including one for Other), and on top of that the

‘specify____’ part becomes an additional variable. Below how all seven example questions will look like in the Variable View.

Page 20: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

4 Ranking and ‘top x’ questions The last type of questions that is sometimes used on a survey is a question where respondents are asked to rank a few items, or to give a top 3 (or 4, 5, etc.).

First an example of a ranking question.

Q8: Please rank your favorite southpark character from 1 to 4, 1 being your favourite and 4 your least favorite:

__ Eric Cartman __Stan Marsh __Kenny McCormick __Kyle Broflovski

This is similar as to a multiple answer question, the only difference is now that each variable is not a no/yes, but a score between 1 and 4. We could enter

this in SPSS as shown below.

Sometimes the respondent is asked to limit the number of options. For example question 9 below.

Q9: Which operating systems do you enjoy working on? (please pick two max)

□Windows □iOS □Linux □Android

We could of course use the same technique as for any multiple answer question, but it is also possible to use the fact that respondents are ‘forced’ to only

use two. We could instead therefor use OS1 and OS2 as variables, each with the four possible options as values, as shown below.

Page 21: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

The advantage of this method is that the number of variables in SPSS gets reduced. Imagine a question where people are asked to select the max three

sports which they frequently play and then given 20 options to choose from. If we would use the regular method for multiple answer questions it would

require 20 variables, while this new method only requires three.

Page 22: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

5 Some last notes

5.1 Adding, moving or removing a variable or case If you want to add or remove a variable or case you can use the following steps.

1. RIGHT-Click on the row number of the variable in the

Variable Viewor case in the Data View that you want to remove, or where you want to insert a new one above

2. If you want to:

a. remove the variable or case then click on

b. add a new variable then click on

c. add a new case then click on

Variable View Data View

You can also select multiple rows at once to insert or remove multiple variables (or cases) in one go.

To insert a new variable or case you can also make use of the toolbar icons. In the Data View you will see which can be used to insert a new case, and

also to insert a new variable. This last one is also visible in the Variable View. These two icons are shortcuts to the menu options in the menu Edit.

To move a variable or case you can click and hold on the row number and then drag the mouse up or down to move the variable or case.

1 1

2

2

Page 23: SPSS: Basics & Entering a survey - Peter's Statistics ... · SPSS: Basics & Entering a survey (created by P. Stikker) Notice that this looks a lot like a spreadsheet (e.g. Excel),

SPSS: Basics & Entering a survey

(created by P. Stikker)

5.2 Details on Type If the type is set to Numeric, the systems default decimal separator is used, and no separator for thousands. The types Comma and Dot refer to the

thousands separator (and not the decimal separator). If you set the type to Comma the decimal separator will become a dot, and the thousands separator a

comma. For the type Dot this is the other way around.

System decimal Numeric Comma Dot

Dot 12345.67 12,345.67 12.345,67

Comma 12345,67 12,345.67 12.345,67

If you have money as scores it might be nice to add the currency symbol. For dollars there is the type Dollar, but for other currencies it requires some extra

work. You will first need to go to Edit – Options, then select the Currency tab and type in the symbol at prefix (or suffix). Then go back and you can select as

type Currency.

The Date type allows you to enter dates in various formats.

The ‘Restricted Numeric (integer with leading zeros)’ can be used if you might have integer values (so without decimals) that have a leading zero (so for

example 02345, leads with a zero). This can be useful for phone numbers. In the Netherlands for example, a phone number has a fixed length of 10 digits

and always starts with a 0. The variable PhoneNr could then be set to this type with a width of 10.

To change the system decimal you could either change it in your system settings or open a SPSS syntax file and

to go from comma to a dot decimal separator: type in: SET LOCALE = "en_US", then run this.

To go from dot to a comma decimal separator: type in: SET LOCALE ="fr_FR.windows-1252"