R语言代写: STT 843 Homework 1 2

STT 843 Key to Homework 1 Spring 2018

Due date: Feb. 14, 2018

4.2. (a) Becauseσ =2,σ =1andρ =0.5,wehaveσ =ρ √σ √σ = √ 11 22 12 12 12 11 22

2/2. Then, the mean and covariance of the bivariate normal is 􏰚 0 􏰛 􏰚 √2 √2/2 􏰛

μ= 2 and Σ= 2/2 1 . Then it follows that |Σ| = 3/2, |Σ|1/2 = 􏰟3/2 and

−1 2 􏰚 1 −√2/2 􏰛 Σ =3 −√2/2 2 .

As a result, the bivariate normal density is
1 􏰤 1 −1􏰚 x1 􏰛􏰥

f(x)=(2π)􏰟3/2exp −2(x1,x2−2)Σ x2−2 1􏰤12√ 2􏰥

= √6π exp − 3(x1 − 2×1(x2 −2)+2(x2 −2) ) . (b) From part (a), we see that

(x−μ)TΣ−1(x−μ)= 2(x21 −√2×1(x2 −2)+2(x2 −2)2). 3

(c) The constant density contours satisfies the equation: (x−μ)T Σ−1(x−μ) = c. The area that this contour contains is described by

R(c) = {(x1, x2) : (x − μ)T Σ−1(x − μ) ≤ c}.

To find the constant density contours that contains 50% probability, we need to determine c such that P {X ∈ R(c)} = 0.5. This is equivalent to find c such that

P {(X1, X2) : (X − μ)T Σ−1(X − μ) ≤ c} = 0.5.

Because (X−μ)T Σ−1(X−μ) follows a chi-square distribution with degrees of freedom 2, the constant c should be the 50% quantile of the chi-square distribution. That is c = χ2,0.5. Thus, the contour that contains 50% probability is

(x − μ)T Σ−1(x − μ) = χ2,0.5 = 1.386294. 1

-2 -1 0 1 2

x1

4.4. (a)

Let c = (3, −2, 1)′. Then, 3X1 − 2X2 + X3 = c′X is linear combination of normally distributed random vector. Thus, c′X has a normal distribution with mean c′μ and variance c′Σc. Here c′μ = 3×2+(−2)×(−3)+1×1 = 13, and

1113 c′Σc=(3,−2,1) 1 3 2  −2 =9.

122 1

Figure 1: The density contour plot that contains 50% probability

(b) Let a = (a1, a2)′. Because X2 and X2 − a1X1 − a2X3 are both normally distributed, X2 and X2 − a1X1 − a2X3 are independent if the covariance between X2 and X2 − a1X1 − a2X3 is 0. Then,

Cov(X2,X2 −a1X1 −a2X3)=σ22 −a1σ21 −a2σ23 =3−a1 −2a2 =0. Any vector a = (a1, a2)′ satisfying condition 3 − a1 − 2a2 = 0 ensures the

independence between X2 and X2 − a1X1 − a2X3.

4.6. (a)
(b) Because σ13 = −1, X1 and X3 are not independent.

Because σ12 = 0, X1 and X2 are independent.

(c) Because σ23 = 0, X2 and X3 are independent.

  1. (d)  Because (σ12, σ32) = (0, 0), (X1, X3) and X2 are independent.
  2. (e)  Because Cov(X1,X1 +3X2 −2X3) = σ11 +3σ12 −2σ13 = 4−2(−1) = 6, X1 and X1 + 3X2 − 2X3 are not independent.

    2

x2

01234

4.7. (a)

(b)

4.16. (a)

The joint distribution of (X1 , X3 )′ is normal with mean (1, 2)′ and co- 􏰚 4 −1 􏰛

variance −1 2 . By Result 4.6 in the textbook, we know that X1 given X3 = x3 is normally distributed with mean μ1 + σ13σ−1(x3 − μ3) =

