How do I enter data in spss

Importing SPSS data: 7 steps for successful data preparation

In this article, we want to provide you with step-by-step instructions for preparing data in SPSS. We will show you how to properly import data into SPSS. Data preparation is the basic building block for successful data management and therefore essential for data quality. After all, any analysis is only as good as the quality of your data! A thorough data preparation costs a little effort at the beginning, but later you will save a multiple of the time invested.

If you need support with data preparation in SPSS, our statisticians will be happy to help you.Contact us for a free consultation & a non-binding offer!

Let us know your requirements and we will provide you with a free offer within a few hours.

Inquire now without obligation

Correct data preparation for the evaluation of questionnaires

Basically, data preparation can be divided into seven steps, which are discussed in more detail below.

Overview of the steps for data preparation

Would you like help with the preparation of your data in SPSS or with other aspects of statistical analysis?Contact us for professional support with the SPSS evaluation! From statistical advice to data preparation and complete evaluation - our experts will help you quickly and competently.

Step 1: Import data into SPSS - the right file format is decisive

First you need to import your data into SPSS. The following notes are intended to help you avoid possible problems such as incorrect variable names or incorrect values. Different file formats have different advantages and disadvantages. You should also pay attention right from the start whether you want to display the data in wide or long format.

Advantages and disadvantages of the different file formats

File formatadvantagesdisadvantage
SPSS format (.sav)Easy to importPossible formatting errors if created automatically
Excel (.xlsx or .xls)Problem-free data entry and correction in ExcelImporting complex data sets can lead to problems with formatting and recognition of data types
Text file (.csv or .txt)For experienced users, this allows the most complete control over the data importInspection and import of the data are relatively cumbersome

Data in SPSS format (.sav)

If the data is already in SPSS format (.sav), importing the data is very easy.

Reading in data in SPSS format (.sav)

 

But even if you import SPSS data, these should always be checked for errors. This is especially true for the evaluation of questionnaires, because some platforms for online surveys tend to errors when exporting to the SPSS format.

Data in Excel format (.xlsx or .xls)

If your data is in Excel format (.xlsx or .xls), the import is usually also problem-free. However, you should inspect the Excel file beforehand in Excel to avoid potential problems. Make sure that the first line contains the names of the variables and that they do not contain any special characters or umlauts. Also check that the data starts right on the second line. If the file meets these criteria, you can import the data into SPSS (sub-item “File -> Import file-> Excel”).

Import data into SPSS: Excel data

Data in text format (.txt or .csv)

If you want to import data into SPSS that are in text format (.txt or .csv), this requires a little more care. First, you should examine the file in a text editor. Make a note of the following points:

  • Are the names of the variables on the first line?
  • Is the decimal point a point or a comma?
  • How are the entries separated? Common separators are semicolons or commas, but periods, spaces or tabs are also possible.

In this example, the variable names are on the first line. The decimal point is a point and the separator is a semicolon.

After this step, importing the data is usually easy. To do this, select “File -> Import file” in SPSS and then, depending on the ending, “CSV data” (for .csv) or “Text data” (for .txt).

Importing data in text format (.csv or .txt)

 

You can then import the SPSS data by taking SPSS through the following steps, which should not be a problem with the help of your notes.

Step 2: Rename variables and create labels

The next step in data preparation is naming and labeling your variables. Clearly named variables prevent confusion when locating variables and facilitate later data management. SPSS offers two options for identifying variables:

SurnameA name that is as short and concise as possible should uniquely identify a variable.
labelingYou can use the description to fully describe the variable. A clear description of variables is important so that you and others can quickly find their way around the data set. For the evaluation of questionnaires you can often use the full text of the question or a corresponding summary.

Unique names make it easier to find relevant variables

 

To edit the names and labels of your tags, switch to the tag view (button at the bottom left). You can then edit the names and labeling of the variables by clicking on the respective columns.

Variable view button

 

Name and label variables in the variable view

 

Step 3: Define missing values

The next important step in data preparation and data cleansing is dealing with missing values. SPSS knows two types of missing values:

  • System-related missing values: These are "empty" data fields in your data set. These cells are automatically recognized by SPSS as missing values.
  • Custom missing values: Missing values ​​that are identified by a numerical code (e.g. "-99")

User-defined values ​​are useful when evaluating questionnaires, for example, if test subjects answered a question with "don't know", "not applicable" or "don't want to answer". Of course, these values ​​should not be included in the analysis. You can exclude these from the analysis as user-defined missing values, but still differentiate them from “normal” missing values ​​for data management purposes.

Missing values ​​can be set for each variable in the variable view. To do this, click on the corresponding entry in the "Missing" column.

Define missing values ​​here

 

Up to three values ​​can be defined as missing

 

Step 4: Define correct variable formats

If you do not define the variable types correctly, the analysis cannot be carried out correctly later. You can specify the variable type for each variable in the variable view by clicking on the "Type" column. The main types are numeric, string, and date. Usually SPSS automatically recognizes the variable type correctly, but it is sometimes necessary to correct the type manually, especially for variables with a date.

Step 5: Numeric Codes for Categorical Variables

At the end of the data preparation, all of your categorical variables should be in numeric form. Otherwise you cannot include these variables in the analysis.

Values ​​for a categorical variable as a string and in numeric form.

 

If some of your categorical variables contain the categories as a string, you must first convert them to numeric form. You can do this very easily with the “automatically recode” command (to be found in the “Transform” menu item).

The command "automatically recode" can be found under "Transform"

 

In the following menu you need to add all categorical variables with strings to the window on the right. For each of these variables you then have to define a name for the new recoded variable. Then check the box for "Treat empty string values ​​as user-defined missing". You can accept the rest of the default settings.

Example of the automatic recoding of categorical variables

 

Step 6: Label variable codes for categorical variables

Your categorical variables should now be in numeric form. However, so that the meaning of the codes is clearly documented, you should now label your variable codes. Otherwise the meaning of the numeric codes may be unclear later. You can do this by clicking on the "Values" column in the variable view.

Label variable codes by clicking on "Values"

 

Then add a label for each of the values ​​of the variable.

Example for labeling variable codes

 

Step 7: Import data into SPSS - save data record

You have now successfully processed your raw data and prepared it for analysis. We recommend that you do not overwrite your raw data. This means that you can always undo your work steps. It is best to save your edited data set in a separate file.

Importing data into SPSS: conclusion

You now know the necessary steps to prepare data for the evaluation of questionnaires in SPSS. You can now import SPSS data and prepare it for analysis. Careful data preparation is essential for good data management and leads to enormous time and labor savings during the analysis. The Novustat experts are of course available at any time for further questions or more detailed advice on data management.

Finally, we would like to give you a checklist with which you can check whether you have completed all the steps for data preparation.

All data have been read in successfully
All variables clearly named and labeled
Custom missing values ​​defined (where necessary)
All variable types set correctly
All categorical variables are numerically coded
All variable codes are labeled
The processed data record is saved in a separate file

 

Further sources

SPSS TUTORIALS: IMPORTING DATA INTO SPSS

Data Cleaning: Detecting, Diagnosing, and Editing Data Abnormalities

The Ultimate Guide to Data Cleaning

Keywords: evaluation of questionnaires, data preparation, data management, importing spss data