Do Now The equation used to calculate Cab Fare is y = 0.75x +
2.5 where y is the cost and x is the number of miles traveled.
1. What is the slope in this equation? What does it represent in
this context?
2. What is the y-intercept in this equation? What does it represent
in this context?
3. What is the cost for a cab ride where you travel 3.5 miles?
4. If your cab ride costs $17.30, how far did you travel?
Slide 8 - 2
Fat Versus Protein: An Example
The following is a scatterplot of total fat versus protein for 30 items on the Burger King menu:
Slide 8 - 3
The Linear Model The correlation in this example is 0.83.
It says “There seems to be a linear association between these two variables,” but it doesn’t tell what that association is.
We can say more about the linear relationship between two quantitative variables with a model.
A model simplifies reality to help us understand underlying patterns and relationships.
Slide 8 - 4
The Linear Model (cont.)
The linear model is just an equation of a straight line through the data. o The points in the scatterplot don’t all
line up, but a straight line can summarize the general pattern with only a couple of parameters.
o The linear model can help us understand how the values are associated.
Slide 8 - 5
Residuals The model won’t be perfect, regardless of
the line we draw. Some points will be above the line and
some will be below. The estimate made from a model is the
predicted value (denoted as ).y
Slide 8 - 6
Residuals (cont.) The difference between the observed
value and its associated predicted value is called the residual.
To find the residuals, we always subtract the predicted value from the observed one:residual observed predicted y y
Slide 8 - 7
Residuals (cont.) A negative residual means the predicted value’s
too big (an overestimate). A positive residual means the predicted value’s
too small (an underestimate). In the figure, the estimated fat of the BK Broiler
chicken sandwich is 36 g, while the true value of fat is 25 g, so the residual is –11 g of fat.
Residuals
From the Carnegie Foundation math.mtsac.edu/statway/lesson_3.3.1_version1.5A
Analyzing Residuals
Determines the effectiveness of the regression model
Residual (or error)
Observed y - predicted y
Example: Calculate ResidualTracking Cell Phone Use over 10 days
Total Time (minutes)
Total Distance (miles
Predicted Total Distance
Residuals(observed – predicted)
32 51 54.4 -3.4
19 30 31.9
28 47
36 56
17 27
23 35
41 65
22 41
37 73
28 54
1.73 0.96y x
Example: Calculate ResidualTracking Cell Phone Use over 10 days
Total Time (minutes)
Total Distance (miles
Predicted Total Distance
Residuals(observed – predicted)
32 51 54.4 -3.4
19 30 31.9 -1.928 47 47.5 -0.536 56 61.3 -5.317 27 28.5 -1.523 35 38.8 -3.841 65 70.0 -522 41 37.1 3.937 73 63.1 9.928 54 47.5 6.5
1.73 0.96y x
Residual Plots
A scatterplot of Residuals vs. X
Good fit or not?
15 20 25 30 35 40 45
-8
-6
-4
-2
0
2
4
6
8
10
12
Residual Plots Determine
If it the model is appropriate, then the plot will have a random scatter.
If another model is necessary, the plot will have a pattern. Pattern = Problem
Example of Random Scatter
Good fit or not?
15 20 25 30 35 40 45
-8
-6
-4
-2
0
2
4
6
8
10
12
ExamplesDetermine, just by visual inspection, if
the linear model is appropriate or inappropriate.
Linear model appropriate or inappropriate?
The only way to know is to see the residual plot.
1. Does their appear to be a pattern in the residual plot?Yes, quadratic.
2. Does this support your original guess?
You must now see that a linear model does NOT fit this data.
Linear model appropriate or inappropriate?
The only way to know is to see the residual plot.
1. Does their appear to be a pattern in the residual plot?Yes, it fans out as
x increases.2. Does this support your original guess?
You must now see that a linear model does NOT fit this data.
Linear model appropriate or inappropriate?
The only way to know is to see the residual plot.
1. Does their appear to be a pattern in the residual plot?Yes, it looks quadratic.
2. Does this support your original guess?
This was very tricky. The scale was very small. You must now see that a linear model does NOT fit this data.
Linear model appropriate or inappropriate?
The only way to know is to see the residual plot.
1. Does their appear to be a pattern in the residual plot?Yes, it seems decrease as x increases.2. Does this
support your original guess?This was tricky. You must now see that a linear model does NOT fit this data.
Guided Practice
Calculating Airfare
HomeworkWorksheet