33
1 + (−1)2−1(x3 − 2) = −0.5×3 + 2 and covariance σ11 − σ13σ−1σ31 =

33
The conditional distribution of X1 given X2 = x2, X3 = x3 is normal with

4 − (−1)2/2 = 3.5. mean

􏰚5 0􏰛−1􏰚x2+1􏰛
1+(0,−1) 0 2 x3−2 =−0.5×3+1

and covariance

􏰚5 0􏰛−1􏰚0􏰛 σ11−(0,−1) 0 2 −1 =3.5.

Because V1 and V2 are linear combinations of X1, · · · , X4, V1 and V2 both have multivariate normal distribution. Therefore, we only need to determine the means and covariances of V1 and V2.
For V1, the mean is

E(V1) = 1E(X1) − 1E(X2) + 1E(X3) − 1E(X4) = 0 4444

and covariance is

Cov(V1) = 1 Cov(X1) + 1 Cov(X2) + 1 Cov(X3) + 1 Cov(X4) = 1Σ. 16 16 16 16 4

Therefore, V1 is normally distributed with mean 0 and covariance 1 Σ. 4

For V2, the mean is
E(V2) = 1E(X1) + 1E(X2) − 1E(X3) − 1E(X4) = 0

and covariance is

Cov(V2) = 1 Cov(X1) + 1 Cov(X2) + 1 Cov(X3) + 1 Cov(X4) = 1Σ. 16 16 16 16 4

Therefore, V2 is normally distributed with mean 0 and covariance 1 Σ. 4

Because (V1′, V2′)′ are linear combinations of X1, · · · , X4, (V1′, V2′)′ is mul- tivariate normally distributed. From part (a), the mean is 0. The covari- ance between V1 and V2 is

Cov(V1, V2) = 1 Cov(X1) − 1 Cov(X2) − 1 Cov(X3) + 1 Cov(X4) = 0. 16 16 16 16

3

4444

(b)

Therefore, the joint distribution of (V1′,V2′)′ is normal with mean 0 and

covariance

04Σ As a result, the joint density of (V1′,V2′)′ is

f(V1, V2) = (2π)−p|1Σ|−1 exp{−1V1′(1Σ)−1V1 − 1V2′(1Σ)−1V2}. 42424

4.18. The maximum likelihood estimator for μ is ̄1􏰍4 􏰚4􏰛

􏰚1Σ0􏰛 41.

Xn=4 Xi=6. i=1

The maximum likelihood estimator for Σ is
ˆ1′ ̄ ̄′􏰚1/21/4􏰛

4.19.

4.21.

4.23.

Σ=4XX−XnXn= 1/4 3/2 .
(a) The distribution of (X1 − μ)′Σ−1(X1 − μ) is chi-square distribution with

degrees of freedom 6.
(b) The distribution of X ̄ is normal with mean μ and covariance Σ/20. The

distribution of √n(X ̄ − μ) is normal with mean 0 and covariance Σ.
(c) The distribution of (n − 1)S is Wishart distribution with degrees of free-

dom 19 and covariance Σ, namely W6(19,Σ).
(a) The distribution of X ̄ is normal with mean μ and covariance Σ/60.

(b) The distribution of (X1 − μ)′Σ−1(X1 − μ) is chi-square distribution with degrees of freedom 4.

(c) The distribution of n(X ̄ − μ)′Σ−1(X ̄ − μ) is chi-square distribution with degrees of freedom 4.

(c) The approximate distribution of n(X ̄ − μ)′S−1(X ̄ − μ) is chi-square dis- tribution with degrees of freedom 4.

(a) The QQ plot is given in Figure 2. Based on the QQ plot, it seems that most data points are along the straight line. This might indicate that normal distribution is appropriate for this data set. However, due to the small sample size, the sample quantile estimated based on 10 data points might not be very informative. Therefore, the conclusion based on the QQ plot might not be reliable for this data set.

(b) Using the formula given in equation (4-31) on page 181, the correlation coefficient rQ is defined by

