Math ClubMath Club
v1 · padrão canônico

Lesson 106 — Multiple regression

Model with p predictors, OLS matrix solution, adjusted R², multicollinearity, variable selection and assumption diagnostics.

Used in: Stochastik LK alemão (Klasse 12) · H2 Mathematics Singapura (§15) · econometria introdutória

β^=(XTX)1XTy\hat{\boldsymbol\beta} = (X^TX)^{-1}X^T\mathbf{y}

In multiple regression with pp predictors, the OLS estimator is the matrix solution to the normal equations. Each coefficient β^j\hat\beta_j measures the effect of XjX_j on YY holding the other predictors fixed — the so-called partial effect.

Choose your door

Rigorous notation, full derivation, hypotheses

Rigorous definition

Multiple linear regression model

"The multiple regression model is y=β0+β1x1+β2x2++βkxk+εy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_k x_k + \varepsilon. The coefficient βi\beta_i measures the expected change in yy per unit change in xix_i when all other predictors are held constant." — OpenIntro Statistics, §8.1, p. 362

Fit metrics

Inference

Design matrix X (n=4, p=2)1 X₁₁ X₁₂1 X₂₁ X₂₂1 X₃₁ X₃₂1 X₄₁ X₄₂n×(p+1)×β₀β₁β₂(p+1)×1=Ŷ₁Ŷ₂Ŷ₃Ŷ₄n×1+ε₁ε₂ε₃ε₄n×1

Matrix representation of the model: Y=Xβ+ε\mathbf{Y} = X\boldsymbol\beta + \boldsymbol\varepsilon. The first column of 1s in XX generates the intercept β0\beta_0.

Worked examples

Exercise list

42 exercises · 10 with worked solution (25%)

