Data tables: cases, variables and context
On this page 5 headings
A dataset is a collection of related observations. Before calculating anything, find out what one row means and what each column records.
Cases are the units we study
A case, also called an observation, is a unit from which we collect data. It might be a student, house, car sale, day, or event. In the illustrated table, each of the three students is one case.
Variables are the characteristics we record
A variable is a characteristic that can vary across cases. In the table, student name, board, marks and height are four recorded variables. A value is one entry: 162 cm is Asha’s height. Names and IDs help identify cases; they are usually not useful quantities to average.
Why context matters
The number 84 alone is unclear. Is it marks, age, price, or temperature? A useful dataset records who or what was measured, the variable names, units, time and source. Use the same unit within a numerical column.
Where data come from
Sometimes data already exist in published reports or downloadable files. Otherwise we need to collect or generate them, for example with a survey, an experiment, or a measuring instrument. The lectures mainly assume data are available and focus on analyzing them.
An unstructured pile of notes, messages or comments is harder to analyze than a consistent table. Organizing data gives it a structure: one case per row, one variable per column, and one value per cell.
Comments can reveal opinions, but commenters are not automatically a representative sample of everyone who watched a video or used a product.
Try it yourself
A file has 50 student rows and columns for name, board and marks. How many cases and variables are recorded?
Show explained answer
50 cases and 3 recorded variables. The header row is a label, not an extra case.
Try it yourself
A table has one row per day and columns for Chennai’s temperature and rainfall. What is a case?
Show explained answer
One day. The case is defined by the row, so it need not be a person.
More practice: apply what you learned
Try it yourself
A table records 25 houses, with columns for address, price and number of rooms. Identify the cases and variables.
Show explained answer
There are 25 cases: the houses. Three recorded variables are address, price and number of rooms. One price entry is a value, not a new variable.
Try it yourself
A column called “Distance” contains 5,8,12. What information is missing?
Show explained answer
The unit is missing: kilometers, meters or something else. We also need context, such as distance from home to school and which people were measured.
Source: Lecture 1.2.pdf. Explanations, diagrams and extra practice are prepared for these notes.