􏰌nj=1(x(j) − x ̄)(q(j) − q ̄) rQ=􏰠 n 􏰠 n .

􏰌j=1(x(j) − x ̄)2 􏰌j=1(q(j) − q ̄)2 4

Normal Q-Q Plot

-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5

Theoretical Quantiles

4.26.

Figure 2: Q-Q plot of the annual rates of return given in question 4.23

The above coefficient rQ is 0.9470451. The critical value for the test of normality can be found in Table 4.2. For our case, the sample size is 10 and significant level is 10%, the critical value is 0.9351. This means that rQ is larger than the corresponding critical value. Thus, we fail to reject the null hypothesis and conclude that the normality assumption might be appropriate for this data set. We still need to be cautious about this conclusion because the data might not be independent. Therefore, the critical value used in our test might not be appropriate.

(a) Using R, we obtain the mean x ̄ = (5.200, 12.481)′ and sample covariance

as

􏰚 10.62222 −17.71022 􏰛 −17.71022 30.85437 .

Then the squared distances are

    1.8753045 2.0203262 2.9009088 0.7352659 0.3105192
    0.0176162 3.7329012 0.8165401 1.3753379 4.2152799

(b) Comparing the squared distances with the 50% quantile of chi-square distribution with degrees of freedom 2 (i.e., 1.386294), we find that the 4-th, 5-th, 6-th, 8-th and 9-th data points fall within the estimated 50% probability contour of a bivariate normal distribution. The proportion of the observations falling within the contour is 50%.

(c) A chi-square plot is given in the following Figure 4.

5

Sample Quantiles

-10 0 10 20

0 2 4 6 8 10 12

x1

Figure 3: The density contour plot that contains 50% probability and scatter plot of data points

Chi-square plot for χ22

0 2 4 6 8 10 12 14

qchisq(ppoints(500), df = 2)

Figure 4: The chi-square plot for checking normality

6

01234

5 10 15 20

djs

x2

(d) We observe from the chi-square plot given in part (c), most data points except the 10-th data point are along the theoretical line. Therefore, these data are approximately bivariate normal.

7

STT 843 Key to Homework 2 Spring 2018

5.1.

Due date: Mar. 26, 2018

(a) Given the data matrix X, the sample mean is X ̄ = (6,10)′ and sample

5.2.

Then, the Hotelling T 2 test statistic is
T2 =n(X ̄−μ)′S−1(X ̄−μ)=13.63636.

(b) The distribution of the above T 2 statistic is {2(4 − 1)/2}F2,2 = 3F2,2.

(c) The upper α-quantile of F2,2 is 19. Therefore, the T2 test statistic is smaller than the critical value 3F2,2 = 57. The p-value is P(F2,2 > 13.63636/3) = 0.1803, which is bigger than 0.05. We do not have evidence to reject the null hypothesis.

The hypothesis of interest is H0 : μ0 = (9,5)′ vs H1 : μ0 ̸= (9,5). After the transformation, the hypothesis of interest becomes H0 : Cμ0 = C(9, 5)′ = (4,14)′ vs H1 : Cμ0 ̸= (4,14).

Given the data matrix after transformation, the sample mean is X ̄ = (2, 14)′ and sample covariance

􏰚 19 −5 􏰛 S= −5 7 .

Then, the Hotelling T 2 test statistic is
T2 =n(X ̄−μ)′S−1(X ̄−μ)=0.7778=7/9.

Therefore, the T 2 test statistic remains unchanged after the transformation.

5.9. (a)

The large sample 95% simultaneous confidence intervals for μj’s (j = 1,··· ,6) are

(X ̄j −􏰠χ2 􏰠sjj/n,X ̄j +􏰠χ2 􏰠sjj/n). 6;α 6;α

where X ̄j is the sample mean of the j-th variable, χ6;α is the upper α quantile of χ26 and sjj is the sample variance of the j-th variable. Using

1

covariance

􏰚 8 −10/3􏰛 S= −10/3 2 .

