lecture 33 worksheet
3
Problem
3
: A full quadratic regression
Finally, do a regression between age, height squared, smoking (
x
1
,
x
2
2
,
x
3
)
and FEV (
y
). What is
R
2
adj
now?
Answer to Problem
3
.
X = [[1, 13, 4489, 1],
[1, 13, 3721, 0],
....
[1, 16, 4830.25, 1]
]
(X^T X)^-1 = [[20.49, -0.149, -0.0095, 4.382],
[-0.149, 0.0265, -0.00007, 0.7987],
[-0.0045, -0.00007, 0.0000014, -0.0015],
[4.382, 0.7987, -0.0015, 1.909]
]
?_hat = (X^T X)^-1 * X^T y = [[-0.475],[0.0622],[0.000645],[0.7913]]
y_hat = -0.475 + 0.0622*x1 + 0.000645*x2^2 + 0.7913*x3
SSe = 0.7199, SSr = 6.25, SSt = 6.98