Print this page and work through it on paper. Revealed answers are never printed, so you can check one question and still print a clean sheet.

  1. Show the solution to question 1

    (a) Centre, then sum. and . The deviations are and , so

    Hence

    Sanity check: , as the theorem Correlation lies between and requires, and it is strictly less than because the points are not collinear — the slope from to is , while from to it is .

    (b) Invoke invariance; recompute nothing. By the proposition Correlation is invariant under increasing linear rescaling, if and then . Here and , so and

    The shifts and do nothing, because centring removes them; the factor scales and equally and cancels; only the sign of survives.

    Confirmation: centring gives and , so , and . Then

    (c) A perfect relationship with zero correlation. and . The -deviations are , and since the -deviations are the values themselves:

    So exactly, even though is determined by without any noise at all. (For the record and , both positive, so is well defined.)

    The lesson: measures linear association only. Every product on the left of is cancelled by its mirror image on the right, because the parabola rises on one side exactly as it falls on the other. A correlation of zero is compatible with a deterministic relationship, which is why a correlation quoted without a scatterplot has not had its meaning checked.

  2. Show the solution to question 2

    (a) The least-squares estimates. By the theorem The least-squares estimates, the minimiser of is

    The line is . At it gives , so it passes through — which is exactly what the first normal equation says.

    (b) Fitted values and residuals.

    so the residuals are

    Sum: . Weighted sum: . Both hold by the proposition Two properties of least-squares residuals — they are the two normal equations rewritten, so they hold for every data set, not just this one.

    (c) Slope equals correlation in standard units. , since both standard deviations carry the same divisor , which cancels. So

    This is the corollary Slope, correlation and the regression effect. Read it in standard units: a point at is predicted at , that is standard deviations above — closer to its mean, in relative terms, than the predictor was to its own. With this close to the pull is slight; with the prediction would sit only half a standard deviation up. Nothing is acting on anything: regression to the mean is what imperfect correlation looks like when you predict.

  3. Show the solution to question 3

    (a) The normal equations. is a differentiable function of and the minimum is attained (it is a positive-definite quadratic when , as the theorem The least-squares estimates shows), so both partial derivatives vanish there:

    Dividing by gives and .

    (b) Fitted values are a combination of and . Since ,

    Geometrically: the residual vector is orthogonal to the column of ones and to the column of 's, hence to everything in their span, and the fitted vector lies in that span.

    (c) Residuals are uncorrelated with the predictor. By (a) the mean residual is . Therefore

    If the residuals are not all zero then , and by hypothesis, so .

    Consequence: a plot of against can never show a linear trend, whatever the data — a least-squares line through that plot would have slope . That is a property of how the line was chosen, not evidence about the data. What the plot can show is anything non-linear: curvature, or a spread that changes with . Those are the two things the fitting procedure did not remove, and they are exactly what the residual plot is used to diagnose.

  4. Show the solution to question 4

    (a) The three sums of squares. By the proposition For simple regression, R-squared is r squared, ; as a check, as well. Directly from the residuals,

    With we get .

    The cross term vanishes because , so it equals by the proposition Two properties of least-squares residuals — this is the theorem Decomposition of variation in regression.

    (b) Coefficient of determination.

    The line accounts for of the variation in .

    (c) Residual standard error. Two parameters were estimated, so the divisor is :

    estimates , the standard deviation of an observation about the true line — roughly, how far a typical point sits from the fitted line in the units of . Against that is a small scatter, consistent with the high .

    But is computed from three sums of squares and is blind to the pattern of the residuals. Anscombe's quartet has four data sets with identical , identical fitted line and identical , of which one is curved, one is driven by a single high-leverage point and one contains an outlier. Here the residuals alternate in sign with no trend, which is reassuring — but that reassurance came from looking at the residuals, not from the .

  5. Show the solution to question 5

    (a) Fit the line. and . Deviations: and . Then

    so and . The fitted line is .

    (b) Residuals and the sums of squares. Fitted values at are , so the residuals are

    Check: and .

    and , with . Hence

    (c) The two pictures. Scatterplot. Mark the five points ; they rise ever more steeply. Draw the line through and ; it passes through the point of means . The line lies below the data at both ends — at the point is above it, at it is above — and above the data in the middle, by at . The line crosses the curve where , that is at and ; mark those two crossings.

    Residual plot. Horizontal axis: fitted value, from to ; vertical axis: residual, from to , with a dashed line at . Plot . The points trace a clear U: positive at both ends, negative in the middle, symmetric about the centre. This is not a random band about zero.

    Which condition fails. Linearity. is , not , so the line is systematically too low at the ends and too high in the middle, and the residuals inherit that curvature. (Independence, normality and equal variance are not what this plot indicts — there is no noise at all.)

    Why did not see it. depends on the residuals only through the single number . Reorder the same five residuals to and is unchanged, though the U has vanished. A fit accounting for of the variation sounds excellent, and the line is a decent summary of the trend — but the model is wrong in a way that would ruin every prediction at the ends, and only the residual plot says so. That is the pitfall of Anscombe's quartet made concrete.

  6. Show the solution to question 6

    (a) The slope is linear in the responses. Since , the constant drops out of the covariance sum:

    so . For the identities:

    (b) Mean and variance. Linearity of the model and give , so by linearity of expectation

    For the variance, independence kills every cross term, so the variance of the sum is the sum of the variances: . Equal variance makes every , hence

    Normality was never used — this is the unbiasedness and variance part of the theorem Gauss–Markov, and the corollary Precision of the slope. Normality enters only when the distribution is needed for intervals.

    (c) Two designs. Under A, with deviations , so and . Under B, with every deviation , so and .

    Design B is more precise, by the factor : pushing the 's to the ends of the interval maximises , which is the denominator in the variance. This is the remark How to make a slope precise — with a trusted linear model, half the points at each extreme is optimal.

    What B cannot do is check linearity. With only two distinct values there are only two group means, and a line has two parameters, so the least-squares line passes exactly through both means. Every residual is then a within-group deviation; the residual-versus-fitted plot has two vertical stacks and no capacity to bend. Had the true relationship been curved between and , design B would report a perfect straight line and could never know otherwise. Design A gives up some precision to buy the ability to see the U of the previous question.

  7. Show the solution to question 7

    (a) Standard error and test. By the corollary Precision of the slope,

    By the theorem Sampling distribution of the slope, under the statistic follows . Here

    Since , reject : the predictor carries linear information about the response, even with only two degrees of freedom to spare.

    (b) Interval for the slope. , so the interval is approximately . It excludes , in agreement with (a), and it is wide: two degrees of freedom make more than twice the familiar .

    (c) Two intervals at the centre. , and , so by the theorem Confidence and prediction intervals:

    Mean response. . Margin ; interval .

    New observation. . Margin ; interval .

    The difference is the extra under the root: , the being the new observation's own noise , independent of everything used to fit. The ratio of half-widths is

    and it would be even larger for bigger , since the numerator has a floor at while the denominator tends to .

    (d) The check. and , so . From (a), . The two tests are the same test: the model comparison between the fitted line and the intercept-only model, with .

  8. Show the solution to question 8

    (a) Four steps, three flaws.

    Step 1 confuses with a test. is a descriptive ratio of sums of squares; it has no sampling distribution attached and says nothing about whether is compatible with the data. The theorem Sampling distribution of the slope is what settles that, and it needs : on tiny data a large can coexist with an insignificant slope. As it happens the test here gives against and the slope is significant — but that conclusion comes from the test, not from the . The number is right; the reasoning is not.

    Step 2 uses the wrong interval. The formula is the standard error of as an estimate of the mean response . A single new observation has its own error , and by the theorem Confidence and prediction intervals the variance of is — the is missing. The interval quoted is a confidence interval for the mean masquerading as a prediction interval, and it is far too narrow.

    Step 3 is wrong for the interval it claims to be about. The mean-response interval does shrink to zero width, because . The prediction interval does not: its half-width tends to , the floor set by the noise in the observation being predicted, which no amount of data about other observations can reduce. A future observation can never be predicted exactly by a model with .

    Step 4 is correct in premise and wrong in conclusion. The line does pass through the point of means — but that is exactly why the width varies: the line pivots about , so slope error has no effect at and a growing effect away from it. The term is zero at and positive everywhere else; both bands are narrowest at and flare outward.

    (b) The correct intervals.

    New observation at . and

    so the interval is , that is — more than twice as wide as the student's.

    Mean response at . , and , so

    giving , that is . Compare the half-width at the centre: moving three units from has widened the mean-response interval by the factor , which is Step 4 refuted numerically.

  9. Show the solution to question 9

    (a) The normal equations by hand. With , , and ,

    The determinant is , and . (It is in general, the computational formula for the variance.) So

    and by the theorem The normal equations and the least-squares solution,

    (b) The covariance matrix. By the theorem Mean and variance of the coefficient estimates, , so

    and the check: . (This is the mean-response variance at , since .) The off-diagonal entry gives , which is : with a positive , overestimating the slope forces the intercept down, because the line must still pass through the point of means.

    (c) Leverages and their sum. For row ,

    which is the familiar bracket from the confidence-interval formula. Evaluating: at and , ; at and , . Sum: . The end points carry more leverage — the line is more strongly pulled by them.

    Proof that . Using the cyclic property with and ,

    Geometrically, by the theorem Least squares is orthogonal projection, projects onto a -dimensional subspace, and the trace of a projection is the dimension of its range. The total leverage is fixed by the model; the data decide only how it is shared out.

  10. Show the solution to question 10

    (a) The Gram matrix and its determinant.

    with determinant , using . Since , the determinant is non-zero exactly when . By Cauchy–Schwarz, , so always; hence invertible .

    The equality case of Cauchy–Schwarz is proportionality, , which is precisely failure of full column rank. So this is the theorem The normal equations and the least-squares solution in two dimensions: means the two columns carry the same information and there is no unique fit.

    (b) Invert and read off the variance. For a matrix,

    By the theorem Mean and variance of the coefficient estimates, , so

    With this is , the simple-regression variance; every non-zero inflates it.

    (c) The auxiliary regression. Regressing on through the origin minimises , a quadratic in with minimum at . Substituting,

    Because is centred its total sum of squares is , so

    and . Then (b) reads

    which is the theorem Variance inflation with predictors, proved rather than quoted. Note also that is the squared length of the part of not explained by , and : the coefficient is estimated from the leftover part alone.

    (d) Numbers, and the limit. With , . Standard errors scale as , so is times what it would be with an uncorrelated predictor. Variance falls as at fixed spread, so compensating would take times as many observations.

    As the variance of tends to infinity: the two coefficients become individually meaningless, typically large and of opposite sign. But two things do not break. throughout, by the same theorem — inflation is variance, never bias. And the fitted values depend only on the column space of , which is the same plane for every ; so prediction within the range of the data is unaffected. The data know what the pair predicts; they cannot say which predictor deserves the credit.

  11. Show the solution to question 11

    (a) The numbers the analyst did not compute.

    Overall . The reduced model is intercept-only, with and ; the full model has , so . By the theorem Nested model comparison,

    against . Overwhelmingly significant: the pair of predictors explains far more than chance would.

    Nested for dropping . , and indeed , as requires. (Likewise for the refit, . )

    Adjusted . With :

    The two are equal — in both models. This is the proposition Adjusted R-squared penalises useless predictors sitting exactly on its boundary: adding a predictor raises if and only if , and is the break-even case.

    (b) The flaws.

    Step 2: insignificant 's do not mean irrelevant predictors. With the predictors are nearly interchangeable, and by the theorem Variance inflation each standard error is times what it would be for an uncorrelated predictor. The data cannot apportion credit between and , so each coefficient, holding the other fixed, is poorly determined. The joint test in (a) says the pair carries a great deal of information, . This is the puzzle in the remark What multicollinearity does and does not break: a highly significant with no significant coefficient is the signature of collinearity, not of an artefact. The is real.

    Step 3: inflation is variance, not bias. The theorem Mean and variance of the coefficient estimates gives whatever the correlation among predictors; Gauss–Markov unbiasedness is untouched. What a VIF of says is — the estimate is right on average and imprecise, which is the opposite of “cannot be trusted”. Nor is the factor applied to the estimate: it multiplies the variance, and the standard error by .

    Step 4 contains three errors. First, the -value from the refit is not valid: the model was chosen by looking at these same data, and a coefficient that survived a selection step is biased away from zero because it survived — the pitfall on stepwise selection. Since and are near-duplicates, dropping instead would have produced an equally impressive for ; the choice was arbitrary and the “” describes the selection, not . Second, the adjusted claim is simply false — (a) shows the two values are equal, so the criterion is indifferent between the models. Third, “the effect of ” is causal language for what is a partial association; nothing in the fit licenses it (the pitfall on coefficients and causes).

    What should have been concluded. The two predictors jointly predict well (, ) and the data cannot say which of them matters. If the goal is prediction inside the observed range, keep both — the fitted values are unaffected by collinearity. If the goal is interpretation, either combine the two into one index, or collect data in which they vary separately, and report any selection that was done as exploratory, with standard errors assessed on data not used to select.

  12. Show the solution to question 12

    (a) The other regression. Minimising horizontal rather than vertical squared distances, the roles of and swap:

    so . Solving for instead gives , with slope . The two are different lines; each is optimal for its own direction of error and neither can be obtained from the other.

    Proof of the product. . Here . The inverse of the first line has slope , and the second line has slope ; they agree exactly when , that is when the points are collinear (the theorem Correlation lies between and ). Otherwise the -on- line is always the flatter of the two when drawn in the plane — regression to the mean in both directions at once.

    (b) The cost of leaving the data. By the theorem Confidence and prediction intervals, with .

    At : .

    At : , so and

    Ratio: . Twelve units beyond the last observation, the interval for the mean is nearly seven times as wide as at the centre, because the fitted line pivots about and slope error is amplified by the lever arm .

    Even so it understates the uncertainty, because the formula is derived assuming the model holds at : that is still out there. The four observations, all in , contain no information about that. A relationship linear over may bend, saturate or reverse beyond it — the parabola of an earlier question fits a line with and then departs from it without limit — and no interval built from and can price a failure of the model's form. The widening is the part of the risk the mathematics can see; the rest is invisible to it.

    (c) Why a coefficient is not an effect. The slope describes the conditional mean of given in these data. Three mechanisms produce such a slope with no causal path from to :

    Confounding — a third variable drives both and , so they move together without either moving the other.

    Reverse causation — drives . The algebra is symmetric: (a) shows the regression of on describes the same four points equally well, and nothing in the fit says which way any influence runs.

    Selection — the four points were included because of their values of both variables, creating an association among those observed that need not exist in the population.

    A residual plot can detect none of them. It checks the LINE conditions — curvature, changing spread, gross non-normality — which concern how well a line describes the conditional mean. All three mechanisms are perfectly compatible with a clean linear conditional mean and an immaculate residual plot. What licenses a causal reading is the design of the study, not the diagnostics of the fit.

Full solutions sheet →