{
  "format": "recallweave-deck/1",
  "title": "Least squares: fit a line and read its residuals",
  "attribution": "Original questions, distractors, explanations and transfer prompts authored for RecallWeave by HAMON contributor estate-db371a37f4c8. Mathematical background: NIST/SEMATECH e-Handbook of Statistical Methods, sections 4.1.4.1 and 4.4.3.1, https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm and https://www.itl.nist.gov/div898/handbook/pmd/section4/pmd431.htm ; OpenStax, Introductory Statistics 2e, section 12.3, https://openstax.org/books/introductory-statistics-2e/pages/12-3-the-regression-equation . All datasets are newly authored fictional examples; no reference exercises, figures or passages are included.",
  "license": "This file makes no separate reuse-license grant. Its question wording, explanations and transfer prompts are newly authored for RecallWeave. Linked references retain their own terms.",
  "concepts": [
    "Residuals and squared error",
    "The fitted line and the mean",
    "Changing data and units",
    "Interpretation limits"
  ],
  "items": [
    {
      "id": "ls-residual",
      "concept": "Residuals and squared error",
      "prerequisites": [],
      "prompt": "For the trial line y-hat = 1 + 2x, an observed point is (2, 4). What is its signed vertical residual y - y-hat?",
      "options": [
        "-1; the observed point is below the line.",
        "1; the observed point is above the line.",
        "-2; subtract the x coordinate from the slope.",
        "5; the fitted value is the residual."
      ],
      "answer": 0,
      "explanation": "At x = 2, the trial line gives y-hat = 1 + 2(2) = 5. The observed y is 4, so the residual is 4 - 5 = -1. Its sign identifies the side of the line; its magnitude is the vertical separation. The squared residual is 1.",
      "transfer": "Keep x and the trial line fixed, but change the observed y to 7. Find the new residual and squared residual."
    },
    {
      "id": "ls-sse",
      "concept": "Residuals and squared error",
      "prerequisites": [],
      "prompt": "Three points have residuals -2, 1 and 3 under a trial line. What is the sum of squared residuals, SSE?",
      "options": [
        "2",
        "14",
        "6",
        "12"
      ],
      "answer": 1,
      "explanation": "Square each residual before adding: (-2)^2 + 1^2 + 3^2 = 4 + 1 + 9 = 14. Adding the signed residuals gives 2; adding their absolute values gives 6. Neither is the squared-error criterion used here.",
      "transfer": "Reverse the sign of every residual. What happens to SSE, and why?"
    },
    {
      "id": "ls-cancellation",
      "concept": "Residuals and squared error",
      "prerequisites": [],
      "prompt": "For points (-1, 1) and (1, -1), the trial line y-hat = 0 gives residuals 1 and -1. Their sum is zero. What follows?",
      "options": [
        "The trial line must minimize SSE.",
        "Both points must lie on the trial line.",
        "Signed errors cancel, but this trial still has SSE = 2.",
        "There is no line through both points."
      ],
      "answer": 2,
      "explanation": "A zero signed sum does not force small individual errors. This trial has SSE = 1^2 + (-1)^2 = 2. The line y-hat = -x passes through both points and has SSE = 0, so the zero-sum trial is not the least-squares solution.",
      "transfer": "Write the fitted value and residual for each point under y-hat = -x. Compare the two lines' SSE."
    },
    {
      "id": "ls-vertical",
      "concept": "Residuals and squared error",
      "prerequisites": [],
      "prompt": "In this course's ordinary least-squares model y-hat = a + bx, which separation is squared for each observed point?",
      "options": [
        "The horizontal distance to the line at the same y.",
        "The shortest perpendicular distance to the line.",
        "The distance from the point to the sample mean.",
        "The vertical difference between observed y and the line's value at the same x."
      ],
      "answer": 3,
      "explanation": "The criterion is sum((y_i - a - bx_i)^2). Each x stays fixed while observed y is compared with the line's y value at that x. Perpendicular-distance fitting is a different problem and generally gives a different line.",
      "transfer": "For point (2, 5) and line y-hat = x, find the vertical residual. Why would squaring the shortest perpendicular distance represent a different criterion?"
    },
    {
      "id": "ls-exact-fit",
      "concept": "The fitted line and the mean",
      "prerequisites": [
        "Residuals and squared error"
      ],
      "prompt": "For the fictional points (-2, -1), (0, 0) and (2, 3), n = 3, sum(x) = 0, sum(y) = 2, sum(x^2) = 8 and sum(xy) = 8. Which least-squares line follows?",
      "options": [
        "y-hat = 2/3 + x",
        "y-hat = 1 + (2/3)x",
        "y-hat = x",
        "y-hat = 2 + 3x"
      ],
      "answer": 0,
      "explanation": "The slope is [n sum(xy) - sum(x)sum(y)] / [n sum(x^2) - sum(x)^2] = 24/24 = 1. The mean point is (0, 2/3), so a = mean(y) - b mean(x) = 2/3. The fitted line has residuals 1/3, -2/3 and 1/3, with SSE = 2/3.",
      "transfer": "Change only the middle point from (0, 0) to (0, 2). Recalculate the slope, intercept and SSE."
    },
    {
      "id": "ls-mean-point",
      "concept": "The fitted line and the mean",
      "prerequisites": [
        "Residuals and squared error"
      ],
      "prompt": "A dataset has mean x = 3/2 and mean y = 3, with at least two distinct x values. Which point must its least-squares line with an intercept pass through?",
      "options": [
        "(0, 0)",
        "(3/2, 3)",
        "Every observed point",
        "The point with the largest y"
      ],
      "answer": 1,
      "explanation": "For a fitted line with an intercept, a = mean(y) - b mean(x). Substituting x = mean(x) therefore gives y-hat = mean(y). Passing through the mean point does not mean the mean point was observed, or that every observation lies on the line.",
      "transfer": "Add 5 to every x while keeping every y unchanged. Where does the mean point move, and how do the slope and intercept transform?"
    },
    {
      "id": "ls-minimum-not-perfect",
      "concept": "The fitted line and the mean",
      "prerequisites": [
        "Residuals and squared error"
      ],
      "prompt": "The noisy three-point example has minimum SSE = 2/3. Which interpretation is correct?",
      "options": [
        "The computation failed because a least-squares line must have SSE = 0.",
        "A different straight line must pass through all three points.",
        "No straight line has a smaller SSE for these rows; some residuals remain nonzero.",
        "Each point has squared residual 2/3."
      ],
      "answer": 2,
      "explanation": "Least squares minimizes the total squared residual within the chosen family of lines. It does not promise an exact fit. These three points are not collinear: the two successive segment slopes are 1/2 and 3/2. Their fitted squared residuals are 1/9, 4/9 and 1/9, totaling 2/3.",
      "transfer": "Add 10 to all three y values. Can this vertical translation change the minimum SSE? Explain without refitting each row."
    },
    {
      "id": "ls-repeated-x",
      "concept": "The fitted line and the mean",
      "prerequisites": [
        "Residuals and squared error"
      ],
      "prompt": "The rows are (0, 0), (0, 2) and (2, 2). How should a least-squares fit with an intercept treat the repeated x value?",
      "options": [
        "Discard one x = 0 row because repeated x values are invalid.",
        "Return no unique line whenever any x value repeats.",
        "Force the line through both x = 0 observations.",
        "Count all three rows; the unique fit is y-hat = 1 + x/2, with SSE = 2."
      ],
      "answer": 3,
      "explanation": "Repeated x values are allowed. The two x = 0 observations contribute separate squared residuals. The distinct x = 2 gives a positive centered x sum of squares, so the line is unique. Its fitted values are 1, 1 and 2; residuals are -1, 1 and 0, and SSE is 2.",
      "transfer": "Remove the row at x = 2. What is still determined by the two remaining rows, and what is no longer uniquely determined?"
    },
    {
      "id": "ls-y-shift",
      "concept": "Changing data and units",
      "prerequisites": [
        "The fitted line and the mean"
      ],
      "prompt": "The noisy example fits y-hat = 2/3 + x with SSE = 2/3. Add 7 to every observed y while leaving all x values unchanged. What is the new fit?",
      "options": [
        "y-hat = 23/3 + x, with unchanged SSE = 2/3.",
        "y-hat = 2/3 + 8x, with unchanged SSE.",
        "y-hat = 23/3 + x, with SSE increased by 7.",
        "The original line, because shifting y does not affect a fit."
      ],
      "answer": 0,
      "explanation": "A common vertical translation raises both the mean y and fitted intercept by 7. It leaves the slope and every residual unchanged: (y_i + 7) - (a + 7 + bx_i) = y_i - a - bx_i. The new intercept is 2/3 + 7 = 23/3, and SSE stays 2/3.",
      "transfer": "Also replace each x with x' = x + 5. Express the translated fit in terms of x'."
    },
    {
      "id": "ls-x-units",
      "concept": "Changing data and units",
      "prerequisites": [
        "The fitted line and the mean"
      ],
      "prompt": "Rewrite the noisy example using x' = 2x, keeping the same y values. This changes the numerical x unit. Which equation describes the same fitted values?",
      "options": [
        "y-hat = 4/3 + 2x'",
        "y-hat = 2/3 + x'/2",
        "y-hat = 2/3 + 2x'",
        "y-hat = x'/2"
      ],
      "answer": 1,
      "explanation": "Since x = x'/2, substitute into y-hat = 2/3 + x to get y-hat = 2/3 + x'/2. The intercept stays 2/3 and the slope's numerical value halves. Every row retains the same predicted y, residual and squared residual.",
      "transfer": "What happens to SSE under this x-unit change? Explain why a changed slope number need not mean a changed fitted relationship."
    },
    {
      "id": "ls-duplicate-rows",
      "concept": "Changing data and units",
      "prerequisites": [
        "The fitted line and the mean"
      ],
      "prompt": "Make an editing copy of the noisy example in which every original row appears twice. Every row still has equal weight. What happens?",
      "options": [
        "The fitted slope doubles.",
        "The minimum SSE is halved.",
        "The coefficients stay the same and the minimum SSE doubles from 2/3 to 4/3.",
        "The fit becomes undefined because coordinates repeat."
      ],
      "answer": 2,
      "explanation": "Duplicating every row multiplies the whole objective by 2. Its minimizing coefficients therefore stay the same, while its value at that minimum doubles. Copying rows is not new independent evidence. Duplicating just one row instead would change its relative weight and can change the coefficients.",
      "transfer": "If every original row appears three times, what are the coefficients and SSE? Does copying the rows establish additional independent observations?"
    },
    {
      "id": "ls-influential-point",
      "concept": "Changing data and units",
      "prerequisites": [
        "The fitted line and the mean"
      ],
      "prompt": "The first three rows (0, 0), (1, 1) and (2, 2) fit y-hat = x exactly. Add a fourth row (10, -10). Which statement matches ordinary least squares?",
      "options": [
        "The positive trend of the first three rows forces the slope to stay positive.",
        "The fourth row is automatically rejected as an outlier.",
        "Only the intercept can change when one row is added.",
        "All rows contribute; the fit becomes y-hat = 500/251 - (289/251)x."
      ],
      "answer": 3,
      "explanation": "With the fourth row, n = 4, sum(x) = 13, sum(y) = -7, sum(x^2) = 105 and sum(xy) = -95. The slope numerator is -289 and denominator is 251; the intercept is 500/251. A point far from the other x values and far from the old line can strongly change the fit. The method does not decide that an unusual observation should be removed.",
      "transfer": "Change only the fourth row to (10, 10). Find the fit and SSE. What does this comparison show about the particular y value at the distant x?"
    },
    {
      "id": "ls-equal-x",
      "concept": "Interpretation limits",
      "prerequisites": [
        "The fitted line and the mean",
        "Changing data and units"
      ],
      "prompt": "All three x values equal 3, while the observed y values are 1, 3 and 5. What does minimizing SSE determine?",
      "options": [
        "The family a + 3b = 3, with minimum SSE = 8; a and b are not separately unique.",
        "The unique line y-hat = 3x.",
        "The unique horizontal line y-hat = 3.",
        "No minimum SSE exists."
      ],
      "answer": 0,
      "explanation": "Every row evaluates a line at the same x = 3, so only a + 3b affects the objective. This common fitted value is minimized at mean(y) = 3. Residuals -2, 0 and 2 give SSE = 8. Infinitely many coefficient pairs satisfy a + 3b = 3; a horizontal line is one member, not the uniquely identified answer.",
      "transfer": "Compare the minimizing lines (a, b) = (0, 1) and (3, 0) at x = 4. Why is a unique prediction there unsupported by these rows?"
    },
    {
      "id": "ls-extrapolation",
      "concept": "Interpretation limits",
      "prerequisites": [
        "The fitted line and the mean",
        "Changing data and units"
      ],
      "prompt": "The noisy example was observed at x = -2, 0 and 2. Its fitted line gives y-hat = 11/3 at x = 3. What should that value be called?",
      "options": [
        "An observed value because it came from a fitted line.",
        "An extrapolated line value outside the observed x range, with accuracy not established by this calculation.",
        "A guaranteed future observation.",
        "An impossible arithmetic result."
      ],
      "answer": 1,
      "explanation": "Substitution into 2/3 + x gives 11/3, so the arithmetic is defined. However, x = 3 lies outside the observed range [-2, 2]. Extending the fitted line beyond that range adds a modeling assumption that these observations do not establish. Being inside the range would not by itself guarantee accuracy either.",
      "transfer": "Evaluate the same line at x = 1. Classify its location relative to the observed range and explain what the calculation still cannot guarantee."
    },
    {
      "id": "ls-causation",
      "concept": "Interpretation limits",
      "prerequisites": [
        "The fitted line and the mean",
        "Changing data and units"
      ],
      "prompt": "Four fictional observational pairs lie exactly on y = 1 + 2x, giving SSE = 0. What can the fit alone establish about changing x to cause a change in y?",
      "options": [
        "Changing x must cause twice as much change in y.",
        "A zero SSE proves that no other variables matter.",
        "It describes these recorded pairs; a causal effect is not established by the fit alone.",
        "The fitted slope has no mathematical meaning."
      ],
      "answer": 2,
      "explanation": "The coefficients and zero residuals describe the supplied observations. They do not specify how the observations were generated or what would happen under an intervention. A shared cause, selection process or other explanation can produce an association. A mathematical fit and a causal claim require different evidence.",
      "transfer": "Describe one possible reason that two observed quantities could follow a line without one causing the other. What additional study information would help evaluate a causal claim?"
    },
    {
      "id": "ls-curved-pattern",
      "concept": "Interpretation limits",
      "prerequisites": [
        "The fitted line and the mean",
        "Changing data and units"
      ],
      "prompt": "For (-2, 4), (-1, 1), (0, 0), (1, 1) and (2, 4), the best straight line is y-hat = 2. Its residuals are 2, -1, -2, -1 and 2. Which interpretation is justified?",
      "options": [
        "The method failed because the fitted slope is zero.",
        "Zero total signed residual means the residual pattern can be ignored.",
        "The fit proves that y is unrelated to x in every possible form.",
        "The line minimizes SSE among lines, while the curved residual pattern remains visible."
      ],
      "answer": 3,
      "explanation": "The centered x-y sum is zero, giving slope 0 and intercept mean(y) = 2. The squared residuals sum to 14. This is the best straight line for these rows, but the residuals form a clear curved pattern. Choosing a line as the candidate family does not make a nonlinear pattern disappear.",
      "transfer": "The curve y = x^2 passes through these authored points. Compare its in-sample squared residuals with the line's, and explain why that comparison still does not prove a causal mechanism."
    }
  ]
}
