Chapter 7: Reshaping a Data Table

Introduction

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

Conclusion

References

Introduction

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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.