Chapter 7: Reshaping a Data Table


What Shape Is a Data Table?

Wide versus Long Format

Reasons for Wide and Long Formats

Stacking Wide Data

Unstacking Narrow Data

Additional Examples

Stacking Wide Data

Scripting for Reproducibility

Splitting Long Data

Transposing Rows and Columns

Reshaping the WDI Data




For most analyses, we organize data into a two-dimensional tabular format in which each row is an individual observation or case, and each column contains a measurement or attribute pertaining to that individual. There are times, though, when this is not the only option or even the preferred option. This is particularly the case in longitudinal or repeated-measures studies where we will have multiple ...

Get Preparing Data for Analysis with JMP now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.