线性回归分析-HW9

HW9.

Prob-1

βk\beta_{k} in 1, 3, 4 are equivalent.

Prob-2

2-1

No. Consider the following figure

X1X_{1} is suppressor variable for X2X_{2} in this case. But X2X_{2} is not for X1X_{1}, because X1X_{1} residualized by X2X_{2} still doesn't have any correlation with YY.

2-2

  ⟹  :\implies:

SSR(X2∣X1)>SSR(X2)  ⟺  SSE(X1)−SSE(X1,X2)>SST−SSE(X2)  ⟺  SSE(X1)−SSE(X1,X2)SSE(X1)>SST−SSE(X2)SSE(X1)  ⟹  SSE(X1)−SSE(X1,X2)SSE(X1)>SST−SSE(X2)SST  ⟺  RY2∣12>RY22\begin{align} SSR(X_{2}\mid X_{1})>SSR(X_{2}) & \iff SSE(X_{1})-SSE(X_{1},X_{2})>SST-SSE(X_{2}) \\ & \iff \frac{SSE(X_{1})-SSE(X_{1},X_{2})}{SSE(X_{1})}> \frac{SST-SSE(X_{2})}{SSE(X_{1})} \\ & \implies \frac{SSE(X_{1})-SSE(X_{1},X_{2})}{SSE(X_{1})}> \frac{SST-SSE(X_{2})}{SST} \\ & \iff R^{2}_{Y 2\mid 1} > R^{2}_{Y 2} \end{align}

But the converse is wrong. Here is a counter-example:

YY X1X_{1} X2X_{2}
1 1 5
2 2 1
3 4 0
Can compute

SST=2, SSE(X1)=114, SSE(X2)=314, SSE(X1,X2)=0SST=2,\ SSE(X_{1})=\frac{1}{14},\ SSE(X_{2})=\frac{3}{14},\ SSE(X_{1},X_{2})=0

so

RY2∣12=1>2556=RY22R^{2}_{Y 2\mid 1}=1>\frac{25}{56}=R^{2}_{Y 2}

but

SSR(X2∣X1)=17<1114=SSR(X2)SSR(X_{2}\mid X_{1})=\frac{1}{7}< \frac{11}{14}=SSR(X_{2})

The intuition is to construct X1X_{1} which has small SSE(X1)SSE(X_{1}).

Prob-3

All four exercises use the 46 observations in CH06PR15.txt from KNNL 6.15. Let YY be patient satisfaction, X1X_1 age, X2X_2 severity of illness, and X3X_3 anxiety. The full model is

Yi=β0+β1Xi1+β2Xi2+β3Xi3+εi.Y_i=\beta_0+\beta_1X_{i1}+\beta_2X_{i2}+\beta_3X_{i3}+\varepsilon_i.

It has SSEF=4248.8407SSE_F=4248.8407 on 4242 residual degrees of freedom, so MSEF=101.1629MSE_F=101.1629. Under the usual normal linear model assumptions, the partial FF statistic for qq restrictions is

F∗=(SSER−SSEF)/qMSEF,F^*=\frac{(SSE_R-SSE_F)/q}{MSE_F},

where SSERSSE_R is from the reduced model. Under H0H_0, F∗∼Fq,42F^*\sim F_{q,42}.

KNNL 7.5

a

Enter the predictors in the order X2,X1,X3X_2,X_1,X_3.

Source df SS MS FF pp
Regression 3 9120.4637 3040.1546 30.0521 1.54×10−101.54\times10^{-10}
SSR(X2)\quad SSR(X_2) 1 4860.2600 4860.2600 48.0439 1.82×10−81.82\times10^{-8}
SSR(X1∣X2)\quad SSR(X_1\mid X_2) 1 3896.0441 3896.0441 38.5126 2.01×10−72.01\times10^{-7}
SSR(X3∣X2,X1)\quad SSR(X_3\mid X_2,X_1) 1 364.1595 364.1595 3.5997 0.06468
Error 42 4248.8407 101.1629
Total 45 13369.3043

The three sequential sums of squares add to the regression SS before rounding. Entering X1X_1 first gives SSR(X1)=8275.3889SSR(X_1)=8275.3889 and SSR(X2∣X1)=480.9153SSR(X_2\mid X_1)=480.9153. The first predictor gets credit for the variation it explains on its own, including variation that the second predictor could also explain. The total regression SS and the last increment for X3X_3 are the same in either order.

