Docsity

Midterm Solution - Linear Statistics Models I | STAT 741, Exams of Statistics

Toggle sidebar
bg1
STAT 741 MIDTERM SOLUTIONS
1. Consider the linear model Yij =β0+β1xi+εij for i= 0,1, j= 1,...,n,
where x0= 0 and x1= 1. Assume that the εij are i.i.d. N(0, σ 2).
(a) Find the least squares estimators of β0and β1and an unbiased estima-
tor of σ2.
(b) Show that the test of H0:β1= 0 is the usual two sample Student ttest
for the equality of means.
Solution. (a)
S=
1
X
i=0
n
X
j=1
(Yij −β0−β1xi)2=
1
X
i=0
n
X
j=1
(Yij −¯
Yi·+¯
Yi·−β0−β1xi)2
=
1
X
i=0
n
X
j=1
(Yij −¯
Yi·)2+n(¯
Y0·−β0)2+n(¯
Y1·−β0−β1)2
Here we use the fact that xiis either zero or one. Obviously Sis minimized if
β0=¯
Y0·and β0+β1=¯
Y1·. Then the least squares estimates are ˆ
β0=¯
Y0·and
ˆ
β1=¯
Y1·−¯
Y0·. The estimator of the variance is s2=PP(Yij −¯
Yi·)2/(2n−2).
In matrix terms, let 1ndenote an n-dimensional vector with all compo-
nents equal to 1. Then
X="1n0n
1n1n#;XTX="2n n
n n #;XTY="P1
i=0 Pn
j=1 Yij
Pn
j=1 Y1j#.
Then the estimates are given by (XTX)−1XTY.
(b) The test can be constructed in various ways. Note that Var ˆ
β1=
2σ2/n and that s2is the usual pooled variance in the two sample Student t
test. Therefore the test statistic based on the confidence interval method is
t= ( ¯
Y1·−¯
Y0·)/(sq2/n).
The null model is Yij =β0+εij and the least squares estimate is ¯
Y··. The
numerator of the Fstatistic is n(¯
Y0·−¯
Y··)2+n(¯
Y1·−¯
Y··)2with 1 degree of
freedom. After some algebra, this reduces to n(¯
Y1·−¯
Y0·)2/2 so that F=t2.
1
pf3
pf4
pf5

Partial preview of the text

Download Midterm Solution - Linear Statistics Models I | STAT 741 and more Exams Statistics in PDF only on Docsity!

STAT 741 MIDTERM SOLUTIONS

  1. Consider the linear model Yij = β 0 + β 1 xi + εij for i = 0, 1, j = 1,... , n, where x 0 = 0 and x 1 = 1. Assume that the εij are i.i.d. N (0, σ^2 ).

(a) Find the least squares estimators of β 0 and β 1 and an unbiased estima- tor of σ^2.

(b) Show that the test of H 0 : β 1 = 0 is the usual two sample Student t test for the equality of means.

Solution. (a)

S =

∑^1

i=

∑^ n

j=

(Yij − β 0 − β 1 xi)^2 =

∑^1

i=

∑^ n

j=

(Yij − Y¯i· + Y¯i· − β 0 − β 1 xi)^2

∑^1

i=

∑^ n

j=

(Yij − Y¯i·)^2 + n( Y¯ 0 · − β 0 )^2 + n( Y¯ 1 · − β 0 − β 1 )^2

Here we use the fact that xi is either zero or one. Obviously S is minimized if β 0 = Y¯ 0 · and β 0 + β 1 = Y¯ 1 ·. Then the least squares estimates are βˆ 0 = Y¯ 0 · and βˆ 1 = Y¯ 1 · − Y¯ 0 ·. The estimator of the variance is s^2 = ∑ ∑(Yij − Y¯i·)^2 /(2n − 2). In matrix terms, let (^1) n denote an n-dimensional vector with all compo- nents equal to 1. Then

X =

[ (^1) n 0 n (^1) n 1 n

] ; XT^ X =

[ 2 n n n n

] ; XT^ Y =

[ ∑ 1 i=

∑n ∑ j=1^ Yij n j=1 Y^1 j

] .

Then the estimates are given by (XT^ X)−^1 XT^ Y. (b) The test can be constructed in various ways. Note that Var βˆ 1 = 2 σ^2 /n and that s^2 is the usual pooled variance in the two sample Student t test. Therefore the test statistic based on the confidence interval method is

t = ( Y¯ 1 · − Y¯ 0 ·)/(s

√ 2 /n).

The null model is Yij = β 0 + εij and the least squares estimate is Y¯··. The numerator of the F statistic is n( Y¯ 0 · − Y¯··)^2 + n( Y¯ 1 · − Y¯··)^2 with 1 degree of freedom. After some algebra, this reduces to n( Y¯ 1 · − Y¯ 0 ·)^2 /2 so that F = t^2.

  1. Suppose that one considers a two factor additive model Yij = μ + αi + βj + εij , i = 1, 2 , 3, j = 1, 2 , 3, but that not all combinations (i, j) of Factors A and B are observed. In each of the following cases decide whether or not all contrasts in the αi and βj are estimable. That is, decide on the estimability of all parametric functions of the form αi − αi′^ and βj − βj′^.

