D. Statistical Analysis · Two-Variable Data Analysis and ValidityTwo-Variable Data and Scatter Plots
D2.1 D2.3About 65 minutes
Learning goals- I can explain how two-variable data differs from one-variable data and name the explanatory and response variables.
- I can choose a suitable display (scatter plot, side-by-side box plots or contingency table) for a pair of variables.
- I can draw a scatter plot by hand with sensible scales, and with technology.
- I can describe a scatter plot by its form, direction, strength and any unusual points.
Words to know
two-variable (bivariate) data
Data where two attributes are recorded for each individual, giving ordered pairs such as (temperature, sales).
explanatory variable
The variable that may explain or predict changes in the other. It is also called the independent variable and goes on the horizontal (x) axis.
response variable
The variable that responds. It is also called the dependent variable and goes on the vertical (y) axis.
scatter plot
A graph of two-variable numerical data in which each individual is one point (x, y).
linear relationship
A relationship whose scatter plot clusters around a straight line.
outlier
A point that lies far from the overall pattern of the other points.
cluster
A group of points that sit close together, separated from other groups.
Is it the cold, or is it the hockey?
The canteen at a community rink sells hot chocolate. The manager has noticed that some days are much busier than others. She wonders: does the outdoor temperature help predict how many cups she will sell? If it does, she can order milk and cups more wisely.
To answer, she needs two numbers for each day: the daily high temperature and the number of cups sold. That is two-variable data, and it is the topic of this whole unit.
Remember from Grade 9: in Mathematics (MTH1W) you made scatter plots, named independent and dependent variables, used technology to find the correlation coefficient r and a line of best fit, met residuals, and learned that correlation does not prove causation. In Grade 12 you will go much deeper: you will calculate r and the least-squares line by hand, understand why the formulas work, use residuals to judge a model, study contingency tables and side-by-side box plots, and judge statistical claims you meet in the media.
One variable or two?
In the sibling unit One-Variable Data Analysis you summarize one attribute at a time: the mean mark, the spread of commute times. In two-variable (or bivariate) data, each individual gives a pair of values. The question changes from "What is typical?" to "How are these two attributes related?"
Usually one variable might help explain the other:
- The explanatory variable (independent variable) goes on the x-axis. Here: temperature.
- The response variable (dependent variable) goes on the y-axis. Here: cups sold.
Ask yourself: Which one could I use to predict the other? Temperature could help predict sales. Sales cannot change the weather.
Sometimes neither variable clearly explains the other (for example, a student's math mark and science mark). Then either can go on the x-axis; choose the one you want to predict from.
Which display fits?
The right graph depends on the types of the two variables. You sorted variables into categorical (groups or labels) and numerical (counts or measurements) in the unit Organization of Data for Analysis.
The kind of display depends on the kinds of variables. This lesson is about scatter plots; contingency tables and side-by-side box plots each get their own lesson in this unit.Reading a scatter plot: form, direction, strength, unusual points
Here are the manager's data for 12 days in January and February. Each dot is one day.
| High (°C) | −16 | −14 | −11 | −9 | −8 | −6 |
|---|
| Cups sold | 94 | 85 | 88 | 76 | 80 | 70 |
| High (°C) | −4 | −3 | −1 | 0 | 2 | 4 |
|---|
| Cups sold | 72 | 61 | 63 | 52 | 55 | 44 |
Twelve days at the rink canteen (made-up data for practice). Each point is one day. As the temperature rises (moving right), sales fall: the points drift down to the right in a fairly tight band.To describe any scatter plot, comment on four things. Always use the context (the real variables), not just math words.
- Form. Do the points follow a straight line (linear), a curve (nonlinear), or no pattern at all?
- Direction. Positive: as x increases, y tends to increase (up to the right). Negative: as x increases, y tends to decrease (down to the right).
- Strength. How tightly do the points hug the pattern? Strong (a narrow band), moderate, or weak (a wide cloud). In the next lesson you will measure strength with a number, the correlation coefficient r.
- Unusual features. Any outliers (points far from the pattern) or clusters (separate groups)?
Four common patterns. Notice the last one: the points follow a clear curve, so the relationship is strong but not linear. A straight-line summary would describe it badly.Worked exampleExample 1: Describing the rink data
Describe the relationship shown in the rink scatter plot.
- Form: the points follow a roughly straight band, so the relationship is linear.
- Direction: as the temperature goes up, sales go down, so it is negative.
- Strength: the band is narrow; no point is far from the trend. It is strong.
- Unusual points: none stand out. The coldest day (−16 °C) had the most sales (94 cups), which fits the pattern.
There is a strong, negative, linear relationship between daily high temperature and cups sold: colder days tend to have higher sales. (In the next lesson you will find r ≈ −0.97 for these data.)
Worked exampleExample 2: Choosing variables and displays
For each pair, name the explanatory and response variables (if there is a natural choice) and the best display.
- Hours of sunlight per day and the height of a tomato plant.
- Province of residence and preferred winter sport.
- Type of school bus route (rural or urban) and ride time in minutes.
- 1. Both are numerical. Sunlight may explain growth, so sunlight is explanatory (x) and height is response (y). Use a scatter plot.
- 2. Both are categorical. Use a contingency table (a two-way table of counts).
- 3. Route type is categorical, ride time is numerical. Route type is explanatory. Use side-by-side box plots of ride time, one box for each route type.
Scatter plot; contingency table; side-by-side box plots.
Worked exampleExample 3: Choosing scales by hand
Ten maple trees in a sugar bush have trunk diameters from 18 cm to 52 cm and give from 32 L to 70 L of sap in a season. Plan the axes for a scatter plot on graph paper that is 20 squares wide and 15 squares tall.
- Diameter is explanatory (bigger trees may give more sap), so it goes on the x-axis.
- x: the data run from 18 to 52, a range of 34. Starting at 15 and using 2 cm per square gives 15 to 55 in 20 squares. Mark a broken-axis symbol (a small zigzag) near the origin to show the scale does not start at 0.
- y: the data run from 32 to 70, a range of 38. Starting at 30 and using 3 L per square gives 30 to 75 in 15 squares. Again show a broken axis.
- Label both axes with the variable and units, and give the graph a title.
x-axis 15 cm to 55 cm (2 cm per square), y-axis 30 L to 75 L (3 L per square), both with broken-axis marks, labels and units.
Scatter plots with technology
- Desmos: add a table, type the x-values in column x₁ and the y-values in y₁. The points appear at once. Use the wrench icon to set the window.
- Spreadsheet (Google Sheets, Excel, LibreOffice): put x in column A and y in column B, select both columns, and insert a scatter chart.
The same tools find r and the line of best fit, which you will also learn to calculate by hand in this unit.
Just for funA scatter plot walks into a bar. The bartender asks, "Why the long face?" It says, "Everyone keeps telling me I have no direction."
Hands-on activityBody measurements at home
You need: a tape measure (or a ruler and a long piece of string), a pencil, graph paper, and 6 to 10 people (family members, or friends on a video call can measure themselves).
- For each person, measure height and arm span (fingertip to fingertip with arms straight out to the sides) to the nearest centimetre. Write each pair in a table. You can include yourself.
- Decide which variable is explanatory. (Either is reasonable. If you want to predict height from arm span, arm span goes on x.)
- Plan your scales as in Example 3, then plot the points by hand.
- Describe the form, direction, strength and any unusual points in two or three sentences.
- Keep your data. You will calculate r and the line of best fit for it in the next lessons.
What to look for: the points should rise to the right in a fairly narrow band. Arm span and height are usually close for adults, so most points will be near the line y = x. Children, or anyone who measured with bent arms, may sit apart from the rest.
Your turn
1A study records, for 30 Ontario towns, the number of kilometres of bike lanes and the percent of residents who cycle to work. Name the explanatory and response variables.
Explanatory: kilometres of bike lanes (x). Response: percent who cycle to work (y). More lanes might encourage cycling.
2Which display would you use for favourite streaming service and age group (13–17, 18–24, 25+)?
Both are categorical, so a contingency table (two-way table of counts), possibly with a segmented bar graph.
3Which display would you use for hours of sleep last night and grade (9, 10, 11, 12)?
Grade is categorical (used as groups) and sleep is numerical: side-by-side box plots, one box per grade.
4In a scatter plot, the points fall from upper left to lower right in a wide cloud. Describe the direction and strength.
Negative direction, weak strength (a wide cloud).
5A scatter plot of age (in years) and reaction time for people from 10 to 80 drops at first, then rises. What is its form?
Nonlinear (curved, roughly U-shaped). A straight line would not describe it well.
6Why is it important to label each axis with units?
Without units the reader cannot tell what the numbers mean (°C or °F? cm or m?), so the graph cannot be interpreted or checked.
7One point on the rink scatter plot had been typed as (−3, 16) instead of (−3, 61). How would it look on the graph?
It would sit far below the band of other points: an outlier caused by a data-entry error. Always check outliers against the original records.
More practice: warm-up
1True or false: in two-variable data, each individual gives one number.
False. Each individual gives a pair of values.
2On which axis does the response variable go?
3Points rise from lower left to upper right. Positive or negative?
4What do we call a point far from the overall pattern?
5Name the display for two numerical variables.
More practice: on your own
1For 15 days in March, a Muskoka maple syrup producer recorded the overnight low temperature and the litres of sap collected the next day. Which is explanatory? Why?
The overnight low temperature is explanatory: freeze and thaw conditions may affect sap flow. Sap collected cannot affect the temperature.
2A student's points: (1, 3), (2, 5), (3, 6), (4, 9), (5, 10), (6, 12). Without graphing exactly, describe the relationship.
As x increases by 1, y increases by about 2 each time, with small wobbles. Strong, positive, linear.
3A scatter plot of house price against distance from downtown Toronto shows two separate groups of points: one close to downtown and one 40 to 60 km away. What feature is this, and what might explain it?
These are clusters. A possible explanation: the houses come from two different areas (the city and a commuter town), with few houses sampled in between.
4Why might a scatter plot of shoe size and reading level for students from Grade 1 to Grade 12 show a strong positive pattern?
Both increase with age. Older students have bigger feet and read at higher levels. (You will study this kind of common-cause relationship in the lesson on types of relationships.)
5Plan the y-axis for marks from 48% to 96% on graph paper with 12 squares available.
The range is 96 − 48 = 48. Start at 40 and use 5% per square: 40 to 100 takes (100 − 40) ÷ 5 = 12 squares and covers every mark. Show a broken-axis mark near 0. (Other sensible choices exist, such as 45 to 100 in 11 squares.)
Challenge
1Explain why the choice of which variable goes on the x-axis matters more for prediction than for describing strength.
Strength (how tightly points follow a line) looks the same if you swap the axes. But a prediction line is built to predict y from x. In the lesson on least-squares regression you will see that the line for predicting y from x is generally not the same as the line for predicting x from y.
2A city graphs the number of snowplows on the road against the number of car crashes for 40 winter days and finds a strong positive pattern. A councillor says the plows cause crashes. Describe the relationship correctly and suggest a better explanation.
Strong, positive. A better explanation is a common cause: heavy snowfall puts more plows on the road and makes roads slippery, causing crashes. The scatter plot alone cannot show that plows cause crashes.
3Data for 25 students: hours of part-time work per week (0 to 25) and average mark. Students who work 0 to 10 hours have marks spread from 60 to 95; those who work 20 or more have marks between 55 and 75. Describe what the scatter plot would look like and what it suggests.
The cloud would be wide on the left and lower and narrower on the right: a weak to moderate negative trend, with more spread at low hours. It suggests that long work hours are linked to lower marks, but low work hours do not guarantee high marks. It does not prove that work causes lower marks.
Check your understandingQuiz
1. Which pair of variables is best displayed with a scatter plot?
2. In a study of how study time affects marks, which variable goes on the horizontal axis?
3. The points in a scatter plot fall to the right in a narrow straight band. How would you describe the relationship?
4. A display for type of bus route (rural or urban) and ride time in minutes should be:
5. What does a cluster in a scatter plot show?
6. Which description of a scatter plot is the most complete?
For parents and teachersBig idea (D2.1, D2.3): two-variable data come in pairs. Before any calculation, your teen should decide which variable explains which, choose the right display, and describe a scatter plot in words: form, direction, strength, unusual points, always using the real variable names.
How to help: Do the arm-span activity together; it gives your teen real data to use for the next few lessons. Ask: "Which variable would you use to predict the other? Why?"
Common difficulties:
- Putting the response variable on the x-axis.
- Describing a curved pattern as "strong positive" without noticing it is not linear.
- Forgetting units and axis labels, or using uneven scales on hand-drawn graphs.
- Treating an outlier as a mistake without checking. Outliers can be errors, or they can be the most interesting data.