b

Test H0 ⁣:β3=0H_0\colon\beta_3=0 against HA ⁣:β3≠0H_A\colon\beta_3\ne0. The reduced model retains X1X_1 and X2X_2 and has SSER=4613.0002SSE_R=4613.0002. Thus

F∗=4613.0002−4248.8407101.1629=3.5997.F^*=\frac{4613.0002-4248.8407}{101.1629}=3.5997.

At α=0.025\alpha=0.025, reject H0H_0 if F∗>F1,42;0.975=5.4039F^*>F_{1,42;0.975}=5.4039. The pp-value is 0.064680.06468, so we fail to reject H0H_0. There is insufficient evidence that anxiety improves the model after age and severity are included. Dropping X3X_3 is consistent with this test.

KNNL 7.6

Test H0 ⁣:β2=β3=0H_0\colon\beta_2=\beta_3=0 against HA ⁣:H_A\colon at least one of β2,β3\beta_2,\beta_3 is nonzero. The reduced model retains only X1X_1 and has SSER=5093.9155SSE_R=5093.9155. Thus

F∗=(5093.9155−4248.8407)/2101.1629=4.1768.F^*=\frac{(5093.9155-4248.8407)/2}{101.1629}=4.1768.

At α=0.025\alpha=0.025, reject H0H_0 if F∗>F2,42;0.975=4.0327F^*>F_{2,42;0.975}=4.0327. The pp-value is 0.022160.02216, so we reject H0H_0. Severity and anxiety jointly improve the age-only model, and dropping both is unsupported at this level.

In the full model, the individual tests for X2X_2 and X3X_3 give p=0.37407p=0.37407 and p=0.06468p=0.06468. Each test measures what one variable adds when the other is already in the model. The individual extra sums of squares are 81.659181.6591 and 364.1595364.1595. The joint test measures what both add to the age-only model, giving 845.0748845.0748. Because severity and anxiety carry overlapping information, removing both can cost much more than removing either one separately.

KNNL 7.9

Test H0 ⁣:(β1,β2)=(−1,0)H_0\colon(\beta_1,\beta_2)=(-1,0) against HA ⁣:(β1,β2)≠(−1,0)H_A\colon(\beta_1,\beta_2)\ne(-1,0). The full model allows all four coefficients to vary freely. Under H0H_0 the reduced model is

Yi=β0−Xi1+β3Xi3+εi.Y_i=\beta_0-X_{i1}+\beta_3X_{i3}+\varepsilon_i.

Fit the reduced model by regressing Y+X1Y+X_1 on X3X_3 with an intercept. Its residuals are the residuals for YY under the restrictions, so this gives SSER=4427.6549SSE_R=4427.6549. Thus

F∗=(4427.6549−4248.8407)/2101.1629=0.8838.F^*=\frac{(4427.6549-4248.8407)/2}{101.1629}=0.8838.

At α=0.025\alpha=0.025, reject H0H_0 if F∗>4.0327F^*>4.0327. The pp-value is 0.420760.42076, so we fail to reject the two restrictions jointly.

KNNL 7.26

a

The fitted regression on age and severity is

Y^=156.6719−1.2677X1−0.9208X2.\widehat Y = 156.6719 - 1.2677X_1 - 0.9208X_2.

b

Predictor Without X3X_3 With X3X_3 (6.15c)
Age (X1X_1) −1.2677-1.2677 −1.1416-1.1416
Severity (X2X_2) −0.9208-0.9208 −0.4420-0.4420

Both slopes are more negative when anxiety is omitted. The severity slope changes more in absolute terms and is about twice as large in magnitude without anxiety.

c

Predictor SSR(Xj)SSR(X_j) SSR(Xj∣X3)SSR(X_j\mid X_3)
Age (X1X_1) 8275.3889 3483.8915
Severity (X2X_2) 4860.2600 707.9971

For both predictors, SSR(Xj∣X3)<SSR(Xj)SSR(X_j\mid X_3)<SSR(X_j).

d

The correlations from 6.15b are r13=0.570r_{13}=0.570, r23=0.671r_{23}=0.671, and rY3=−0.645r_{Y3}=-0.645. Anxiety is positively associated with age and severity and negatively associated with satisfaction. This is consistent with the slope changes in (b). In fact, the fitted auxiliary regression is

