Linear Regression by Least Squares · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.
En anglais

Drawing the line that misses least

Computing · Machine Learning · ages 19-20
Name ______________________   Date ____________
  1. Which calculation defines a residual?

    • Predicted y minus observed y
    • Observed y minus predicted y
    • The unsigned distance between y and its prediction
  2. For ordinary unweighted least squares with an intercept and varying x values, the fitted line passes through (mean x, mean y).

    Circle one:   True   False

  3. A fitted model is s hat = 52 + 6.4h, with h in study hours and s in exam points. What does 6.4 mean?

    • Predicted score rises 6.4 points per additional hour
    • The predicted score at zero study hours is 6.4 points
    • Every student's observed score rises exactly 6.4 points
  4. Two candidate lines fit the same two observations. Fit A has residuals -2 and 2. Fit B has residuals -1 and 3. Which has the smaller least-squares objective?

    • Fit B, because its signed residual total is 2
    • Fit A, because its squared residual total is 8
    • Both fits, because each has two residuals to compare
    • Neither fit, because negative residuals cannot be squared
  5. A two-feature model is y hat = 10 + 2*x1 - 3*x2. A row has x1 = 4, x2 = 2 and observed y = 15. What are its prediction and residual?

    • Prediction 18; residual -3
    • Prediction 24; residual -9
    • Prediction 12; residual 3
    • Prediction 12; residual -3
  6. Four practice sessions have (hours, points) pairs (1,1), (2,2), (3,2), (4,5). Find the slope of the ordinary unweighted least-squares line with an intercept. Give a decimal.

    Answer: ______________

  7. A house-price model uses size (m^2) and age (years). Their coefficients are 180 and -1200. Which gives the predicted changes when each feature rises by one, holding the other fixed?

    • Size: +$180 per m^2; age: -$1200 per year
    • Size: -$1200 per m^2; age: +$180 per year
    • Size: +$180 per year; age: -$1200 per m^2
  8. A two-feature least-squares fit has equations 3b0+b1+b2=8, b0+b1=3 and b0+b2=4, with a unique solution. A report claims b0=2, b1=1 and b2=2 are the fitted coefficients. Is the report correct?

    Circle one:   True   False

  9. Residuals stay centered near zero but form a wider fan as fitted values grow. What should you do before relying on uncertainty estimates that assume constant error spread?

    • Set the fitted slope to zero so every prediction has exactly the same value
    • Keep constant-spread estimates because a zero center proves equal spread
    • Investigate the changing spread and use an uncertainty method that allows it
  10. An observational study fits earnings against hours worked, with slope $12 per hour. A friend says this proves that working another hour causes earnings to rise by $12. What is the problem?

    • Dollars per hour cannot be a valid slope unit for an earnings model
    • It treats an association as proof of cause
    • The intercept always measures the earnings caused by another hour
LightMySky · lightmysky.comW1-mt_QRRkpIrwWs-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Drawing the line that misses least W1-mt_QRRkpIrwWs-s1

  1. Observed y minus predicted y · A residual is observed minus predicted. Its sign distinguishes an observation above the prediction from one below it.
  2. True · The intercept is a = mean y - b*mean x. Substituting mean x into a + bx therefore gives mean y.
  3. Predicted score rises 6.4 points per additional hour · 6.4 multiplies hours, so it is the slope: 6.4 predicted points per additional hour. The intercept is 52 points.
  4. Fit A, because its squared residual total is 8 · Fit A has total (-2)^2 + 2^2 = 8. Fit B has total (-1)^2 + 3^2 = 10. Least squares prefers the smaller squared total.
  5. Prediction 12; residual 3 · The prediction is 10 + 2(4) - 3(2) = 12. Residual means observed minus predicted, so 15 - 12 = 3.
  6. 1.2 · Both means are 2.5. The products of paired deviations sum to 6, and the squared deviations in hours sum to 5. The slope is 6/5 = 1.2 points per hour.
  7. Size: +$180 per m^2; age: -$1200 per year · At fixed age, one more m^2 adds $180 to predicted price. At fixed size, one more year subtracts $1200. These are model predictions, not causal guarantees.
  8. False · The claimed coefficients fail the first equation: 3(2)+1+2=9, not 8. Solving the equations gives b0=1, b1=2 and b2=3.
  9. Investigate the changing spread and use an uncertainty method that allows it · The fan suggests changing error variability. It does not by itself show that the fitted mean relationship is curved.
  10. It treats an association as proof of cause · The fitted slope describes predicted change in the observational data. The coefficient alone does not establish what changing hours would cause.
Worksheet · LightMySky