SPSS Statistics Tutorials
 
 

SPSS Tutorials
Home

 

New
Quick Reference Guides for SPSS, SAS and WINKS

BeSmartNotes (tm)

Order

 

For quick and simple statistical analysis use WINKS SDA
Click for more info

 

 


Preparing Data for Import into SPSS
(Using Excel)


See
www.stattutorials.com/SPSSDATA for files mentioned in this tutorial © TexaSoft, 2008

 

These SPSS statistics tutorials briefly explain the use and interpretation of standard statistical analysis techniques for Medical, Pharmaceutical, Clinical Trials, Marketing or Scientific Research. The examples include how-to instructions for SPSS Software.

 

 

Preparing Data for Import into SPSS (Using Excel)

Because creating data in an Excel file is so common, this section discusses how you should prepare your data in Excel (or any other spreadsheet or database program) for importation into SPSS. Here are several items you should keep in mind.

 

  1. Row 1 of your Excel spreadsheet should contain variable names that are compatible with SPSS naming conventions. Variable names should only be on row 1. Do not extend names to row 2.

    1. Variable names must begin with a letter. Other characters allowed in the name include any letter, any digit, a period, or the symbols @, #, _, or $. Variable names cannot end with a period. Avoid names that end with an underscore since that might conflict with internal SPSS variables.

    2. Variable names cannot exceed 64 characters.

    3. Do not use blanks or special characters (for example, !, ?, ', and *)

    4. Variable names must be unique; duplication is not allowed.

    5. Do not use reserved SPSS keywords as names. Keywords include: ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, WITH.

    6. Case does not matter. Use any mixture of upper and lowercase characters when naming your variable.

  2. Each row (line) in the Excel spreadsheet (other than the variable row) should represent a single subject or observed entity. 

  3. Avoid blank rows – it will complicate your import and analysis

  4. If you have missing data, do not leave that cell in Excel blank. Define a missing value code and place that code in any cell that contains missing data.

  5. Always use date variables with 4 digit year formats in Excel. That is, enter date in Excel using the format 01/01/2005 and not 01/01/05. Otherwise the old Y2K problem can still be a problem for date calculations.

  6. Use a data dictionary to make sure to include all of the variables you need to perform the tests you intend to perform. Use the specifications in the data dictionary such as codes, formats and data ranges to define how you will enter your data into Excel. Here is an example:

 

Variable Name

Label

Type (Width)

Value Codes

Missing Code

ID

Identification Number

String (4)

none

00000

Age

Age on January 1, 2005

Numeric (3.0)

none

-9

Sex

Gender

Numeric (1.0)

1=Female
2=Male

-9

TDATE

Test Date

Date (10) (mm/dd/yyyy)

none

None

SCORE

Initial Test Score

Numeric (6.2)

None

-9

 

  1. If you have the resources, enter your data twice (preferably using two different data entry people) and compare the two files. This is a standard professional practice that gives you added insurance that your data has been entered correctly. It also helps to prevent the need to reanalyze your data when you later realize that one or more entries were incorrectly coded into your dataset.

  2. Avoid putting any extraneous text into your spreadsheet – put explanatory information in other spreadsheets in the same file. Extraneous data in your primary spreadsheet can make importing the data into SPSS more difficult.

 

Importing data from Excel or other file formats into SPSS
 

  1.  As an example of what you're wanting, observe an Excel file that is prepared for import into SPSS -- (In Excel, open the file named EXAMPLE.XLS – see what it contains – then close it.) 

  2.  Import from Excel (EXAMPLE.XLS) (File/Open/Data, from “Files of Type” selection box, select files of .xls type)

  3.  Check the box labeled ‘Read variable name.’ 

  4.  Define Sex variable types. 

  5.  Change ID to String. 

  6.  Optionally Save file as FROMLX.

 

 

 

 See www.stattutorials.com/SPSSDATA for files mentioned in this tutorial © TexaSoft, 2008

End of tutorial

See http://www.stattutorials.com/SPSS

 

Stat book coverAlso, we recommend this book: Statistical Analysis Quick Reference Guidebook: With SPSS Examples is a practical "cut to the chase" handbook that quickly explains the when, where, and how of statistical data analysis as it is used for real-world decision-making in a wide variety of disciplines. In this one-stop reference, the authors provide succinct guidelines for performing an analysis, avoiding pitfalls, interpreting results, and reporting outcomes.
Paperback. Sage Publishers
ISBN: 1412925606
Order book from Amazon

 

WINKS Numbers

 

 

 

Get the SPSS BeSmartNotes Quick Reference Guide

Order


| Send comments | Back to Tutorial Menu | TexaSoft |

© Copyright TexaSoft, 1996-2008

This site is not affiliated with SPSS(r)