statable Statistics for study and research

Reshaping data (wide ↔ long)

In brief

Wide: one row per person, one column per time point (score_t1, score_t2). Long: one row per person and time point, with one column for the time point and one for the value. "Reshape" converts one form into the other and opens the result as a new project. The question types for several measurements (before/after, repeated measures) expect the wide form; data from learning platforms or experiments are often long.

Steps

  1. On the "Data" page choose "Reshape …" and set the direction.
  2. Assign columns. Wide → long: the columns that measure the same value at different times; Statable suggests columns with a common stem (t1_score, t2_score). Long → wide: person ID, time column and value column(s). The ID is an existing column or the row number.
  3. Preview: the first five rows before and after, plus notes.
  4. "Open as a new project" (recommended) or "Replace here".

What is carried along

New project or replace

The new project contains only the reshaped data; the current one stays unchanged in the "Recently edited" list. "Replace here" swaps the data in the open project (can be taken back with "Undo"); pages that refer to the previous columns may no longer calculate afterwards.

For specialists

Corresponds to VARSTOCASES and CASESTOVARS in SPSS; PSPP 2.1.3 knows neither, Statable does the reshaping itself.

Related

Open in Statable