Professional Documents
Culture Documents
2014-15 Term 2
Assignment #3 Solutions
Problem 1:
(a) Since (X' X) 1 X' Y , E ( ) (X' X) 1 X' E (Y) (X' X) 1 X' X 2
n
(b) Since X' X 2
xi
E ( )
1
2
n x i ( xi ) 2
(c) As n ,
E ( 1 )
i
i
i
x , (X' X) 1 X' X 2 n xi2 ( xi )2 xi n xi xi3
x
n x 2 ( x ) 2 x 2 2 x x 3
1
x2
n xi2 ( xi ) 2
2
i
3
i
n xi2 ( xi ) 2
x n
x2
n xi3 xi
2
x
i
( xi2 ) 2 xi xi3
0
n xi2 ( xi ) 2
x xi xi3 0
3
2
n x xi xi2 1 n xi xi xi
1
2
2
n xi ( xi )
n xi2 ( xi ) 2
n xi3 xi
2 2
i
3
i
2
i
x x3
1 x x 1
x2
and E ( 0 ) 0 x2 1 0 x2 1 .
4
0
n
X' X 0 SUU
0
0
0
.
0
SVV
Hence
0
0
n
1 ( X' X ) 1 X' Y 0 SUU
2
0
0
0
0
SVV
yi
y
SUY
SUY
/
SUU
y
y SUY / SUU ( x )
(b) 0
1
(a)
(b) y 12.79653 0.20479 xi
(c) H0: 1 = 1 vs H1: 1 1
T-statistic = -20.83884, p-value = 4.712817e-06
Decision: Since p-value < =0.05, we reject H0 at =0.05
Conclusion: We have sufficient evidence that there is no perfect inheritance exists in
the diameters of sweet peas.
(d) Hypothesis: H0: The simple linear regression model is adequate
H1: The simple linear regression model is not adequate
Page 1/4
ANOVA table:
Test Statistic:
F0
SS lof / df lof
( RSS 1 SSlof ) /( n J )
Page 2/4
15952.10
factor(Rank)2
4383.11
1063.99
factor(Rank)3
8975.97
1133.16
factor(Sex)1
244.50
1159.16
0.211 0.833894
Year
409.90
78.21
factor(Rank)2:factor(Sex)1 -1059.19
2188.78
factor(Rank)3:factor(Sex)1 1582.95
1836.99
0.862 0.393417
Adjusted R-squared:
0.831
Decision: Since p-value = Pr( F3,45 F0 ) 0.6148 0.05 , we do not reject H0 at =0.05.
Conclusion: We do not have sufficient evidence that any of the three sex related factors
is different from 0.
fit1<-lm(Salary~factor(Rank)+Year,data=salary); summary(fit1); sum(fit1$res^2)
Estimate Std. Error t value Pr(>|t|)
(Intercept)
16203.27
638.68 25.370
factor(Rank)2 4262.28
882.89
factor(Rank)3 9454.52
Year
375.70
70.92
Adjusted R-squared:
0.8352
(c) The results in part (b) suggest that sex is not a factor in determining the amount of salary,
and therefore we do not have sufficient evidence on sex discrimination in terms of amount
of salary.
Page 3/4
62.74663
(b) RSS Y' Y Y' X(X' X)1 X' Y =4107.409, 2 RSS /( n 3) 195.5909, 13.9854
(c) Optimal x = 1 /( 22 ) 3.780757 . g ' ( ) 0 1/( 22 ) 1 /( 222 ) 0 0.358647 2.71191
ar ( ) 2 g ' ( )T ( X' X)1 g ' ( ) 0.456518 . A 95% Confidence interval for the optimal x is
V
[3.780757 1.96 0.456518,3.780757 1.96 0.456518 ] [2.456,5.105]
(d) (Section 4.3: x-values should be scattered like normal distribution in other to obtain a
balance between goodness-of-fit and locating the center).
Compared with linear regression, quadratic regression should rely on more data points on
the two sides to provide better information about the curvature. The problem setup,
however, have only one data point in the middle which is difficult to locate the optimal
value of x easily.
Suggestion: Allocate 1/4 to 1/3 of the data points in the middle of the x range [1,10], and
the rest are evenly spread on the two sides.
Page 4/4