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

 

 


 

Create a data set and enter data into SPSS


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.

 

 

Create an SPSS Data Set

 

This tutorial illustrates how to create a data set in SPSS. Before you create your data set, you should know what variables you want to enter. The data set is set up with subjects (observations) on each row and variables in columns. Take note of these restrictions:

    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.

Best practice is to create a “Data Dictionary” of your data set to determine your needs. Here is an example of how you would set up a dictionary (using Excel or Word tables).

Data Dictionary

Now that you’ve gathered up the information needed, create the data set in SPSS using the following procedure:

    • Begin SPSS. Select File/New/Data (from opening screen)

    • Enter variable names (Name, Age, Gender) in Variable View, specifying variable type, width and decimals as appropriate. Enter labels and missing values as indicated in the Data Dictionary.

SPSS Enter Variable View

      • For missing values, click on the three dots (. . .) and (for this example) select discrete and enter the missing value code as indicated in the Data Dictionary. See example dialog box below:

    SPSS MIssing Values

     

    Note that SPSS allows you to select No missing values, Discrete missing values, or a combination of a range and a discrete value as shown in this dialog box.

        • For values (labels for categorical variables) click  on the three dots (. . .) and (i.e. Gender) enter the numeric value for the category in the “Value” textbox – (for example 1) and a Label (for example Male) and click Add. Do this for each category. For Gender the final information is shown below.

        SPSS Value Labels

          • Once you have entered all of the Data Dictionary information for the variables in your data set, click on the “Data View” tab at the bottom of the screen. Enter data in the appropriate columns.
          • For this example, enter this sample data:

          SPSS Enter Data

        • Notes on the Missing Values Codes: What are missing values codes, and why do you need them? Sometimes in the collection of data there are values that are lost or cannot be gathered. These are called "missing values." When such values occur, it is important for the program to know that the values are missing so that statistical calculations may take this into account. Missing values are usually designated as an impossible value. For example, the missing values designated for the variable AGE may be -9, since it is impossible for the variable AGE to have the value -9. When the program is asked to calculate the mean of AGE, for example, it will ignore those records where AGE is -9 in that calculation if -9 has been specified as the missing value code. In most procedures, there is a case wise deletion of the record from calculation whenever a missing value is encountered.

          Once you designate a missing value code for a variable, it is up to you to make sure that this code gets placed into your data set in the proper records and fields. For example, if you have designated -9 as the missing value code for AGE, you must make sure that in your data set a -9 appears in the field AGE if that data is missing or unknown.

        You may change or correct the missing values for a database at any time by calling up the “Variable View” option.

        Important: If missing values are not specified you may inadvertently run a procedure that uses incorrect data for its calculations

        • Save data using the name SAMPLE1.

        • The data are now ready for analysis. For example, From the Analyze menu, select Descriptive Statistics/Explore. Select Age and the Dependent variable and Gender as the Factor and click Ok to display means of age by gender (note that there is one missing value.)

       

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

       

      End of tutorial

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

       

      Stat book coverWe 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)