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
- On the "Data" page choose "Reshape …" and set the direction.
- 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.
- Preview: the first five rows before and after, plus notes.
- "Open as a new project" (recommended) or "Replace here".
What is carried along
- Other columns (e.g. group) are carried along; for long → wide only if they do not change within a person. The preview names the dropped ones.
- Value labels, level of measurement and "no answer" of the measured columns are kept; differences between the columns are reported in the preview.
- Missing combinations become blank. If the same person has the same time point more than once, the first row counts.
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.