Skip to main content

Fitting and Interpreting Lines

Busier hours may come with longer waits. How can we tell whether a line is a useful description? We will read a scatter plot, calculate residuals, and distinguish association from a causal claim.

  • Residual: An observed output minus the output predicted by a fitted line.

Core ideas​

Scatter plots and fitted lines​

Plot pairs of numerical values and look for a trend. A fitted line predicts the response at a given input.

Residuals​

Subtract the predicted value from the observed value. If the model predicts 88 and the observed value is 1010, the residual is 22. A visible pattern in residuals suggests the line misses something systematic.

Correlation and causation​

Correlation summarizes the direction and strength of linear association. Two variables rising together can reflect a third influence.

Essential example​

Use illustrative pairs of arrival count and wait time. The input xx counts arrivals per hour, and yy is wait time in minutes. Consider the proposed line y^=2+x/2\hat y=2+x/2, where y^\hat y is a modeled wait.

Arrivals per hourObserved wait in the examplePredicted waitResidual
22443311
443344−1-1
664455−1-1
88776611

Plot arrivals horizontally and waits vertically. A residual is y−y^y-\hat y, the signed vertical difference between a point and the line. The point (8,7)(8,7) lies one minute above the proposed line.

Four wait-time observations, a proposed straight line, and signed vertical residuals
Residuals describe the difference between the example observations and the line's predictions.

Inspect the fit​

A least-squares line minimizes the sum of squared vertical residuals for the given inputs. The example uses a proposed line to show the calculation. Its residuals are positive at the ends and negative in the middle. With more observations, a persistent curved pattern would suggest checking a different model. Predictions far outside the observed input range rely on a stronger extrapolation assumption.

Interpret correlation​

A correlation coefficient near 11 or −1-1 indicates a strong linear association, with its sign showing direction. A value near zero can occur even when a clear curved relationship exists. Association also leaves room for other explanations. Staffing level could affect both which hours are busy and the waits observed, so the scatter plot alone cannot isolate a cause.

Compare two predictions at one input​

For six arrivals per hour, the proposed line gives five minutes and the example observation is four. The residual is −1-1 minute. A second line y^=1+x/2\hat y=1+x/2 predicts four minutes there, but that improvement at one point does not establish a better overall fit. Across the four points its residuals are 2,0,0,22,0,0,2 and its squared residuals sum to 88. The first line's four squared residuals sum to 44. Comparing all squared errors gives a concrete reason to favor the first of these two models.

Keep and continue​

Keep the habit of checking a graph, its formula, and the scope of its predictions. Algebra II develops the same habit with transformations and new families of functions.

Course outline

Previous: Comparing Distributions

Next course: Algebra II