the sample mean and sample covariance provided in the question, we can obtain the following simultaneous confidence intervals:

simultaneous simultaneous simultaneous simultaneous simultaneous simultaneous

confidence confidence confidence confidence confidence confidence

interval interval interval interval interval interval

for μ1 : for μ2 : for μ3 : for μ4 : for μ5 : for μ6 :

(69.55347, 121.48653) (152.17278, 176.58722) (49.60667, 61.77333) (83.48823, 103.29177) (16.54687, 19.41313) (29.03513, 33.22487)

The large sample simultaneous confidence intervals are plotted in Figure 1.

(b) The 95% large sample confidence region for μ14 = (μ1, μ4)′ is given by {μ14 : n(X ̄ − μ14)′S−1(X ̄ − μ14) ≤ χ26;α},

where X ̄14 = (95.52, 93.39) and
􏰚 3266.46 1175.50 􏰛

S14 = 1175.50 474.98 .
The ellipse of the confidence region is given by Figure 1.

(c) The Bonferroni 95% simultaneous confidence intervals for μj ’s (j = 1, · · · , 6)

are

(X ̄ −t 􏰠s /n,X ̄ +t 􏰠s /n). j n−1;α/12 j j j n−1;α/12 j j

14

where X ̄j is the sample mean of the j-th variable, tn−1;α/12 is the upper α/12 quantile of tn−1 and sjj is the sample variance of the j-th variable. Using the sample mean and sample covariance provided in the question, we can obtain the following simultaneous confidence intervals:

simultaneous simultaneous simultaneous simultaneous simultaneous simultaneous

confidence confidence confidence confidence confidence confidence

interval interval interval interval interval interval

for μ1 : for μ2 : for μ3 : for μ4 : for μ5 : for μ6 :

(75.55331, 115.48669) (154.99339, 173.76661) (51.01229, 60.36771) (85.77614, 101.00386) (16.87801, 19.08199) (29.51917, 32.74083)

(d) The plot of the Bonferroni confidence rectangle, large sample simulta- neous confidence intervals and confidence region are given by Figure 1.

2

70 80 90 100 110 120

weight

Figure 1: The 95% simultaneous confidence region (solid ellipse), Bonferroni con- fidence rectangle (black dash rectangle) and large sample simultaneous confidence intervals (blue dash rectangle) for (μ1, μ4)′.

3

girth

80 85 90 95 100 105

6.8. (a)

Data in treatment 1 could be decomposed as the following: 􏰚65847􏰛 􏰚4􏰛 􏰚2􏰛 􏰚0 −1 2 −21􏰛

(e) The Bonferroni 95% simultaneous confidence intervals for μj ’s (j = 1, · · · , 6) and μ6 − μ5 are, respectively,

and

j

(X ̄ −X ̄ −t 6 5

n−1;α/14 j j j n−1;α/14

􏰟a′S a/n,X ̄ +t n−1;α/14 67 j n−1;α/14

j j

􏰟a′S a/n). 67

(X ̄ −t 􏰠s /n,X ̄ +t 􏰠s /n)

where a = (1, −1) and

􏰚 9.95 13.88 􏰛 S67 = 13.88 21.26 ,

X ̄j is the sample mean of the j-th variable, tn−1;α/14 is the upper α/14 quantile of tn−1 and sjj is the sample variance of the j-th variable. Using the sample mean and sample covariance provided in the question, we can obtain the following simultaneous confidence intervals:

simultaneous confidence interval for μ1:
simultaneous confidence interval for μ2:
simultaneous confidence interval for μ3:
simultaneous confidence interval for μ4:
simultaneous confidence interval for μ5:
simultaneous confidence interval for μ6:
simultaneous confidence interval for μ6 − μ5: (12.48757, 13.81243)

7 9 6 9 9 = 5 + 3 + −1 1 −2 1 1 Data in treatment 2 could be decomposed as the following:

