Legend:

Menu Selections

Variable Names

Radio Options

Menu Box Names

Download wide.sav 

(see “SPSS format” under “Files used in the examples”)

Open wide.sav:

wide.sav preview

Transform using Restructure

In the SPSS menu, select Data  Restructure

SPSS screenshot

Select Restructure selected variables into cases.

SPSS screenshot

Select More than One.

(In this example, the Veggie and Fruit variables are to be restructured.)

SPSS screenshot

  • Set Use Case Number to None (see Note below).
  • Name the first Target Variable under Variables to be Transposed (Veggie).
  • Select Veggie variables on the left and drag them to box beneath Target Variable.
  • Name the second Target Variable under Variables to be Transposed (Fruit).
  • Select Fruit variables on the left and drag them to box beneath Target Variable.

Notes:

  • It is possible to create a case ID variable by selecting Use Case Number under Case Group Identification. This may be helpful in some datasets for identifying and sorting data.

  • The remaining variable(s) (e.g. Age) are either specified explicitly in this step (as Fixed Variables(s)), or carried forward in Step 6 of the Wizard.

SPSS screenshot

Select One.

(Veggie and Fruit have one index - Group.)

SPSS screenshot

  • Change Name (Index1) to Group and Levels to 3.
    Note: there are three groups: A, B, C.

SPSS screenshot

  • Select Keep and treat as fixed variable(s).
  • Select Create a case in the new file.

SPSS screenshot

  • Select Restructure the data now.
  • Select Finish.

Optional Sort

Select Data → Sort Cases

SPSS screenshot

  • Drag Group to Sort by box, then drag Last and select Descending under Sort Order, and finally drag First to Sort by box and select Ascending.

Optional Value Labels

SPSS screenshot

  • In Variable View, change the Value Labels the Group variable.
  • In Data View select  icon image icon.

reshaped data

--- The End ---