Observations and Variables
Nisha's till exports a sheet, her manager keeps another by hand, and they never quite agree. Half the trouble is layout: one sheet puts each month in its own column, the other puts two customers in one cell. Before you can analyse any table, you need a shared picture of what a table should look like.
The rule
Row = one thing observed. Column = one property. Cell = one value.
- An observation (also called a record, case or row) is one thing you measured: one order, one customer, one day.
- A variable (a field, feature or column) is one property measured for every observation: the date, the quantity, the amount.
- A value is what one variable holds for one observation: order 1002 has a
qtyof 3.
A table laid out this way is called tidy. Here is the orders sheet, which already is:
| order_id | order_date | customer | item_code | qty | amount |
|---|---|---|---|---|---|
| 1001 | 2025-06-02 | Asha Rao | C01 | 2 | 240 |
| 1002 | 2025-06-02 | Vikram Shah | C02 | 3 | 120 |
| 1003 | 2025-06-03 | Meera Iyer | B01 | 1 | 90 |
| 1004 | 2025-06-03 | Asha Rao | B02 | 2 | 220 |
| 1005 | 2025-06-04 | Dev Menon | C01 | 1 | 120 |
It has 5 observations and 6 variables. The unit of observation is one order. Asha appears twice because she placed two orders. That is not a mistake: each row is a different order.
A few more words you will meet constantly:
- Dataset: the whole collection of observations and variables.
- Metadata: data about the data, such as "amount is in rupees, including tax".
- Key: a variable that identifies each observation uniquely, like
order_id.