􏰚312􏰛 􏰚4􏰛 􏰚−2􏰛 􏰚1 −1 0􏰛 3 6 3 = 5 + −1 + −1 2 −1

Data in treatment 3 could be decomposed as the following: 􏰚2532􏰛 􏰚4􏰛 􏰚−1􏰛 􏰚−1 2 0 −1􏰛

3 1 1 3 = 5 + −3 + 1 −1 −1 1

4

(75.13681, 115.90319) (154.79758, 173.96242) (50.91471, 60.46529) (85.61731, 101.16269) (16.85502, 19.10498) (29.48557, 32.77443)

(b) Usingtheinformationinpart(a),weobtainthefollowingone-wayMANOVA table

􏰚 2 􏰛􏰕 􏰖 􏰚 −2 􏰛􏰕 B=5 3 2 3 +3 −1

􏰚 36 48 􏰛 = 48 84

􏰚18 −13􏰛 W= −13 18

􏰚 54 35 􏰛 B+W= 35102

􏰖 􏰚 −1 􏰛􏰕 −2 −1 +4 −3

􏰖

−1 −3

Then, the one-way MANOVA table is given by the following

Source of variation Treatment

Residual

Corrected Total
(c) The Wilks’ lambda Λ∗ is

Degrees of freedom 3-1=2

Matrix sum of squares 􏰚 36 48 􏰛

B= 48 84
􏰚 18 −13 􏰛

5+3+4-3=9 5+3+4-1=11

W = −13 18
􏰚 54 35 􏰛

B + W = 35 102
Λ∗ = |W |/|B + W | = 155/4283 = 0.03618959.

Using Table 6.3,

where

12−3−11−√Λ∗

√Λ∗ 12−3−11−√Λ∗

∼ F4,16, = 17.02656.

3−1

3−1

√Λ∗

We reject the null hypothesis when Λ∗ is small, correspondingly, we reject the null when the above transformed test statistic is large. Therefore, the p-value of the test is P (F4,16 > 17.02656) = 1.282703e − 05. We reject the null hypothesis at the nominal level 0.01.

The Bartlett corrected log-likelihood test statistic is

−(n−1− p+g)log(Λ∗) = −(12−1− 2+3)log(0.0362) = 28.21136. 22

Comparing with the chi-square distribution with degrees of freedom 2(3− 1) = 4, the p-value of the test is P (χ24 > 28.21136) = 1.130111e − 05, which is smaller than the nominal level 0.01. Therefore, we reject the null hypothesis at the nominal level 0.01.

5

6.12. (a)

The conclusion based on the sampling distribution and Bartlett corrected test statistic are the same. The Wilks’ Lambda depends on the normality assumption, while the Bartlett corrected log-likelihood test is an asymp- totic test.

Given the profiles are parallel between μ1 and μ2, the sequential incre- ments in p treatments in μ1 are the same as the sequential increments in p treatments in μ2. This means that if the profiles are parallel, the following equalities are true

μ1i−μ1(i−1) =μ2i−μ2(i−1) fori=2,···,p. (1)

If the p treatments in population 1 are linear, it implies that the incre- ments in nearby treatments are equal to each other. Specifically, it means the following equalities are true

{μ1i − μ1(i−1)} − {μ1(i−1) − μ1(i−2)} = 0 for i = 3, · · · , p. (2) Similarly, if the p treatments in population 2 are linear, it implies that

the following equalities are true
{μ2i − μ2(i−1)} − {μ2(i−1) − μ2(i−2)} = 0 for i = 3, · · · , p. (3)

Because equations in (1) are given (known to be true), examining equa- tions in both (2) and (3) is equivalent to examining following equations

{μ1i − μ1(i−1)} − {μ1(i−1) − μ1(i−2)} + {μ2i − μ2(i−1)} − {μ2(i−1) − μ2(i−2)} = {μ1i − μ1(i−1) + μ2i − μ2(i−1)} − {μ1(i−1) − μ1(i−2) + μ2(i−1) − μ2(i−2)}