Case I x x – x x x

  • x x

Case II x x –

  • x x
  • – x

Case III x x – x x –

  • – x

In each case the symbol x indicates an observed factor combination, and the symbol – indicates an unobserved factor combination.

Solution. First note that E[Yij − Yij′ ] = βj − βj′. Therefore in Case I all differences βj − βj′^ are estimable because for some i, Yi,j and Yi,j′^ are both observed. A similar argument applies to αi − αi′. In Case II, α 1 − α 2 is estimated by Y 12 − Y 22 and α 2 − α 3 is estimated by Y 23 − Y 33. Then one can estimate α 1 − α 3 by (Y 12 − Y 22 ) + (Y 23 − Y 33 ). Similarly all differences of β’s are estimable. In Case III, α 1 − α 2 and β 1 − β 2 can be estimated as in Case I. To see that α 1 − α 3 is not estimable, suppose to the contrary that E[

∑ i

∑ j cij^ Yij^ ] = α 1 − α 3. Then the coefficient of β 3 must be zero in this expectation. But β 3 appears only in E[Y 33 ], so we must have c 33 = 0. But then the coefficient of α 3 is also zero, a contradiction. Similar arguments show that no contrasts involving α 3 or β 3 are estimable.

Solution. (a) Write N =

∑ i ni/N^ , Y¯^ =^

∑ i

∑ j Yij /N^ and ¯x^ =^

∑ i nixi/N^. Under H 0 we have a linear regression with least squares estimates

βˆ 1 =

∑k i=

∑ni ∑^ j=1(xi^ −^ x¯)Yij k i=1 ni(xi^ −^ x¯)^2

; βˆ 0 = Y¯ − βˆ 1 x.¯

Under the alternative ̂m(xi) = Y¯i·. Therefore the lack of fit test rejects for large values of

F =

( Y¯i· − Y¯ − βˆ 1 (xi − x¯))^2 /(k − 2) ∑ i

∑ j (Yij^ −^ Y¯i·)^2 /(N^ −^ k)^

which has the Fk− 2 ,N −k distribution if H 0 is true. (b) If no replicated observations are present, one can fit a more complex linear model and test whether the linear model fits as well as the complex model. For instance one might fit a low degree polynomial to the data and test whether the higher degree terms have coefficient zero. One can also examine residual plots and look for substantial departures from a “white noise” pattern. (c) The completed ANOVA table is the following.

Source Sum of Squares d.f. Mean Square Linear regression 69.31 1 69. Lack of fit 3309.93 4 827. Error 83.67 6 13. Corrected total 3462.91 11

The F statistic for lack of fit is 827. 48 / 13 .95 = 59.34, so we conclude that the linear model does not fit the data. Judging from the pattern in the data (large Y values in the middle and small values at the extremes of x), a quadratic term would greatly improve the fit.

  1. Consider the quadratic regression model

Yij = β 0 + β 1 xi 1 + β 2 xi 2 + β 11 x^2 i 1 + β 22 x^2 i 2 + β 12 xi 1 xi 2 + eij

where n observations of Yij are made for each of the following combinations of (xi 1 , xi 2 ): (1, 1), (1, −1), (− 1 , 1), (− 1 , −1) and (0, 0).

(a) Assume n = 1 and β 11 = β 22 = 0. Write the model in matrix form. Which parameters, if any, are estimable?

(b) Under the assumptions of (a), compute a set of least squares estimates. How would your answers change if n > 1?

(c) If n > 1 and we make no assumptions about β 11 and β 22 , how would you estimate σ^2 = Var (eij )?

(d) Can you test H 0 : β 11 + β 22 = 0? You do not need to construct the test statistic, but describe how it could be constructed and state its distribution under H 0.

Solution. (a) In matrix form with n = 1 we have

Y =

    

    

   

β 0 β 1 β 2 β 12

   

  • e

Note that X has full rank since the columns are orthogonal. Therefore all parameters are estimable. (b) It is easy to see that

XT^ X = diag(5, 4 , 4 , 4); XT^ Y =

   

Y 1 + Y 2 + Y 3 + Y 4 + Y 5

Y 1 + Y 2 − Y 3 − Y 4

Y 1 − Y 2 + Y 3 − Y 4

Y 1 − Y 2 − Y 3 + Y 4

   

The least squares solution is

βˆ =

   

(Y 1 + Y 2 + Y 3 + Y 4 + Y 5 )/ 5

(Y 1 + Y 2 − Y 3 − Y 4 )/ 4

(Y 1 − Y 2 + Y 3 − Y 4 )/ 4

(Y 1 − Y 2 − Y 3 + Y 4 )/ 4

   