X^3=0.13507+0.00936X1+0.03554X2.\widehat X_3=0.13507+0.00936X_1+0.03554X_2.

The change in each slope when X3X_3 is omitted equals the corresponding auxiliary slope times the full-model anxiety slope b3=−13.4702b_3=-13.4702. These products are −0.1260-0.1260 for age and −0.4788-0.4788 for severity.

For (c), adding XjX_j after X3X_3 uses the parts of XjX_j and YY left after both are residualized on X3X_3. In the notation of Prob-2,

SSR(Xj∣X3)=SSE(X3) rYj∣32,SSR(Xj)=SST rYj2.SSR(X_j\mid X_3)=SSE(X_3)\,r_{Yj\mid 3}^2, \qquad SSR(X_j)=SST\,r_{Yj}^2.

The observed correlations show why the marginal and adjusted sums of squares can differ. In this sample anxiety explains some of the same variation in satisfaction that age or severity explains on its own.

R verification

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
data_dir <- "~/Lessons/Linear Regression Analysis/data"
d <- read.table(file.path(data_dir, "CH06PR15.txt"),
col.names = c("Y", "X1", "X2", "X3"))
full <- lm(Y ~ X2 + X1 + X3, data = d)
two <- lm(Y ~ X1 + X2, data = d)

anova(full)
anova(two)
anova(two, full)
drop1(full, test = "F")
anova(lm(Y ~ X1, data = d), full)
anova(lm(Y ~ X3 + offset(-X1), data = d), full)
qf(0.975, c(1, 2), df.residual(full))

coef(two)
coef(full)
anova(lm(Y ~ X3 + X1, data = d))
anova(lm(Y ~ X3 + X2, data = d))
cor(d)
coef(lm(X3 ~ X1 + X2, data = d))

Prob-4

Do correlation transformation on Y,X1,X2Y,X_{1},X_{2} to obtain Y∗,X1∗,X2∗Y^{*},X_{1}^{*},X_{2}^{*}.

Y∼X1→eX2∼X1→uY∗∼X1∗→e∗X2∗∼X1∗→u∗Y\sim X_{1}\to e\\ X_{2}\sim X_{1}\to u\\ Y^{*}\sim X^{*}_{1}\to e^{*}\\ X^{*}_{2}\sim X^{*}_{1}\to u^{*}

we have

e∗=rY1X1,u∗=r12X1e^*=r_{Y 1}X_{1},\quad u^*=r_{12}X_{1}

rY2∣12=reu2=re∗u∗2(linear trans. doesn’t change corr.)=(∑ei∗ui∗)2∑ei∗2⋅∑ui∗2=(∑(yi∗−rY1xi1∗)(xi2∗−r12xi1∗))2∑(yi∗−rY1xi1∗)2⋅∑(xi2∗−r12xi1∗)2=(rY2−r12−rY1r12+rY1r12)2(1−2rY12+rY12)(1−2r122+r122)(convenience of corr. trans.)=(rY2−r12rY1)2(1−rY12)(1−r122)\begin{align} r^{2}_{Y 2\mid 1} & =r^{2}_{eu} \\ & = r_{e^*u^*}^{2} \quad \text{(linear trans. doesn't change corr.)}\\ & = \frac{\left( \sum e_{i}^*u_{i}^* \right)^{2}}{\sum e_{i}^{*2}\cdot \sum u_{i}^{*2}} \\ & = \frac{\left( \sum (y_{i}^*-r_{Y 1}x^*_{i 1})(x_{i2}^*-r_{12}x_{i 1}^*) \right)^{2}}{\sum (y_{i}^*-r_{Y 1}x^*_{i 1})^{2}\cdot\sum (x_{i2}^*-r_{12}x_{i 1}^*)^{2}} \\ & = \frac{(r_{Y 2}-r_{12}-r_{Y 1}r_{12}+r_{Y 1}r_{12})^{2}}{(1-2r_{Y 1}^{2}+r_{Y 1}^{2})(1-2r_{12}^{2}+r_{12}^{2})}\quad \text{(convenience of corr. trans.)} \\ & = \frac{(r_{Y 2}-r_{12}r_{Y 1})^{2}}{(1-r_{Y 1}^{2})(1-r_{12}^{2})} \end{align}


线性回归分析-HW9
https://wtx17.github.io/2026/11/20/线性回归分析-HW9/
作者
wtx
发布于
2026年11月20日
更新于
2026年12月2日
许可协议