=0 fori=3,···,p. (4) Thus, to test that the profiles are linear, according to equations in (4),

the hypothesis could be written as, for i = 3, · · · , p,
H0 : {μ1i+μ2i}−{μ1(i−1)+μ2(i−1)} = {μ1(i−1)+μ2(i−1)}−{μ1(i−2)+μ2(i−2)}.

It is not difficult to check that the above hypothesis could also in a matrix form as specified in the question.

Plugging in the values of x ̄1,x ̄2,Spooled and the matrix C, we obtain that T 2 = 16.83613. Meanwhile, the cutoff value is

(30 + 30 − 2)(4 − 2) F2,30+30−4+1;α = 58 × 2 3.1588 = 6.4285. 30+30−4+1 57

Because T2 > 6.4285, we reject the null hypothesis. This indicates that the profiles are not linear.

6

(b)

180 200 220 240 260 280

Tail Length

Figure 2: 6.20. (a)

(b)

Scatter plot of tail length versus wing length for male hook-billed kites.

The scatter plot of the tail length versus the wing length is given in the Figure 2. It is clear that one observation with x1 = 284 is very different from the most of observations. This data point could be considered as an outlier.

To test the equality of mean vectors μ1 (for male) and μ2 (for female), we applied the Hotelling’s T2 test statistic, which can be computed as following

T2=( n1n2 )(X ̄1−X ̄2)′S−1 (X ̄1−X ̄2). n1 + n2 pooled

For these data sets, X ̄1 = (189.31, 280.87)′, X ̄2 = (193.62, 279.78)′ and Spooled= n1−1 S1+ n2−1 S2

n1 +n2 −2 􏰚 207.7298 = 100.8987

n1 +n2 −2 100.8987 􏰛

Then, the Hotelling’s T 2 test statistic
the test statistic follows distribution
1)}Fp,n1+n2−p−1. The critical value for the test is 6.273886 at the nom- inal level α = 0.05. Thus, we do not have evidence to reject the null hypothesis.

If the outlier #31 is removed from the male data set, the Hotelling’s T2 test statistic is T 2 = 24.9649, which should be compared with {(n1 + n2 −

7

188.8975 .

is T 2 = 3.642538. Under the null, {(n1 + n2 − 2)p/(n1 + n2 − p −

Wing Length

260 270 280 290 300 310

2)p/(n1 + n2 − p − 1)}Fp,n1+n2−p−1;α = 6.277257. In this case, we can reject the null hypothesis.

If we replace the x1 coordinate of #31 observation with x1 = 184, the Hotelling’s T 2 test statistic is T 2 = 25.66253, which should be compared with {(n1 + n2 − 2)p/(n1 + n2 − p − 1)}Fp,n1 +n2 −p−1;α = 6.273886. In this case, we can reject the null hypothesis.

The linear combinations a′(X ̄1 − X ̄2) that are most responsible for the rejection is the vector a that maximizes the following quantity

aˆ=argmaxa′(X ̄1 −X ̄2)(X ̄1 −X ̄2)′a, a a′Spooleda

which is the square of the signal-to-noise ratio. Let
A = S−1/2 (X ̄1 − X ̄2)(X ̄1 − X ̄2)′S−1/2 .

pooled We note the following

max a′(X ̄1 − X ̄2)(X ̄1 − X ̄2)′a = a a′Spooleda

max

b=S1/2 pooled

pooled

b′Ab = max c′Ac a b′b c′c=1

By the above derivation, it can be seen that the vector c that maxi-

mizes the above objective function is the eigenvector of A correspond-

ing to the largest eigenvalue of A. It is not difficult to see that A

is a matrix with rank one. Thus, the large eigenvalue of A is λ1 =

(X ̄1 − X ̄2)′S−1 (X ̄1 − X ̄2) with the corresponding eigenvector c = pooled √

S−1/2 (X ̄1 − X ̄2)/ λ1. Then, the value b maximizes the above objec- pooled

