Chapter 14 Ā· Statistics and data analysis
Making and Checking Predictions with Linear Models
Use a linear model to predict values, check whether each prediction is supported by the data and possible in context, and find and fix mistakes in how a model is read.
A linear model is the equation of a straight line that someone chose because the line stays close to a set of data. It sums up the overall pattern, or trend, in that data. A prediction is the value the model gives when you put in a value you choose.
In this lesson you will use a model to make predictions, decide which predictions deserve your trust, and catch mistakes in how a model is read.
Keep one fact in mind from the start. The line was chosen for closeness to the data. It does not have to pass through every data point, so a prediction is an estimate, not a guarantee.
One situation runs through the whole lesson. Eight students each reported how long they studied for a science test worth 100 points. A classmate chose a linear model for their results. Before you see it, here is what each letter means.
- is the study time, in hours.
- is the score the model gives, in points.
- The reported study times run from 0 hours to 6 hours. So is the data range: the -values that the data actually cover.
- A real score on this test is from 0 to 100 points.
| Study time x (hours) | Actual score (points) | Model value 6x + 52 (points) | Actual minus model (points) |
|---|---|---|---|
Read across any row. The model's value is close to the actual score, but the two are not equal. In this table they differ by 1 to 3 points. The actual score is above the model's value for five students and below it for three. Seeing some scores above and some below is a rough sign that a line is close. It is not a rule, and the two counts do not have to match.
How close the line stays to the data is called the model's fit. You judge fit by closeness to the data as a whole, not by whether the line hits each data point. So keep two ideas apart:
- The equation is exact. For it gives exactly .
- The match to real scores is approximate. The student who studied 4 hours scored 78.
To predict, put a study time in hours in place of and work out . Then state the result with the word about.
Worked example
Predict a score from a study time
A student plans to study for 3.5 hours. Use the model to predict the student's score.
Decide which letter the given number replaces. 3.5 is a study time in hours, and x stands for study time in hours. The units match, so 3.5 goes in for x.
Substitute 3.5 for x. The equation gives the model's score for any study time, so this gives the model's score for 3.5 hours.
Multiply first, because multiplication comes before addition. A rate of 6 points per hour for 3.5 hours makes 21 points: 6 times 3 is 18, and 6 times 0.5 is 3.
Add the 52 points that the model gives for 0 hours of study.
Say what the number means. The model's value is exactly 73, but a real score is only expected to land near it, so report an estimate.
Answer
The model predicts a score of about 73 points for 3.5 hours of study.
Worked example
Find the study time that goes with a score
According to the model , what study time goes with a score of 85 points?
This time you know the score and want the study time. 85 is a score in points, and y stands for the model's score, so 85 replaces y. The unknown is x.
Subtract 52 from both sides. Taking the same number away from both sides keeps them equal, and it leaves the term with x alone on the right.
Divide both sides by 6. You may do this because 6 is not zero, and dividing both sides by the same nonzero number keeps them equal.
Check by putting 5.5 back into the model. The result should be 85 again.
Say what the result means. The model's line reaches 85 points at 5.5 hours. This is an estimate from the trend in the data. It is not a promise that 5.5 hours of study produces a score of 85.
Answer
According to the model, a score of 85 points goes with about 5.5 hours of study.
The equation will give you a number for any -value you put in. That does not make every number a sensible prediction. A prediction is reasonable when it is supported by the data and possible in the situation. Two things decide this.
First, the model was chosen using study times from 0 to 6 hours only. Inside that data range, the table shows the line staying close to real scores, so you have evidence for the trend. Outside it, you have no data. The trend might continue, level off or change, and the model cannot tell you which.
Second, the situation sets limits. A score on this test cannot be below 0 or above 100 points, so a model value outside those limits cannot be a real score.
Look back at your two results. Both 3.5 hours and 5.5 hours are inside , and both 73 and 85 are possible scores. Those are reasonable estimates.
Key concept
Two checks for a reasonable prediction
A linear model's equation is exact, but its fit to the data is approximate, so every prediction is an estimate. For a model whose line stays close to its data, treat a prediction as reasonable when the answer to both questions is yes:
- Data range: Is the -value inside the range of -values that the data cover?
- Context: Is the -value one that can really happen in the situation?
If the -value is outside the data range, the data give no evidence there. Use the prediction with caution, and trust it less the farther outside it is. If the -value is impossible, the prediction is not reasonable.
Worked example
Judge two predictions
The model was chosen from study times of 0 to 6 hours, and the test is worth 100 points. Is the model's prediction reasonable for (a) 7 hours of study and (b) 9 hours of study?
Part (a). Find the model's value for 7 hours by substituting 7 for x.
Check the data range. 7 is greater than 6, so 7 hours lies 1 hour outside the range. No student in the data studied that long, so the data cannot show whether the trend continues there.
Check the context. 94 is between 0 and 100, so it is a possible score. One check passes and one fails: the value is possible, but the data do not support it, so use it only with caution.
Part (b). Find the model's value for 9 hours.
Run both checks. 9 hours lies 3 hours outside the data range, and 106 is more than the 100 points on the test. Both checks fail. Since no score can pass 100, real scores cannot keep following this line that far beyond the data.
Answer
(a) About 94 points is a possible score, but 7 hours is outside the data range, so use this prediction only with caution. (b) 106 points is not a reasonable prediction, because 9 hours is well outside the data range and no score can pass 100 points.
To interpret a model is to say in words what its numbers tell you about the situation. You already know that the -intercept, 52 here, is the model's value when . The slope, 6 here, is the rate of change: the model's score rises 6 points for each extra hour of study.
An interpretation goes wrong when it gives a number the wrong job, uses the wrong units, or claims more certainty than the data allow. You find an error by testing a statement against what the model really says. You correct it by rewriting the statement so that every check passes. The table lists the checks for the study-time model.
| What to check | Question to ask | What is true for this model |
|---|---|---|
Slope | Is it read as a rate, with both units? | points per hour of study |
-intercept | Is it read as the model's value at ? | points for hours of study |
Units | Is the -value in the units the model uses? | Hours, not minutes |
Data range | Is the -value inside the range the data cover? | |
Context | Can the -value really happen? | A score is from to points |
Fit | Does it allow a gap between a real score and the model's value? | Gaps of to points in this data |
Wording | Does it say "about" and stop short of claiming a cause? | The data show a trend, not a cause |
Worked example
Find and correct three errors
A student wrote three notes about the model , where is the study time in hours and is the score in points. Find and correct the error in each note. Note A: The 6 is the score the model gives for a student who does not study. Note B: For 30 minutes of study, the model gives points. Note C: The student who studied 3 hours scored 67, but the model gives 70, so the model is wrong.
Start from what the model really says, so you have facts to test each note against. The slope 6 is a rate: 6 points per hour. The y-intercept 52 is the model's score at 0 hours. The x-value must be in hours.
Test note A. A student who does not study has x = 0, and the model's value there is the y-intercept, 52. The note gives that job to the slope. Corrected: the model gives 52 points for 0 hours of study, and its score rises 6 points for each extra hour.
Test note B with the context check. 232 is more than 100 points, so it is impossible. That signals a mistake. The 30 is a number of minutes, but x must be in hours. Convert, using 60 minutes = 1 hour.
Redo the prediction with x = 0.5. Now 0.5 is inside the data range of 0 to 6 hours, and 55 is a possible score, so both checks pass.
Test note C. A linear model is chosen to stay close to the data, not to hit every data point. The gap here is 3 points, which matches the gaps of 1 to 3 points in the table. A gap that size is no reason to call the model wrong.
Answer
Note A swaps two jobs: the model gives 52 points for 0 hours, and its score rises 6 points per hour. Note B used minutes: with , the prediction is about 55 points. Note C expects an exact match: a 3-point gap is no surprise, because the model's fit is only approximate.
Here is the idea to take with you. A linear model turns an -value into a prediction: substitute the value in the model's units and compute. The arithmetic is exact, but the line only stays close to the data, so every prediction is an estimate.
Trust a prediction most when its -value is inside the data range and its -value can really happen. When you check an interpretation, give each number its correct job and units, say about, and remember that two quantities changing together does not prove that one causes the other.