Exercise 1.1. Constructing a pooled dataset

In this exercise, you are taught how to create a dataset with data from several ESS rounds. However, if you don't want to do this work yourself, you may download the manipulated data from the following link.

  1. Download the separate datasets from the first three ESS rounds and save them on your disk. The data can be found on the ESS data website.

    Step by step instructions

    • Click the first dataset in the frame on the left.
    • Click the download icon above the frame on the right:
    • Select SPSS as the dataformat and press ‘Download’. Please register if you are a new user.
    • Save the file to your disk. Repeat for the two next datasets.
  2. Merge the three datasets into one combined dataset containing the data from the three rounds.

    SPSS syntax

    *Start SPSS and open a new syntax window. Copy the syntax below into the syntax window and press ‘run’. *Please do not forget to change ‘C:\’ to the path where you stored the ESS datasets, and to check the names of the datasets. *This will create a dataset with 132,896 rows (units/individuals from three rounds) and 1,076 variables.

    ADD FILES
    /FILE='C:\ESS1e06.sav'
    /FILE= 'C:\ESS2e03.sav'
    /FILE= 'C:\ESS3e03.sav'.
    EXECUTE.
  3. Select cases. Make a selection of the respondents that will be used in this module.
    • Retain only respondents who are living in one of the 17 countries that participated in each of the first three ESS rounds. CNTRY is a character variable containing the country codes. The countries that should be retained (and their respective country codes) are: Austria (AT), Belgium (BE), Switzerland (CH), Germany (DE), Denmark (DK), Spain (ES), Finland (FI), France (FR), Great Britain (GB), Hungary (HU), Ireland (IE), the Netherlands (NL), Norway (NO), Poland (PL), Portugal (PT), Sweden (SE) and Slovenia (SI).
    • In this study, we focus on anti-immigration attitudes among majority group members. The presence of immigrants or ethnic minority group members (who probably have very different views on immigration) in the sample could distort the results. To avoid this, remove all respondents of foreign nationality (variable BRNCNTR) or who belong to an ethnic minority group (BLGETMG).
    • Exclude respondents with missing values for at least one of the three anti-immigration items (IMSMETN, IMDFETN, IMPCRNTR) 1.

    SPSS Syntax

    *Select respondents who live in one of the 17 countries. *This syntax will reduce the number of rows from 132,896 to 98,561.

    SELECT IF
    (cntry = "AT") or
    (cntry = "BE") or
    (cntry = "CH") or
    (cntry = "DE") or
    (cntry = "DK") or
    (cntry = "ES") or
    (cntry = "FI") or
    (cntry = "FR") or
    (cntry = "GB") or
    (cntry = "HU") or
    (cntry = "IE") or
    (cntry = "NL") or
    (cntry = "NO") or
    (cntry = "PL") or
    (cntry = "PT") or
    (cntry = "SE") or
    (cntry = "SI").

    *Select respondents who were born in the country and do not belong to an ethnic minority. *This syntax will reduce the number of rows from 98,561 to 88,134.

    SELECT IF (BRNCNTR=1) AND (BLGETMG=2).

    *Delete observations with missing values. *This syntax will reduce the number of rows from 88,134 to 84,331.

    COUNT missings = IMSMETN IMDFETN IMPCNTR (missing).
    SELECT IF missings = 0.
  4. Save the newly created dataset under a new name. Keep only the following variables in the dataset:
    • The anti-immigration items: IMSMETN, IMDFETN, IMPCRNTR
    • The respondent’s country: CNTRY
    • The ESS round: ESSROUND
    • Weighting variables: DWEIGHT, PWEIGHT

    SPSS Syntax

    *Save the newly created dataset under a new name. *Please do not forget to change ‘C:\’ to the path where you stored the ESS datasets.

    SAVE OUTFILE = 'C:\ESS123_immig.sav'
    /KEEP = CNTRY ESSROUND IMSMETN IMDFETN IMPCNTR DWEIGHT PWEIGHT.
Go to next page >>

Footnotes