Restructure Data Wizard: Select Type

Use the Restructure Data Wizard to restructure your data. In the first dialog box, select the type of restructuring that you want to do.

  • Restructure selected variables into cases. Choose this when you have groups of related columns in your data and you want them to appear in groups of rows in the new data file.
  • Restructure selected cases into variables. Choose this when you have groups of related rows in your data and you want them to appear in groups of columns in the new data file.
  • Transpose all data. Choose this when you want to transpose your data. All rows will become columns and all columns will become rows in the new data. This choice closes the Restructure Data Wizard and opens the Transpose Data dialog box.

Deciding How to Restructure the Data

A variable contains information that you want to analyze--for example, a measurement or a score. A case is an observation--for example, an individual. In a simple data structure, each variable is a single column in your data and each case is a single row. So, for example, if you were measuring test scores for all students in a class, all score values would appear in only one column, and there would be a row for each student.

When you analyze data, you are often analyzing how a variable varies according to some condition. The condition can be a specific experimental treatment, a demographic, a point in time, or something else. In data analysis, conditions of interest are often referred to as factors. When you analyze factors, you have a complex data structure. You may have information about a variable in more than one column in your data (for example, a column for each level of a factor), or you may have information about a case in more than one row (for example, a row for each level of a factor). The Restructure Data Wizard helps you to restructure files with a complex data structure.

The structure of the current file and the structure that you want in the new file determine the choices that you make in the wizard.

How are the data arranged in the current file? The current data may be arranged so that factors are recorded in a separate variable (in groups of cases) or with the variable (in groups of variables).

  • Groups of cases. Does the current file have variables and conditions recorded in separate columns? For example:
Table 1. Data with variables and conditions in separate columns
var factor
8 1
9 1
3 2
1 2

In this example, the first two rows are a case group because they are related. They contain data for the same factor level. In IBM® SPSS® Statistics data analysis, the factor is often referred to as a grouping variable when the data are structured this way.

  • Groups of columns. Does the current file have variables and conditions recorded in the same column? For example:
Table 2. Data with variables and conditions in same column
var_1 var_2
8 3
9 1

In this example, the two columns are a variable group because they are related. They contain data for the same variable--var_1 for factor level 1 and var_2 for factor level 2. In IBM SPSS Statistics data analysis, the factor is often referred to as a repeated measure when the data are structured this way.

How should the data be arranged in the new file? This is usually determined by the procedure that you want to use to analyze your data.

  • Procedures that require groups of cases. Your data must be structured in case groups to do analyses that require a grouping variable. Examples are univariate, multivariate, and variance components with General Linear Model, Mixed Models, and OLAP Cubes and independent samples with T Test or Nonparametric Tests. If your current data structure is variable groups and you want to do these analyses, select Restructure selected variables into cases.
  • Procedures that require groups of variables. Your data must be structured in variable groups to analyze repeated measures. Examples are repeated measures with General Linear Model, time-dependent covariate analysis with Cox Regression Analysis, paired samples with T Test, or related samples with Nonparametric Tests. If your current data structure is case groups and you want to do these analyses, select Restructure selected cases into variables.