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.
The shortcut
To judge any sheet, finish the sentence "Each row is one ___." If you cannot fill the blank with a single noun, the sheet is not tidy.
Read the layout
Columns:
customer,June,July,August, each holding that month's order count.
The trap to watch for is one cell holding two values, such as "Asha Rao, Dev Menon". You can no longer count, filter or look up either person.
Drills
Answer fast — trust the rule.
In the orders table above, what is one observation?
How many variables does the orders table have?
Which layout is tidy for daily cold-coffee sales?
Which column is the best key for the orders table?
A note says "amount is in rupees and includes 5% GST". What is this note?
Remember
- Row = one thing observed; column = one property; cell = one value.
- Shortcut: finish "Each row is one ___" with a single noun.
- Traps: values hiding in column headers, and two values crammed into one cell.
