Wide and narrow data
From Wikipedia, the free encyclopedia
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]
-
See also: Entity–attribute–value model
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]
- Abstract data type
- Table (information)
- Information graphics
- Row (database)
- Table (database)
- Table (HTML)
References[edit]
- ^ Thompson, M. E. (1997), Theory of sample surveys, Chapman & Hall, London. ISBN 0-412-31780-X
- ^ 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]
| Look up table in Wiktionary, the free dictionary. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||