Application 18Understanding 7Modeling 8Challenge 6Proof 3
  1. Ex. 106.1Application

    Regression: Y^=50+3.2X1+28X2+5.5X3\hat Y = 50 + 3.2X_1 + 28X_2 + 5.5X_3 (price in R$ thousands, area in m², bedrooms, floor). Interpret each coefficient.

    Select the correct option
    Select an option first
    Show solution
    See the reference indicated in fonte for detailed solution.
  2. Ex. 106.2ApplicationAnswer key

    Using Y^=50+3.2X1+28X2+5.5X3\hat Y = 50 + 3.2X_1 + 28X_2 + 5.5X_3, calculate the prediction and residual for an apartment of 80 m², 3 bedrooms, 5th floor with observed price of R$ 450 thousand.

    Select the correct option
    Select an option first
    Show solution
    See the reference indicated in fonte for detailed solution.
    Show step-by-step (with the why)
    See the reference indicated in fonte for step-by-step.
  3. Ex. 106.3Application

    n=40n=40, p=3p=3 predictors, SST=2000SST=2000, SSE=800SSE=800. Calculate R2R^2 and Rˉ2\bar R^2.

    Select the correct option
    Select an option first
    Show solution
    Rˉ2=1SSE/(np1)SST/(n1)=1800/362000/39=122.251.3=10.433=0.567\bar R^2 = 1 - \frac{SSE/(n-p-1)}{SST/(n-1)} = 1 - \frac{800/36}{2000/39} = 1 - \frac{22.2}{51.3} = 1 - 0.433 = 0.567. Compare with R2=1800/2000=0.60R^2 = 1-800/2000 = 0.60: the penalized fit drops slightly.
  4. Ex. 106.4ApplicationAnswer key

    n=50n=50. Three models with p=1,3,6p=1,3,6 predictors and SSE/SST=0.40;0.35;0.32SSE/SST = 0.40; 0.35; 0.32. Calculate adjusted Rˉ2\bar R^2 for each and identify the preferable one.

    Select the correct option
    Select an option first
    Show solution
    M1: Rˉ12=1(10.60)×(n1)/(n2)\bar R^2_1 = 1-(1-0.60)\times(n-1)/(n-2). With n=50n=50: Rˉ12=10.40×49/48=10.408=0.592\bar R^2_1 = 1-0.40\times49/48 = 1-0.408 = 0.592. M2: Rˉ22=10.35×49/46=10.373=0.627\bar R^2_2 = 1-0.35\times49/46 = 1-0.373 = 0.627. M3: Rˉ32=10.32×49/43=10.365=0.635\bar R^2_3 = 1-0.32\times49/43 = 1-0.365 = 0.635. M3 has higher Rˉ2\bar R^2: preferable among the three.
  5. Ex. 106.5ApplicationAnswer key

    n=60n=60, p=4p=4, SST=3600SST=3600, R2=0.72R^2=0.72. Build the ANOVA table and test the model at 5% level.

    Select the correct option
    Select an option first
    Show solution
    SSR=0.72×3600=2592SSR = 0.72 \times 3600 = 2592; SSE=36002592=1008SSE = 3600 - 2592 = 1008; MSR=2592/4=648MSR = 2592/4 = 648; MSE=1008/55=18.3MSE = 1008/55 = 18.3; F=648/18.3=35.4F = 648/18.3 = 35.4. Critical value F4,55;0.052.54F_{4,55;\,0.05} \approx 2.54: reject H0H_0.
  6. Ex. 106.6ApplicationAnswer key

    Auxiliary regressions for 3 predictors: R12=0.30R_1^2=0.30, R22=0.70R_2^2=0.70, R32=0.92R_3^2=0.92. Calculate the VIFs and identify severe multicollinearity.

    Select the correct option
    Select an option first
    Show solution
    VIFj=1/(1Rj2)VIF_j = 1/(1-R_j^2). VIF1=1/(10.30)=1.43VIF_1 = 1/(1-0.30) = 1.43; VIF2=1/(10.70)=3.33VIF_2 = 1/(1-0.70) = 3.33; VIF3=1/(10.92)=12.5VIF_3 = 1/(1-0.92) = 12.5. VIF3>10VIF_3 > 10: predictor 3 exhibits severe multicollinearity.
  7. Ex. 106.7Application

    Regression of ENEM score on family income (X1X_1) and participation in tutoring program (DD: 1=yes, 0=no): Y^=480+8.2X1+12.4D\hat Y = 480 + 8.2X_1 + 12.4D, n=200n=200. Interpret β^D=12.4\hat\beta_D = 12.4.

    Select the correct option
    Select an option first
    Show solution
    The dummy coefficient indicates that participating in the program is associated with 12.4 more points in the score, controlling for family income. Causal effect requires appropriate experimental design.
    Show step-by-step (with the why)
    1. Model with dummy: Y^=β^0+β^1X1+β^2D\hat Y = \hat\beta_0 + \hat\beta_1 X_1 + \hat\beta_2 D where D=1D=1 if treated, D=0D=0 if control.
    2. β^2\hat\beta_2 is the average difference in YY between treated and control, controlling for X1X_1.
    3. With β^2=12.4\hat\beta_2 = 12.4: the program is associated with an average increase of 12.4 points in the score, given the same level of family income.
    4. Observation: this is still not causal effect — requires randomization or quasi-experimental design.
  8. Ex. 106.8ApplicationAnswer key

    n=50n=50, p=3p=3, β^1=2.8\hat\beta_1=2.8, SE(β^1)=0.7SE(\hat\beta_1)=0.7. Test H0:β1=0H_0:\beta_1=0 at 5% level (two-tailed).

    Select the correct option
    Select an option first
    Show solution
    t-test: T=2.8/0.7=4.0T = 2.8/0.7 = 4.0. With df=np1=5031=46df = n-p-1 = 50-3-1 = 46, t46;0.0252.013t_{46;\,0.025} \approx 2.013. Since T=4.0>2.013|T| = 4.0 > 2.013, we reject H0:β1=0H_0: \beta_1 = 0. The predictor X1X_1 is significant at 5% level.
  9. Ex. 106.9Application

    n=50n=50, p=3p=3, β^2=5.2\hat\beta_2=5.2, SE(β^2)=1.8SE(\hat\beta_2)=1.8. Build 95% CI for β2\beta_2. Use t46;0.0252.013t_{46;\,0.025}\approx 2.013.

    Select the correct option
    Select an option first
    Show solution
    95% CI for β2\beta_2: β^2±t46;0.025×SE(β^2)=5.2±2.013×1.8=5.2±3.62=(1.58;  8.82)\hat\beta_2 \pm t_{46;\,0.025} \times SE(\hat\beta_2) = 5.2 \pm 2.013 \times 1.8 = 5.2 \pm 3.62 = (1.58;\; 8.82). The CI does not contain 0: β2\beta_2 is significant at 5% level.
  10. Ex. 106.10Application

    Four of the five residuals from a regression are: 3.23.2; 1.5-1.5; 0.8-0.8; 2.12.1. What is the fifth residual?

    Select the correct option
    Select an option first
    Show solution
    Sum of residuals is always zero in any regression with intercept: ei=0\sum e_i = 0. The sum of four known residuals is 3.2+(1.5)+(0.8)+2.1=3.03.2 + (-1.5) + (-0.8) + 2.1 = 3.0. Therefore the fifth residual is e5=3.0e_5 = -3.0. Verification: 3.21.50.8+2.13.0=03.2 - 1.5 - 0.8 + 2.1 - 3.0 = 0. Correct.
  11. Ex. 106.11Understanding

    Which statement about R2R^2 and adjusted R2R^2 is CORRECT?

    Select the correct option
    Select an option first
    Show solution
    R2R^2 never falls when adding predictors (mathematical property of OLS). Rˉ2\bar R^2 penalizes for number of predictors and can fall when the added predictor is weak. That is why Rˉ2\bar R^2 is the appropriate criterion for comparing models with different numbers of predictors.
  12. Ex. 106.12Understanding

    What is the main practical effect of multicollinearity in multiple regression?

    Select the correct option
    Select an option first
    Show solution
    Multicollinearity does not bias estimators (they remain BLUE), but makes XTXX^TX nearly singular, inflating (XTX)1(X^TX)^{-1} and therefore the SESE. Individual tt-tests lose power, but the global FF-test and predictions remain reliable.
  13. Ex. 106.13Understanding

    Which statement about partial coefficients in multiple regression is CORRECT?

    Select the correct option
    Select an option first
    Show solution
    The phenomenon is called "sign reversal" or suppression effect. It occurs when X2X_2 is correlated with X1X_1 such that controlling for X2X_2 reveals the true relationship of X1X_1 with YY. Classic example: positive correlation between fire trucks and damage — controlling for fire size, the effect can change.
  14. Ex. 106.14Modeling

    Regression of monthly household spending (R$ thousands) on 4 socioeconomic predictors: n=80n=80, SST=18000SST=18000, SSE=5400SSE=5400. Calculate MSEMSE, σ^\hat\sigma and Rˉ2\bar R^2.

    Select the correct option
    Select an option first
    Show solution
    MSE=SSE/(np1)=5400/75=72MSE = SSE/(n-p-1) = 5400/75 = 72; σ^=728.49\hat\sigma = \sqrt{72} \approx 8.49. Rˉ2=15400/7518000/79=172227.8510.316=0.684\bar R^2 = 1 - \frac{5400/75}{18000/79} = 1 - \frac{72}{227.85} \approx 1 - 0.316 = 0.684.
  15. Ex. 106.15Modeling

    Model: Y^=45+2.5X18D\hat Y = 45 + 2.5X_1 - 8D (salary in R$ thousands, experience in years, DD=1 if woman). Calculate salaries for (a) man, 10 years; (b) woman, 10 years. How to add interaction to check if the gap varies with experience?

    Select the correct option
    Select an option first
    Show solution
    See the reference indicated in fonte for detailed solution.
    Show step-by-step (with the why)
    1. Non-interaction model: one line with equal slope for men and women.
    2. For men (D=0D=0): Y^=45+2.5X1\hat Y = 45 + 2.5X_1. For women (D=1D=1): Y^=45+2.5X18=37+2.5X1\hat Y = 45 + 2.5X_1 - 8 = 37 + 2.5X_1.
    3. Salary difference between genders is constant at R\$ 8 thousand for any experience level.
    4. To test if the difference varies with experience, add the interaction term X1×DX_1 \times D.
    5. Observation: the interaction model is Y^=β0+β1X1+β2D+β3(X1D)\hat Y = \beta_0 + \beta_1 X_1 + \beta_2 D + \beta_3(X_1 \cdot D). If β^3\hat\beta_3 is significant, the gender difference varies with experience.
  16. Ex. 106.16Modeling

    A researcher has a regression model with 2 predictors (R2=0.65R^2=0.65, Rˉ2=0.64\bar R^2=0.64) and considers adding a third predictor. Describe two criteria to decide whether to include it.

    Select the correct option
    Select an option first
    Show solution
    Compare models with and without X3X_3: if Rˉ2\bar R^2 rises when including X3X_3, keep it. Alternative: do partial tt-test for β^3\hat\beta_3. If p-value less than 0.05, X3X_3 is significant given the others. AIC criterion: AIC=nln(SSE/n)+2(p+1)AIC = n\ln(SSE/n) + 2(p+1), lower is better. Use VIF to check if X3X_3 introduces severe multicollinearity.
  17. Ex. 106.17Challenge

    Prove that the hat matrix H=X(XTX)1XTH = X(X^TX)^{-1}X^T is idempotent: H2=HH^2 = H.

    Select the correct option
    Select an option first
    Show solution
    The hat matrix H=X(XTX)1XTH = X(X^TX)^{-1}X^T is symmetric (HT=HH^T=H) and idempotent (H2=HH^2=H). Idempotence: H2=X(XTX)1XTX(XTX)1XT=X(XTX)1XT=HH^2 = X(X^TX)^{-1}X^TX(X^TX)^{-1}X^T = X(X^TX)^{-1}X^T = H. This confirms that HH is an orthogonal projection: applying it twice gives the same result.
  18. Ex. 106.18Challenge

    Data: n=6n=6 observations with Y=(10,14,18,12,16,20)Y=(10,14,18,12,16,20), X1=(1,2,3,2,3,4)X_1=(1,2,3,2,3,4), X2=(5,4,3,6,5,4)X_2=(5,4,3,6,5,4). Write the design matrix XX and state the procedure to calculate β^=(XTX)1XTy\hat{\boldsymbol\beta} = (X^TX)^{-1}X^T\mathbf{y} (matrix inversion by hand not required — describe the steps).

    Select the correct option
    Select an option first
    Show solution
    Build the matrices with the given data, calculate the product and obtain β^\hat{\boldsymbol\beta}. This exercise is best solved with a matrix calculator or R/Python.
    Show step-by-step (with the why)
    1. With n=6n=6, p=2p=2: build XX (column of 1s, column X1X_1, column X2X_2).
    2. Calculate XTXX^TX (3×3 matrix).
    3. Calculate (XTX)1(X^TX)^{-1}.
    4. Calculate XTyX^T\mathbf{y} (3×1 vector).
    5. Multiply: β^=(XTX)1XTy\hat{\boldsymbol\beta} = (X^TX)^{-1}X^T\mathbf{y}.
    6. Fun fact: in real applications, (XTX)1(X^TX)^{-1} is computed numerically via QR decomposition, not direct inversion (more numerically stable).
  19. Ex. 106.19Proof

    Prove that in any regression with intercept, i=1nei=0\sum_{i=1}^n e_i = 0, using the orthogonality XTe=0X^T\mathbf{e} = \mathbf{0}.

    Select the correct option
    Select an option first
    Show solution
    We must show that ei=0\sum e_i = 0. Since e=(IH)Y\mathbf{e} = (I-H)\mathbf{Y} and the first column of XX is a vector of 1s (1\mathbf{1}), we have XTe=XT(IH)Y=XTYXTX(XTX)1XTY=0X^T\mathbf{e} = X^T(I-H)\mathbf{Y} = X^T\mathbf{Y} - X^TX(X^TX)^{-1}X^T\mathbf{Y} = \mathbf{0}. The first row of XTX^T is 1T\mathbf{1}^T, therefore 1Te=ei=0\mathbf{1}^T\mathbf{e} = \sum e_i = 0.
  20. Ex. 106.20Challenge

    Show that adding a predictor to the model increases Rˉ2\bar R^2 if and only if the test statistic T|T| of the new predictor is greater than 1.

    Select the correct option
    Select an option first
    Show solution
    Formula for change in Rˉ2\bar R^2 when adding a predictor: Rˉ2\bar R^2 increases if and only if the partial FF of the new predictor is greater than 1. Equivalently: Rˉ2\bar R^2 of augmented model >> Rˉ2\bar R^2 of reduced model \Leftrightarrow Tj2>1T_j^2 > 1. This shows that the Rˉ2\bar R^2 criterion is less conservative than the tt-test at 5% level (which requires Tj>tnp1;0.0252|T_j| > t_{n-p-1;\,0.025} \approx 2).
  21. Ex. 106.21Application

    A multiple model predicts baby weight (YY) with predictors: smoking cigarettes (X1X_1) and parity (X2X_2, number of previous children). The coefficient of X1X_1 measures which effect?

    Select the correct option
    Select an option first
    Show solution
    In multiple regression, the coefficient of "smoking" measures the partial effect — the expected change in baby weight per unit change in smoking, holding parity constant. Each coefficient is a conditional effect given the other predictors in the model.
  22. Ex. 106.22ApplicationAnswer key

    Research with 55 Duke University students models GPA as a function of: study hours per night, number of classes missed and gender. What does the coefficient of "study hours" represent in this multiple model?

    Select the correct option
    Select an option first
    Show solution
    In a model with multiple predictors (GPA, study hours, classes missed, gender), the coefficient of each variable controls for the others. The coefficient of study hours represents the partial effect of one additional hour of study, holding the other variables (classes missed, gender) constant.
  23. Ex. 106.23Application

    Lumber mills estimate tree volume (in cubic feet) from diameter and height. A multiple regression model includes diameter (X1X_1), height (X2X_2) and the product diameter ×\times height (X3X_3). What is the role of the term X3X_3 in the model?

    Select the correct option
    Select an option first
    Show solution
    Model with 3 predictors: diameter (X1X_1), height (X2X_2) and interaction diameter×height (X3X_3). The adjusted Rˉ2\bar R^2 should be high due to the strong geometric relationship between these dimensions and volume.
    Show step-by-step (with the why)
    1. Model: Y^=β^0+β^1X1+β^2X2+β^3X3\hat Y = \hat\beta_0 + \hat\beta_1 X_1 + \hat\beta_2 X_2 + \hat\beta_3 X_3 where X1X_1 = diameter, X2X_2 = height, X3X_3 = diameter × height.
    2. Wood volume is the response variable YY.
    3. The product X3=X1×X2X_3 = X_1 \times X_2 is an interaction term that allows the effect of diameter on volume to depend on height.
    4. With all three predictors, the model better captures the nonlinear relationship between dimensions and volume.
  24. Ex. 106.24ApplicationAnswer key

    Comparing the simple model (smoking only) with the multiple model (smoking + parity) for baby weight: can the smoking coefficient differ in the two models? Why?

    Select the correct option
    Select an option first
    Show solution
    In simple regression, the smoking coefficient absorbs also the confounding effect of parity (smoking mothers tend to have more or fewer children). In the multiple model, controlling for parity, the smoking coefficient captures only the partial effect. Coefficients can differ due to confounding.
  25. Ex. 106.25Understanding

    Why can adjusted Rˉ2\bar R^2 decrease when we add a new predictor to the multiple regression model?

    Select the correct option
    Select an option first
    Show solution
    Rˉ2=1(SSE/(np1))/(SST/(n1))\bar R^2 = 1 - (\mathrm{SSE}/(n-p-1))/(\mathrm{SST}/(n-1)). Adding a predictor reduces SSE, but also reduces the degrees of freedom np1n-p-1. If the SSE reduction is small, the ratio SSE/(np1)\mathrm{SSE}/(n-p-1) can increase, making Rˉ2\bar R^2 decrease.
    Show step-by-step (with the why)
    1. Formula: Rˉ2=1SSE/(np1)SST/(n1)\bar R^2 = 1 - \frac{\mathrm{SSE}/(n-p-1)}{\mathrm{SST}/(n-1)}.
    2. When adding a predictor: pp+1p \to p+1, so np1np2n-p-1 \to n-p-2 (denominator decreases).
    3. SSE also decreases (more predictors reduce errors).
    4. If the SSE reduction is small (uninformative predictor), the ratio SSE/(np2)\mathrm{SSE}/(n-p-2) can increase.
    5. In that case, Rˉ2\bar R^2 decreases — penalizing the model for including a redundant predictor.
  26. Ex. 106.26Modeling

    Researchers investigate school absenteeism (YY) as a function of lack of discipline (X1X_1) and distance from school to student's home (X2X_2, in km). Write the multiple regression model and interpret each coefficient.

    Select the correct option
    Select an option first
    Show solution
    Absenteeism as a function of lack of discipline and distance from school. Model: Y^=β^0+β^1X1+β^2X2\hat Y = \hat\beta_0 + \hat\beta_1 X_1 + \hat\beta_2 X_2. The coefficient β^1\hat\beta_1 measures the effect of lack of discipline on absenteeism controlling for distance. The coefficient β^2\hat\beta_2 measures the effect of distance controlling for discipline. The intercept is the expected absenteeism when both variables are zero.
  27. Ex. 106.27Understanding

    What is the main practical effect of multicollinearity in a multiple regression model?

    Select the correct option
    Select an option first
    Show solution
    When predictors are highly correlated, the matrix XTXX^TX becomes nearly singular, amplifying coefficient standard errors. OLS estimators remain unbiased, but have very high variance, making individual tt-tests powerless to detect real effects.
  28. Ex. 106.28ApplicationAnswer key

    The VIF (Variance Inflation Factor) of a predictor is 5. What does this mean for the standard error of the estimated coefficient?

    Select the correct option
    Select an option first
    Show solution
    The Variance Inflation Factor is VIFj=1/(1Rj2)\mathrm{VIF}_j = 1/(1 - R_j^2), where Rj2R_j^2 is the R2R^2 of regressing XjX_j on the other predictors. VIFj=5\mathrm{VIF}_j = 5 means that Var(β^j)\mathrm{Var}(\hat\beta_j) is 5 times larger than without collinearity; so the SE is 52.24\sqrt{5} \approx 2.24 times larger.
  29. Ex. 106.29Modeling

    A researcher wants to model ENEM score (YY) of students as a function of: family income (X1X_1), parental education (X2X_2), weekly study hours (X3X_3) and school type (X4X_4: 1=private, 0=public). Write the model, identify possible multicollinearity and describe how to verify it.

    Select the correct option
    Select an option first
    Show solution
    Model: Y^=β^0+β^1income+β^2education+β^3hours+β^4school\hat Y = \hat\beta_0 + \hat\beta_1 \cdot \text{income} + \hat\beta_2 \cdot \text{education} + \hat\beta_3 \cdot \text{hours} + \hat\beta_4 \cdot \text{school}. Check multicollinearity between income and parental education via VIF.
    Show step-by-step (with the why)
    1. Proposed predictors to forecast ENEM scores: family income, parental education, study hours, school type (public/private).
    2. Check multicollinearity: income and parental education may be highly correlated. Calculate VIF\mathrm{VIF} for each predictor.
    3. If VIF>10\mathrm{VIF} > 10 for any predictor, consider removing the most collinear or using principal components.
    4. Check assumptions: plot residuals vs. fitted (homoscedasticity), QQ-plot (normality), plot residuals vs. order (independence).
  30. Ex. 106.30Modeling

    Explain the variable selection strategies forward selection and backward elimination. Which criterion is more recommended when you have many candidate predictors?

    Select the correct option
    Select an option first
    Show solution
    In stepwise selection, start without predictors (or with all) and add (or remove) predictors one by one by AIC criterion or partial FF-test p-value. Forward selection includes first the most significant predictor, then the second most significant given the first, etc. Backward elimination starts with all and removes the least significant. The AIC criterion balances fit and parsimony: AIC=nln(SSE/n)+2(p+1)\mathrm{AIC} = n\ln(\mathrm{SSE}/n) + 2(p+1).
  31. Ex. 106.31ApplicationAnswer key

    In the model of the previous exercise, the variable X4X_4 is a dummy (1=private, 0=public). How to interpret the coefficient β^4\hat\beta_4?

    Select the correct option
    Select an option first
    Show solution
    When X4=1X_4 = 1 (private), Y^\hat Y increases by β^4\hat\beta_4 compared to X4=0X_4 = 0 (public), holding the other predictors constant. β^4\hat\beta_4 is the expected average difference between the two school categories, partially adjusted for income, parental education and study hours.
  32. Ex. 106.32Understanding

    What is the relationship between SST (total variation), SSR (variation explained by regression) and SSE (variation of residuals)?

    Select the correct option
    Select an option first
    Show solution
    In the variance decomposition: SST=SSR+SSE\mathrm{SST} = \mathrm{SSR} + \mathrm{SSE}, where SST = total sum of squares, SSR = regression sum of squares (explained) and SSE = sum of squared residuals (unexplained). By definition, R2=SSR/SST=1SSE/SSTR^2 = \mathrm{SSR}/\mathrm{SST} = 1 - \mathrm{SSE}/\mathrm{SST}.
  33. Ex. 106.33ApplicationAnswer key

    A multiple regression model with p=3p = 3 predictors fitted to n=55n = 55 observations has SSR=120\mathrm{SSR} = 120 and SSE=80\mathrm{SSE} = 80. Calculate the global FF statistic and conclude at 5% level (critical value F0.05;3;512.79F_{0.05; 3; 51} \approx 2.79).

    Select the correct option
    Select an option first
    Show solution
    F=25.5>2.79F = 25.5 > 2.79. We reject H0H_0: the 3 predictors significantly explain the variation in Y. (Resp: F=25.5F = 25.5)
    Show step-by-step (with the why)
    1. Data: p=3p = 3, n=55n = 55, SSR=120\mathrm{SSR} = 120, SSE=80\mathrm{SSE} = 80.
    2. Degrees of freedom: df1=p=3df_1 = p = 3, df2=np1=5531=51df_2 = n - p - 1 = 55 - 3 - 1 = 51.
    3. F statistic: F=(SSR/df1)/(SSE/df2)=(120/3)/(80/51)=40/1.569=25.5F = (\mathrm{SSR}/df_1)/(\mathrm{SSE}/df_2) = (120/3)/(80/51) = 40/1.569 = 25.5.
    4. Critical value: F0.05;3;512.79F_{0.05;\,3;\,51} \approx 2.79. Since 25.52.7925.5 \gg 2.79, we reject H0H_0.
    5. Conclusion: the set of 3 predictors significantly explains the variation in Y at 5% level.
  34. Ex. 106.34Modeling

    Tree volume in an orchard (in cubic feet) is modeled as a function of diameter (X1X_1, in inches) and height (X2X_2, in feet). Based on the multiple model, interpret the coefficient β^1\hat\beta_1. What does an Rˉ2=0.944\bar R^2 = 0.944 indicate about the fit?

    Select the correct option
    Select an option first
    Show solution
    Model: vol^=β^0+β^1diam+β^2height\hat{\text{vol}} = \hat\beta_0 + \hat\beta_1 \cdot \text{diam} + \hat\beta_2 \cdot \text{height}. Each coefficient is the partial effect holding the other dimension constant. A high Rˉ2\bar R^2 confirms that larger trees have larger volume, as geometrically expected.
    Show step-by-step (with the why)
    1. Base model: β^=(XTX)1XTy\hat\beta = (X^TX)^{-1}X^T\mathbf{y}. With p=2p = 2, n=3n = 3: XTXX^TX is 3×33 \times 3.
    2. Data: X1=X_1 = diameter, X2=X_2 = height (in feet), Y=Y = volume (cubic feet).
    3. Calculate β^0,β^1,β^2\hat\beta_0, \hat\beta_1, \hat\beta_2 numerically and interpret: per extra unit of diameter (height fixed), volume changes by β^1\hat\beta_1 cubic feet.
    4. Check Rˉ2\bar R^2. If high (>0.90), the model fits well. Plot residuals vs. fitted to check homoscedasticity.
  35. Ex. 106.35Challenge

    In a model with three predictors X1,X2,X3X_1, X_2, X_3 where X3=2X1+X2X_3 = 2X_1 + X_2 (perfect multicollinearity), explain why the OLS solution β^=(XTX)1XTy\hat\beta = (X^TX)^{-1}X^T\mathbf{y} does not exist. What does statistical software do in this situation?

    Select the correct option
    Select an option first
    Show solution
    If X3=αX1+γX2+cX_3 = \alpha X_1 + \gamma X_2 + c (exact linear combination of the others), the matrix XTXX^TX has determinant zero and is not invertible. The OLS solution β^=(XTX)1XTy\hat\beta = (X^TX)^{-1}X^T\mathbf{y} does not exist. On the computer, the software detects perfect multicollinearity and automatically discards the redundant variable.
  36. Ex. 106.36Challenge

    A multiple regression model with 15 predictors and n=20n = 20 observations has R2=0.97R^2 = 0.97. Explain why this high R2R^2 can be misleading and how cross-validation provides a more honest measure of predictive power.

    Select the correct option
    Select an option first
    Show solution
    The cross-validation RMSE (leave-one-out or k-fold) is more honest than in-sample R2R^2 because it measures error on data not used in fitting. A model with many predictors can have R21R^2 \approx 1 (overfitting) but high out-of-sample RMSE. Adjusted Rˉ2\bar R^2 and AIC penalize complexity, but only cross-validation directly estimates prediction error.
  37. Ex. 106.37Application

    In a multiple model, the intercept β^0\hat\beta_0 is not significant at 5% level. Should it be removed from the model? What is the interpretation of the intercept?

    Select the correct option
    Select an option first
    Show solution
    The intercept β^0\hat\beta_0 is the predicted value of YY when all predictors are zero. In many practical contexts, this makes no sense (height = 0, income = 0). Still, the intercept is necessary to correctly center the regression and should be kept even when not significant, to avoid bias in the other coefficients.
  38. Ex. 106.38Proof

    Derive the normal equations XTXβ^=XTyX^TX\hat\beta = X^T\mathbf{y} from the minimization of yXβ2\|\mathbf{y} - X\boldsymbol\beta\|^2 with respect to β\boldsymbol\beta. Use the result to show that residuals are orthogonal to the columns of XX.

    Select the correct option
    Select an option first
    Show solution
    The normal equations are XTXβ^=XTyX^TX\hat\beta = X^T\mathbf{y}. Multiplying on the left by (XTX)1(X^TX)^{-1}: β^=(XTX)1XTy\hat\beta = (X^TX)^{-1}X^T\mathbf{y}. To verify XTe=0X^T\mathbf{e} = 0: e=yXβ^\mathbf{e} = \mathbf{y} - X\hat\beta, so XTe=XTyXTXβ^=XTyXTy=0X^T\mathbf{e} = X^T\mathbf{y} - X^TX\hat\beta = X^T\mathbf{y} - X^T\mathbf{y} = 0. This implies ei=0\sum e_i = 0 (first row of XX is 1s).
  39. Ex. 106.39Proof

    Define the hat matrix H=X(XTX)1XTH = X(X^TX)^{-1}X^T. Prove that HH is idempotent (H2=HH^2 = H) and symmetric. What is the trace of HH and what does it represent geometrically?

    Select the correct option
    Select an option first
    Show solution
    The hat matrix is H=X(XTX)1XTH = X(X^TX)^{-1}X^T. Fitted values are y^=Hy\hat{\mathbf{y}} = H\mathbf{y} and residuals e=(IH)y\mathbf{e} = (I-H)\mathbf{y}. Properties: (1) HH is symmetric: HT=HH^T=H; (2) HH is idempotent: H2=HH^2=H (orthogonal projection); (3) eigenvalues of HH are 0 and 1; (4) tr(H)=p+1\mathrm{tr}(H) = p+1 (number of estimated parameters).
  40. Ex. 106.40Understanding

    Which diagnostic plot specifically verifies the normality assumption of errors in a multiple regression model? What do we observe in this plot when normality is satisfied?

    Select the correct option
    Select an option first
    Show solution
    The QQ-plot (quantile-quantile plot) of residuals versus quantiles of a standard normal distribution should show points on a diagonal line if errors are normally distributed. Deviations at the tails indicate skewness or heavy tails. It is one of the standard diagnostic plots for the normality assumption (N in the LINE mnemonic).
  41. Ex. 106.41Modeling

    For the model of exercise 106.33 (p=3p = 3, n=55n = 55, SSR=120\mathrm{SSR} = 120, SSE=80\mathrm{SSE} = 80): calculate R2R^2 and adjusted Rˉ2\bar R^2. Compare the two and interpret the difference.

    Select the correct option
    Select an option first
    Show solution
    For the regression with n=55n = 55, p=3p = 3, SSR=120\mathrm{SSR} = 120, SSE=80\mathrm{SSE} = 80: SST=200\mathrm{SST} = 200. R2=120/200=0.60R^2 = 120/200 = 0.60. Rˉ2=1(80/51)/(200/54)=11.569/3.704=10.424=0.576\bar R^2 = 1 - (80/51)/(200/54) = 1 - 1.569/3.704 = 1 - 0.424 = 0.576. The model explains 57.6% of Y variance after penalizing for complexity.
  42. Ex. 106.42Challenge

    In a model with p=10p = 10 predictors, each coefficient is tested at level α=0.05\alpha = 0.05. What is the probability of at least one Type I error (false positive) under the global H0H_0? How does Bonferroni adjustment correct this?

    Select the correct option
    Select an option first
    Show solution
    With pp predictors, the individual tt-test of H0:βj=0H_0: \beta_j = 0 at level α\alpha has probability α\alpha of false positive per predictor. With p=10p = 10 independent tests and α=0.05\alpha = 0.05: probability of at least one false positive =1(10.05)100.40= 1 - (1-0.05)^{10} \approx 0.40. Corrections: Bonferroni (α=α/p\alpha^* = \alpha/p), Holm (sequential procedure), or false discovery rate control (Benjamini-Hochberg FDR).

Sources

  • OpenIntro Statistics (4th ed.) — Diez, Çetinkaya-Rundel, Barr · CC-BY-SA · Chapter 8 (Multiple and logistic regression). Primary source for coefficient interpretation, Rˉ2\bar R^2, multicollinearity and dummy variables.
  • Statistics — OpenStax — Illowsky, Dean · CC-BY · Chapter 13 (Linear Regression and Correlation — Multiple). Source for ANOVA tables of multiple regression and global F-test.
  • Probabilidade e Estatística — Wikilivros — collaborative · CC-BY-SA · Multiple regression section. Portuguese-language reference with matrix notation compatible with Brazilian engineering curriculum.

Updated on 2026-05-06 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.