tive function is b = S−1/2 (X ̄1 − X ̄2). It follows that the value a that pooled

maximizes the objective function is aˆ = S−1 (X ̄1 − X ̄2). pooled

For the test with 􏰚 207.7298

outlier #31 removed, the vector aˆ is
100.8987 􏰛−1 􏰚 −6.463131 􏰛 􏰚 −0.15661407 􏰛

aˆ = 100.8987 For the test with

188.8975 1.176768 = 0.09342743 . the outlier #31 replaced, the vector aˆ is

􏰚 103.6389 aˆ = 105.2927

105.2927 􏰛−1 􏰚 −6.533333 􏰛 􏰚 −0.15885637 􏰛 188.8975 1.088889 = 0.09431202 .

Based on the above results, we see that there are significant differences among the results with outliers been handled or not. However, the dif- ferences among the the results with outlier deleted or replaced are not very significant. Both methods for handling outlier in this data set is comparable.

8

(c) The 95% confidence region for μ1 − μ2 is given by the following ellipse {μ1 − μ2 : ( n1n2 )(X ̄1 − X ̄2)′S−1 (X ̄1 − X ̄2) ≤ cα}

n1 + n2 pooled
where cα = 2(n1 + n2 − 2)Fp,n1+n2−p−1;α/(n1 + n2 − 3).

The Bonferroni 95% simultaneous confidence intervals for μ1j − μ2j (j = 1, 2) are given by

X ̄ − X ̄ ± t 􏰠 ( n + n ) s / ( n n ) . 1j 2j n1+n2−2;α/4 1 2jj 12

where sjj is the j-th diagonal element of Spooled, and tn1+n2−2;α/4 is the upper α/4 quantile of a t-distribution with degrees of freedom n1 + n2 − 2. The simultaneous confidence intervals for μ11 − μ21 and μ12 − μ22 are, respectively, (-11.411601, -1.475198) and (-5.504445, 7.911261).

The confidence region and simultaneous confidence intervals are given in the Figure 3

-12 -10 -8 -6 -4 -2 0

tail length difference

Figure 3: Confidence region and simultaneous confidence intervals for μ1 − μ2.

(d) Based on the confidence region and simultaneous confidence intervals, we see that there is no significant difference in wing length between male and female. However, there exists significant difference in tail length between male and female. Female birds have longer tail length than male birds.

6.24. The one-way MANOVA table is given by the following

9

wing length difference

-10 -5 0 5 10

Source of variation Treatment

Residual

Matrix sum of squares D.F.  150.20 20.30 −161.83 5.03 

B =  20.30 20.60 −38.73 6.43  2  −161.83 −38.73 190.29 −10.86 

5.03  1785.40

6.43 172.5 1924.3

−10.86 128.97 178.80

2.02 289.63 

W =  172.50
 128.97 178.8 2153.00 −1.70 

289.63 171.9 −1.70 840.20
 1935.60 192.80 −32.87 294.67 

B + W =  192.80 1944.90 140.07 178.33  89  −32.87 140.07 2343.29 −12.56 

171.90  87

Corrected Total
Using the above table, the Wilks’ lambda test statistic is

294.67 178.33 −12.56 842.22

Using Table 6.3,

where

Λ∗ = |W | = 0.8301027. |B + W |

90−4−21−√Λ∗

√Λ∗ 90−4−21−√Λ∗

∼ F8,168, = 2.049069.

4

4

√Λ∗

We reject the null hypothesis when Λ∗ is small, correspondingly, we reject the null when the above transformed test statistic is large. Therefore, the p-value of the test is P (F8,168 > 2.049069) = 0.04358254. We reject the null hypothesis at the nominal level 0.05.

The 95% Bonferroni simultaneous confidence intervals for means differences among three periods, for i ̸= j ∈ {1,2,3} and k = 1,··· ,4,

􏰦wkk ni+nj X ̄ik−X ̄jk±tn−g; α n−g nn ,

