Skip to Main Content

Getting Started with SPSS

Restructuring Data

SPSS can restructure data from wide format (multiple rows for each observation/participant) into long format (one row for each observation/participant) or vice versa.

The example represents two participants with two measurements (income and job satisfaction) measured at three different time points.

Restructuring data from long format into wide format

To restructure data from long format into wide format:

  1. From the menu, choose Data > Restructure, the dialog box “Restructure Data Wizard” will appear.

  1. Select “Restructure selected cases into variables”.
  2. Add identifier variable to the Identifier Variable(s) box (in this case, id) and add designator to the Index Variable(s) box (in this case, year).

  1. Select “Yes – data…”. Click Next to go to Cases to Variables: Options.

  1. Select the options you need (optionally). Click Next to go to Finish.
  2. Select the option you need (optionally). Click Finish. The data should be restructured to a wide format.

Restructuring data from long format into wide format

To restructure data from long format into wide format:

  1. From the menu, choose Data > Restructure, the dialog box “Restructure Data Wizard” will appear.
  2. Select Restructure selected variables into cases.
  3. Select the correct number of variable groups to restructure (in this case, there are two variable groups - income and job satisfaction). Click Next.

  1. Select Use selected variable for Case Group Identification and add id as the identification variable. Under Variables to be Transposed, select trans1 for Target Variable and rename trans1 as income. Add income.1, income.2 and income.3 to the list underneath. Then select trans2 for Target Variable, rename trans2 as jobsat, and add jobsat.1, jobsat.2 and v.3 to the list underneath. Click Next.

  1. Select the number of index variables you want to create (in this case, “One”).

  1. Rename the index variable name index1 under Edit the index variable name and label. Click Next.

  1. Select the options you need. Click Finish. The data should be restructured to the long format.

McGill LibraryQuestions? Ask us!
Privacy notice