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 One.

(In this example, there is only one variable (Plant) that is restructured)

SPSS screenshot

  • Set Use Case Number to None (see Note below).
  • Name the Target Variable under Variables to be Transposed (Plant).
  • Select Veggie and 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, or carried forward in Step 6 of the Wizard.

SPSS screenshot

Select More than One.

(Every Plant has 2 indices, a Type and a Group)

SPSS screenshot

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

  • Change Name (Index2) to Type and Levels to 2.
    Note: there are two types: Fruit, Veggie

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 Type, Group, and ID (in order) to Sort by box.

Optional Value Labels

SPSS screenshot

12_Value%20Labels.png

  • In Variable View, change the Value Labels for Type and Group variables.
  • In Data View select  Icon image icon.

reshaped data

--- The End ---