Our memory blurs a lot of separate observations into a vague gut feeling, so we need an organized way to write them down.
1
Individuals, Variables, and Data
Data is a table that organizes observations by giving each person or object we study its own row and each question we ask about them its own column.
Individuals, Variables, and Data
One row of the coffee shop table links a single customer to the three answers recorded for them:
individual (or case)Customer 1:Drink TypeLatte,Espresso Shots2 shots,Wait Time3.2 min⟶one row of all rows and columnsdata
2
Categorical and Numerical Variables
Once our observations are in columns, we want to summarize them with math. That means separating columns that sort individuals into labels from columns that record real numbers.
Variables split into categorical variables, which sort individuals into categories or labels, and numerical (or quantitative) variables, which record numbers where arithmetic makes sense.
Categorical and Numerical Variables
Even when a cash register records drink types with number codes, averaging those codes gives a meaningless number, whereas averaging wait times gives an actual time:
A numerical variable is either counted in separate steps with gaps in between, or measured along a continuous range without gaps:
Counted things jump from one number to the next with empty space in between, while measured things fill every gap no matter how far you zoom in.
Whether a numerical variable is discrete or continuous depends on the values a single individual can have, not on the average across the whole table, so a discrete count can still have a decimal average:
one customer (discrete count)0,1,2,3,4 shots⟶average across 100 customers1.8 shots
3
Identifying Individuals and Variables
In practice, observations start as a written description rather than a neat table, so we have to figure out what goes in the rows and classify each column ourselves.
From the shelter records for 80 adopted dogs, which list each dog's breed, microchip ID number, days spent at the shelter, and weight in pounds, we want to identify the individuals and classify all four variables.
Identifying Individuals and Variables
Text solution
Find who the measurements describeBreed, microchip ID, days at the shelter, and weight all measure the dogs rather than the owners or shelter workers, so each adopted dog gets its own row.
Rows: 80 individuals (cases)Dog 1, Dog 2, …, Dog 80
Test the word and digit labels for arithmeticBreed sorts dogs by word labels, and averaging two microchip IDs tells us nothing about a typical dog, so both columns are categorical labels.
Breed → categoricalGolden Retriever, Beaglemeaningless → Microchip ID is categorical29851120045+9851120089
Separate the counted numbers from the measured numbersArithmetic makes sense for both shelter stay and weight (10 days=2×5 days and 40 lb=2×20 lb), with calendar days counted in whole steps and weight measured at any value on the scale.
counted with gaps → discrete numerical1,2,…,14 daysmeasured without gaps → continuous numerical20 lb,20.4 lb,20.418 lb
So the shelter table has 80 dog rows and four variable columns: two categorical (Breed and Microchip ID), one discrete numerical (Days at the Shelter), and one continuous numerical (Weight in Pounds).
4
Distributions
Even after we organize 100 customers into a clean table, looking down a raw column of 100 entries still tells us almost nothing at a glance. We need to turn the column into a picture of how its values are spread out.
A variable's distribution is what categories or values show up in the data and how often each one happens.
Distributions
Each customer row in the table adds one wooden block to the stack for its drink category or its 1-minute wait-time interval, turning a column of 100 individual records into the variable's distribution.
Stacking each customer's entry by its category or value turns a long column of 100 rows into a clear shape that shows the variable's distribution.
How we display and summarize a distribution depends on whether the stacks sit above category labels or along a number line.
Drink Type (100 blocks)Categorical distribution⟶frequency table or bar chartcount or percentagein each categoryWait Time (100 blocks)Numerical distribution⟶histogram on a number lineshape (symmetrical or tailed),center, and spread
Key concepts
Everything starts by turning observations into a table where each row is an individual (or case) and each column is a variable. To find the individuals in a problem, ask who or what the recorded columns actually measure (`Dog 1` to `Dog 80`, not the shelter workers).
To classify a variable, test whether averaging two entries makes sense before trusting how the entries are written:
Key concept
If averaging is meaningless, the variable is categorical, even when written with digits (`1 = Latte` or Microchip ID `9851120045`). Summarize its distribution by counting individuals or finding percentages in a frequency table or bar chart. Never report a numerical center or tail for categories.
Key concept
If averaging makes sense, the variable is numerical (or quantitative). Look at what a single individual can have, not the group average: separate counted steps with gaps (`0, 1, 2` espresso shots) make it discrete, even if the average across customers has a decimal (`1.8` shots), while measured values without gaps (`3.2` minutes or `20.418` pounds) make it continuous. Stack a numerical variable along a number line to form a histogram and describe its shape (symmetrical or stretched into a long tail), center, and spread.
5
Practice
1
Four mechanics inspect the 150 buses in a city transit fleet. For each bus, they record the manufacturer (such as Gillig, New Flyer, or Nova), the number of seats inside the bus, and the total mileage on the odometer in miles. If you organize this data into a table, what are the individuals (and why aren't the mechanics the individuals), and is each variable categorical, discrete numerical, or continuous numerical?
Ask who or what the three measurements (manufacturer, seats, and mileage) actually describe: a mechanic or a bus?
IndividualsWatch out for the common mistake of picking the 4 mechanics just because they are the people in the problem. That would give a 4-row table, when manufacturer, seat count, and mileage are measurements of the buses. Each bus gets its own row, so the individuals are the 150 buses.
ManufacturerSorts buses into word labels where arithmetic makes no sense →categorical.
Number of seatsArithmetic makes sense, and seats in a single bus are counted in whole numbers with gaps between possible values →discrete numerical.
Total mileageArithmetic makes sense, and distance is measured along a range without gaps (even if an odometer rounds what it displays, actual distance driven has no gaps) →continuous numerical.
2
An online store records three variables for each of 200 shipped orders: the 5-digit destination ZIP code, the shipping speed code entered in the computer (1 for Standard, 2 for Express, 3 for Overnight), and the number of days the package took to arrive (counted in whole calendar days). Classify each variable as categorical, discrete numerical, or continuous numerical, and explain why being written with digits does not make all three numerical.
Try averaging two ZIP codes or averaging shipping codes 1 and 2. Does the result give a meaningful shipping measurement?
ClassificationDo not treat all three columns as discrete numerical just because all three are written with whole-number digits. Averaging two ZIP codes or averaging 1 (Standard) and 2 (Express) to get 1.5 tells you nothing, so destination ZIP code and shipping speed code are just category labels →categorical.
For number of days to arrive, arithmetic makes sense (4 days is twice as long as 2 days). Avoid calling it continuous just because it involves time: here the store counts whole calendar days with gaps between values, so it is discrete numerical.
3
A librarian records the number of books checked out by each of 50 visitors and finds that the average is 2.34 books per visitor. A student argues, "Because 2.34 has a decimal, the number of books checked out must be a continuous variable." Explain why the student is mistaken.
Ask how many books a single visitor can check out at the desk, before anyone divides by 50 to find the average.
The student is confusing the average across 50 visitors with the values a single individual can have. One visitor can only check out a whole number of books (0,1,2,3,…, never 2.34 books for one person). Because a single visitor's count has gaps between possible values, number of books checked out is discrete numerical; dividing a whole-number total by 50 visitors can still give a decimal average of 2.34.
4
A bakery records the pastry ordered (Croissant, Muffin, or Scone) and the wait time in minutes for each of 80 morning customers, then stacks one wooden block per customer to show the distribution of each variable. How many total blocks are in each distribution, where do two customers with wait times of 2.1 minutes and 2.8 minutes land on a number line marked in 1-minute intervals, and what two things does a variable's distribution tell you?
Avoid multiplying 80×2=160 blocks or counting 3 blocks for the 3 pastry types.
Each customer row in the table drops one block into the variable's picture. Check which 1-minute interval on the number line contains both 2.1 and 2.8.
Total blocksAvoid multiplying 80×2=160 blocks or counting 3 blocks for the 3 pastry types. Each of the 80 customer rows adds one block per variable, so each distribution contains 80 blocks.
Where 2.1 and 2.8 minutes landOn a number line marked in 1-minute intervals, both 2.1 minutes and 2.8 minutes fall between 2 and 3, so both blocks land stacked on top of each other in the 2-to-3 minute interval.
What the distribution tells youIt shows what categories or values show up, and how often each one happens.
5
A theater collects data on 500 ticket sales, recording the movie genre (coded as 1=Action,2=Comedy,3=Drama,4=Horror) and the ticket price paid in dollars. An intern writes: "The distribution of movie genre has a center of 2.1 and a long tail stretched to one side, just like the distribution of ticket prices." Explain what is wrong with the intern's description of movie genre, and state how each distribution should be summarized and displayed instead.
Check whether movie genres 1,2,3,4 sit on a real number line where 2.1 is a meaningful middle genre.
What is wrongThe intern made the mistake of treating the digit codes 1,2,3,4 as real numbers. Movie genre is categorical: its labels have no numerical order on a number line, so a "center of 2.1" and a "long tail" are meaningless (reordering the genre codes would completely change the shape and average).
How to summarize and display eachSummarize the categorical movie genre distribution by counting the ticket sales (or finding the percentage) in each genre and display it with a frequency table or bar chart; display the numerical ticket price distribution as a histogram on a number line and summarize it by its shape (symmetrical or tailed), center, and spread.