线性回归分析-HW8

HW8.

Prob-1. (KNNL 6.5.) Brand preference.

1-a

The model is

Y=Xβ+εY=X\beta+\varepsilon

where

X=[1X11X12X11X121X21X22X21X22⋮⋮⋮⋮1Xn1⋯Xn1Xn2]X=\begin{bmatrix} 1 & X_{1 1} & X_{1 2} & X_{1 1}X_{1 2} \\ 1 & X_{2 1} & X_{2 2} & X_{21}X_{22} \\ \vdots & \vdots & \vdots & \vdots \\ 1 & X_{n1} & \cdots & X_{n 1}X_{n 2} \end{bmatrix}

Assumptions:

  • E[ε]=0\mathbb{E}[\varepsilon]=\boldsymbol{0} and Cov(ε)=σ2I\mathrm{Cov}(\varepsilon)=\sigma^{2}I.
  • εi∼N(0,σ2)\varepsilon_i \sim N(0,\sigma^2) independently
  • XX is fixed and has full column rank 44.

1-b

493
550

  • YY increases with both X1X_1 (r=0.892r=0.892) and X2X_2 (r=0.395r=0.395); the relations look roughly linear, with no gross outliers.
  • X1X_1 and X2X_2 are uncorrelated (r=0r=0)
  • X1X2X_1X_2 has a large marginal correlation with YY (r=0.857r=0.857)

1-c

Y^=27.150+5.925X1+7.875X2−0.500X1X2.\hat Y = 27.150 + 5.925X_1 + 7.875X_2 - 0.500X_1X_2.

ANOVA:

Source df SS MS FF pp
Regression 3 1892.70 630.90 101.90 <0.0001<0.0001
Residual 12 74.30 6.19
Total 15 1967.00

R2=0.9622R^2=0.9622, Ra2=0.9528R^2_a=0.9528, σ^2=MSE=6.19\hat\sigma^2=MSE=6.19 (σ^=2.49\hat\sigma=2.49).

1-d

442

  • Linearity: good
  • Constant variance: good

1-e

The scatter plots and correlations among YY, X1X_1, X2X_2 in part (b) are unchanged (the upper-left 3×33\times3 block of the scatter plot matrix); the X1X2X_1X_2 column is simply excluded.

Y^=37.650+4.425X1+4.375X2.\hat Y = 37.650 + 4.425X_1 + 4.375X_2.

ANOVA:

Source df SS MS FF pp
Regression 2 1872.70 936.35 129.08 <0.0001<0.0001
Residual 13 94.30 7.25
Total 15 1967.00

R2=0.9521R^2=0.9521, Ra2=0.9447R^2_a=0.9447, σ^2=MSE=7.25\hat\sigma^2=MSE=7.25 (σ^=2.69\hat\sigma=2.69).
|538
Linearity is not good. Look at the points where fitted value is 65 or 100, the residuals have the tendency to be negative.

1-f

The full model. Because it has higher Ra2R_{a}^{2} and less MSEMSE.

Prob-2. (KNNL 6.15.) Patient satisfaction.

2-b

593

YY X1X_1 X2X_2 X3X_3
YY 1.000 −0.787-0.787 −0.603-0.603 −0.645-0.645
X1X_1 −0.787-0.787 1.000 0.568 0.570
X2X_2 −0.603-0.603 0.568 1.000 0.671
X3X_3 −0.645-0.645 0.570 0.671 1.000
  • Satisfaction decreases with age (r=-0.787), severity (-0.603), and anxiety (-0.645); age is the strongest single predictor. Each relation looks roughly linear, with no gross outliers.
  • The predictors are positively correlated with one another (0.568–0.671), so they carry overlapping information; this inflates the standard errors of the partial coefficients but is not severe.

2-c

Y^=158.491−1.142 X1−0.442 X2−13.470 X3.\hat Y = 158.491 - 1.142\,X_1 - 0.442\,X_2 - 13.470\,X_3 .

Term Estimate SE tt pp
Intercept 158.491 18.126 8.744 <0.0001<0.0001
X1X_1 −1.142-1.142 0.215 −5.315-5.315 <0.0001<0.0001
X2X_2 −0.442-0.442 0.492 −0.898-0.898 0.374
X3X_3 −13.470-13.470 7.100 −1.897-1.897 0.065

R2=0.682R^2=0.682, Ra2=0.660R^2_a=0.660, σ^=10.06\hat\sigma=10.06 (df=42df=42).

b2=−0.442b_2=-0.442: holding age and anxiety constant, a one-unit increase in the severity index is estimated to lower mean satisfaction by 0.4420.442 points. The effect is not significant (p=0.374p=0.374).

2-d

544
No observation lies beyond the whiskers. So no outliers.

2-e

593

  • Residuals vs Y^\hat Y: random scatter about zero, linearity is good.
  • Residuals vs each predictor: constant variance is reasonable.
  • Normal probability plot: points follow the straight line closely in the middle, indicating good normality, though light tails are present.

Prob-3 (KNNL 6.16)

With independent normal errors, use the Bonferroni procedure for the family of coefficients with family confidence 1−α=0.901-\alpha=0.90:

CIj=bj±t1−α/6,42⋅s(bj)CI_{j}=b_{j}\pm t_{1-\alpha/6,42}\cdot s(b_{j})

The confidence region is

S=\bigtimes_{j=1}^3 CI_{j}

Interpretation: If we repeat our fitting process many times, roughly 90% of our estimation vectors (b0,b1,b2)(b_{0},b_{1},b_{2}) lie in SS.

Prob-4. (KNNL 6.17)

4-a

Y^h±t0.95,42⋅s(Y^h)=69.01±1.682⋅2.665=(64.53, 73.49)\hat Y_h \pm t_{0.95,42}\cdot s(\hat Y_h) = 69.01 \pm 1.682\cdot 2.665 = (64.53,\ 73.49)

With 90% confidence, the mean satisfaction of all patients aged 35 with severity 45 and anxiety 2.2 lies between 64.5364.53 and 73.4973.49.

4-b

Y^h±t0.95,42MSE+s2(Y^h)=69.01±1.682101.16+7.10=(51.51, 86.51).\hat Y_h \pm t_{0.95,42}\sqrt{MSE+s^2(\hat Y_h)} = 69.01 \pm 1.682\sqrt{101.16+7.10} = (51.51,\ 86.51).

With 90% confidence, a new patient with Xh=(35,45,2.2)X_h=(35,45,2.2) will have satisfaction between 51.5151.51 and 86.5186.51. The prediction interval is much wider than the confidence interval because it also includes the patient-to-patient variation (MSEMSE) around the mean.


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