where wkk is the k-th diagonal element of W given in the above one-way MANOVA table. The simultaneous confidence intervals are given in the fol- lowing:

μ11 − μ21: (-4.442, 2.442) μ11 − μ31: (-6.542, 0.342) μ21 − μ31: (-5.5423, 1.342) μ12 − μ22: (-2.673, 4.473) μ12 − μ32: (-3.773, 3.373) μ22 − μ32: (-4.6737, 2.473) μ13 − μ23: (-3.680, 3.880) μ13 − μ33: (-0.646, 6.913) μ23 − μ33: (-0.7467, 6.813) μ14 − μ24: (-2.061, 2.661) μ14 − μ34: (-2.394, 2.328) μ24 − μ34: (-2.6947, 2.028)

There are two assumptions we need to check for the usual MANOVA model. One the normality assumption and another is the homogeneity of covariance

10

pg(g−1) i j

6.37.

6.39.

Figure 4: Chi-square plot for checking joint normality assumption.

Applying Box’s M test on the homogeneity of covariance matrices, we obtain the test statistics as 23.405, which can be compared to chi-square distribution with degrees of freedom 6. Then the resulting p-value is 0.0006716. Therefore, we reject the hypothesis and conclude that the female and male groups have different covariance matrices.

(a) To obtain the Hotelling’s T 2 test statistic, we note X ̄1 = (348.275, 37.26357)′, X ̄2 = (228.753, 7.290357)′ and

􏰚 2606.3882 667.9435 􏰛 Spooled = 667.9435 204.2362 .

Then the Hotelling’s T 2 test statistic is

T 2 = ( n1n2 )(X ̄1 − X ̄2)′S−1 (X ̄1 − X ̄2) = 76.91534.

11

matrices. For the homogeneity of covariance matrices, we could perform Box’s M test for comparing covariances among three periods. The Box’s M test statistic is 21.048. Comparing it with the chi-square distribution with degrees of freedom 20, we obtain p-value 0.3943. Thus, it is reasonable to assume covariances are the same for this data set.

To check the joint normality assumption, we can construct chi-square plots using residuals and pooled sample covariance. The chi-square plot is given in 4. Based on the chi-square plot, we may conclude that the joint normality assumption is reasonable for this data set.

Chi-square plot for χ24

0 5 10 15

qchisq(ppoints(500), df = 4)

n1 + n2

pooled

0 5 10 15

djs

Under the null, the test statistic follows distribution {(n1 + n2 − 2)p/(n1 + n2 − p − 1)}Fp,n1+n2−p−1. The critical value for the test is 6.462936 at the nominal level α = 0.05. Thus, we have enough evidence to reject the null hypothesis.

  1. (b)  To check if it is reasonable to pool variances in this data set, we perform a Box’s M test on testing the homogeneity of covariance matrices. The Box’M test statistic is 100.32. We compared the test statistic with a chi- square distribution with degrees of freedom 3. Then the resulting p-value is <2.2e-16. Therefore, we reject the hypothesis and conclude that the female and male groups have different covariance matrices.

    If the sampling distribution in part (a) is used for the two sample test, then it is not appropriate to pool two variances together because the sample distribution was derived under the assumption that two covariance matrices are the same. However, if the large sample distribution is used, it is still appropriate to pooled the sample variances together because these two samples have the same sample size.

  2. (c)  The Bonferroni 95% simultaneous confidence intervals for μ1j − μ2j (j = 1, 2) are given by

    X ̄ −X ̄ ±t 􏰟s/n+s/n.

1j 2j n1+n2−2;α/4 11 1 22 2

where sjj is the j-th diagonal element of Spooled, and tn1+n2−2;α/4 is the upper α/4 quantile of a t-distribution with degrees of freedom n1 + n2 − 2. The simultaneous confidence intervals for μ11 − μ21 and μ12 − μ22 are, respectively, (88.062, 150.980) and (21.166, 38.779).

12