Create Figure 2 using SPSS

We assume that you have downloaded the ESS data and installed a copy of SPSS.

Open SPSS by clicking on the appropriate link. Open the ESS data by clicking ‘File’, ‘Open’, and ‘Data’ on the SPSS menu bar before you select the folder and the data set.

You can then either proceed by pasting and running the SPSS syntax, or you can follow the instructions and use the menus in SPSS.

SPSS syntax

*You can copy this syntax and paste it into a syntax window in SPSS. * Comments on commands start with an asterisk and end with a dot. * Commands must always end with a dot. *EXAMPLE, CREATE FIGURE 2 IN CHAPTER 1.

*The following command causes the cases to be weighted by the design weight variable 'dweight'.

WEIGHT BY dweight.

* The following commands cause SPSS to select for analysis those cases that belong to the Norwegian sample (value NO on country variable) and have lower values than 1975 on the birth year variable (& stands for AND, < stands for 'less than'). * The commands create a filter variable (filter_$) with value 1 for the selected cases and value 0 for the non-selected cases. * Change the last part of line 2 (which starts after the first equals sign) if you wish to select other cases than the Norwegian ones. If you do this, you should also change the variable label, which can be found within double quotation marks on line 3.

USE ALL.
COMPUTE filter_$=cntry = 'NO' & yrbrn < 1975.
VARIABLE LABEL filter_$ "cntry = 'NO' & yrbrn < 1975 (FILTER)".
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

* The following command creates a scatterplot, with the variable length of education measured along the vertical axis and the variable year of birth measured along the horizontal axis.

GRAPH
/SCATTERPLOT(BIVAR)=yrbrn WITH eduyrs
/MISSING=LISTWISE.

Instructions

The ESS team advises you to weight the data. Therefore, click ‘Data’ on the menu bar, select ‘Weight Cases’, find the variable ‘Design weight’ towards the bottom of the dialogue box’s list of variables, click the variable label and insert it in the ‘Frequency variable’ field. Finish by clicking ‘OK’.

Figure 3. Weight cases procedure

Now, to reproduce Figure 2, you have to deselect the non-Norwegians and all those born after 1974. This is achieved by clicking ‘Data’ and ‘Select Cases’ on the menu bar. Next, tick ‘If condition is satisfied’, click ‘If’ and indicate that you want to analyse information about those Norwegians who were born before 1975. Do this by first typing the country variable name or select it from the variable list, and add = ‘NO’ to indicate that you want to select the Norwegian cases. (NO is the Norwegian value code.) Continue by typing the sign &, which indicates that yet another condition must be fulfilled. Finally, state this second condition by typing yrbrn < 1975, which states that the value of the birth year variable should be less than 1975. The full command should read as follows: cntry = ‘NO’ & yrbrn < 1975. (See Figure 4 and learn more about logical operators here.) When this is done, click ‘Continue’ and ‘OK’. (Avoid ticking the option ‘delete unselected cases’, since this will change your dataset permanently.) You must give a new ‘Select cases’ command if you want to change these settings and include non-Norwegians or younger people in your active data set.

Figure 4. Select cases procedure

Now you can create the graph. Go to the ‘Graphs’ menu. If you are using SPSS 14.0 or older versions, click ‘Scatter/Dot’. If you are using SPSS 15.0, click ‘Legacy dialogs’ and ‘Scatter/Dot’. Choose ‘Simple Scatter’ and click ‘Define’. Select the birth year variable from the variable list and put it in the X Axis (horizontal axis) field. Put the education length variable in the Y Axis field and click ‘OK’.

Figure 5. Creating a scatterplot

The following applies to both those who use syntax and those who use the menus: Double click on the scatterplot that appears in the output window. A new window opens. Choose ‘Interpolation line’ from the ‘Elements’ menu. Choose ‘Interpolation line’ in the dialogue box as well. Tick ‘Straight’ before you click ‘Apply’ and ‘Close’. A line that interpolates between cohort means will be inserted into the plot. (Drop the preceeding step if you wish to create a figure without such an interpolation line.) Then choose ‘Fit line at total’ from the ‘Elements’ menu and ‘Fit line’ in the dialogue box. Tick ‘Linear’ before clicking ‘Apply’ and ‘Close’. The figure should now appear with a linear regression line and a zigzag line running through the conditional means. Text and other features of the figure can be edited. Finish editing before using ‘Copy chart’ from the ‘Edit’ menu to make a copy for pasting into a text file.

Go to next page >>