import data from excel into spss

6
Created by ASK (2012) Page 1 of 6 Table of Contents Import Your Data from Excel to SPSS ......................................................................... 2 1.1 A quick look at the Excel file you want to import ..................................................................... 2 1.2 Importing your data .................................................................................................................. 3 1.3 Your imported data ................................................................................................................... 4 Additional Resources.................................................................................................. 6

Upload: christine-pereira-ask-brunel

Post on 22-Mar-2016

237 views

Category:

Documents


3 download

DESCRIPTION

This tutorial shows you how to import data from Excel into SPSS.

TRANSCRIPT

Page 1: Import data from Excel into SPSS

Created by ASK (2012) Page 1 of 6

Table of Contents

Import Your Data from Excel to SPSS ......................................................................... 2

1.1 A quick look at the Excel file you want to import ..................................................................... 2

1.2 Importing your data .................................................................................................................. 3

1.3 Your imported data ................................................................................................................... 4

Additional Resources.................................................................................................. 6

Page 2: Import data from Excel into SPSS

Created by ASK (2012) Page 2 of 6

Import Your Data from Excel to SPSS

1.1 A quick look at the Excel file you want to import

BEFORE importing data you need to check the following:

1. Are any of the variables categorical? That is, are any of the data words rather than

numbers? If so, then they need to be coded first (how do I do this?)

2. The data need to be arranged so that each variable is in its own column. (How do I identify

variables in my dataset? How do I arrange my data in Excel so it can be imported?)

3. Do you have variable names that you would also like to import with your data? If so, then

they need to be the column headings across the first row.

I am going to import CommutingSurvey.xlsx (shown in Figure 1). Here are the checks for my

dataset:

1. I have 3 categorical variables (Figure 1): Gender, Mode and Stress. Both Gender and Mode

are nominal, so I could leave them as string, but it is good practice to code them anyway.

Stress is a likert scale so it is ordinal and needs coding. I will code them as follows (shown

in Figure 2):

Gender: 0 = Male, 1 = Female

Mode (mode of transport to uni): 1 = tfl, 2 = car, 3 = cycle, 4 = walk

Stress (“My commute causes me to feel stressed”): 1 = Strongly disagree, 2 =

Disagree, 3 = Neutral, 4 = Agree, 5 = Strongly Agree.

2. My variables are Participant ID, Gender, Travel Time (min), Mode and Stress. Each

variable is in its own column with the corresponding data underneath.

3. Yes, I want to import variable names. They are the column headings across the first row.

Now my data is ready to be imported from Excel to SPSS! (See Figure 2).

Figure 1. Original, uncoded, data from the commuting survey.

Page 3: Import data from Excel into SPSS

Created by ASK (2012) Page 3 of 6

Figure 2. Coded commuting survey ready to be imported into SPSS.

1.2 Importing your data

You will need to know the following information when importing your data (all shown in Figure 2):

The file name (CommutingSurvey.xlsx)

The name of the worksheet containing the data I want to import (SPSS Import)

The range of the data I want to import (A1:E11)

I want to import the variable names (Column headings across the first row)

The Import in 3 simple steps

1. Open SPSS and chose “Type in Data” from the main screen, then click “OK”. Once a data file

has opened select the following:

File menu

Open

Data

2. In the dialog box (Figure 3):

From the Files of Type drop-down menu select the Excel option

Then find your Excel file in the folder where you saved it

Click Open

3. From the next dialog box (Figure 4):

Check Read variable names from the first row of data

Identify the Worksheet which contains your data from the drop-down menu. My data is in

the worksheet labelled “SPSS Import” (as shown in Figure 2).

A1 is the top left cell

E11 is bottom right cell

Page 4: Import data from Excel into SPSS

Created by ASK (2012) Page 4 of 6

SPSS automatically identifies a rage in the selected workshop which contains data. If the

range which SPSS shows (e.g. [A1:E11] in Figure 3) is different from the range of your data,

then specify the correct Range in the space provided; otherwise leave it blank.

Click OK. You data will now import into an SPSS data file.

Figure 3. Locate your excel file.

Figure 4. Specify where your data is (worksheet and range) in your excel file.

1.3 Your imported data

Figure 5 shows the Data View and the Variable View after importing. The data should appear in

the SPSS Data Editor, with the variable names as the column headings.

Page 5: Import data from Excel into SPSS

Created by ASK (2012) Page 5 of 6

A few things to note after importing:

You still need to define your variables in the Variable View. (How do I define variables?)

If the variable names from your Excel file contained spaces or special characters then SPSS

will amend the name for you and use the original name as the label. For example, Travel

Time (min) was my original variable name, so SPSS has changed this to TravelTimeMin and

used the original name as the label (shown in Figure 5).

Figure 5. The excel file CommutingSurvey.xlsx has been imported into SPSS.

Page 6: Import data from Excel into SPSS

Created by ASK (2012) Page 6 of 6

Additional Resources

In the Getting Started folder under the SPSS resources section, you may be interested in the

following:

1. How to code categorical variables

2. How to identify variables in your dataset

3. How to arrange data in an Excel file (so it can be imported into SPSS)

4. How to enter and define variables

5. Levels of Measurement (nominal, ordinal and scale variables)

* If you are unsure about which variables are categorical, have a look at the Levels of

Measurement guide mentioned above.

Return to:

1.1 A quick look at the Excel file you want to import

1.2 Importing your data

1.3 Your imported data