Wide and narrow data

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Wide and narrow (sometimes un-stacked and stacked) are terms used to describe two different presentations for tabular data.[1][2]

Wide[edit]

Wide, or unstacked data is presented with each different data variable in a separate column.

Person Age Weight
Bob 32 128
Alice 24 86
Steve 64 95

Narrow[edit]

Narrow, or stacked data is presented with one column containing all the values and another column listing the context of the value

Person Variable Value
Bob Age 32
Bob Weight 128
Alice Age 24
Alice Weight 86
Steve Age 64
Steve Weight 95

This is often easier to implement, addition of a new field does not require any changes to the structure of the table, however it can be harder for people to understand.

Implementations[edit]

Many statistical and data processing systems have functions to convert between these two presentations, for instance the R programming language has several packages such as the reshape package

See also[edit]

References[edit]

  1. ^ Thompson, M. E. (1997), Theory of sample surveys, Chapman & Hall, London. ISBN 0-412-31780-X
  2. ^ Chantala, K. (2006) "Using STATA to Analyze data from a Sample Survey". 1-10-2001. UNC Chapel Hill, Carolina Population Center. 10-1-2006.

External links[edit]