Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


STAT 404 Midterm Exam


●  Put your name and student ID on the up-right corner of every sheet.

● You must write your solutions on paper (not on a device). Use a camera or scanner to upload your written solutions to Canvas as a PDF.

●  Correct answers are usually short. Please be brief and answer the questions with complete sentences.

●  R is allowed only for manual calculations like on the assignments. Answers obtained using one-line R commands will not be accepted.

●  Submit the R commands you used as a runnable script in a separate  .txt file.  It must be clear which question the code corresponds to.  If the code is taken from somewhere, cite the source of the code.

●  Common notations and model assumptions are assumed in the problems unless otherwise specified. Use the conventional 5% level for tests, hypothesis for two-sided alternative, and 95% confidence level unless otherwise specified.


1.  [6] Name and explain (in complete sentences) the three principles in design of experiments that were emphasized in STAT 404 lectures.

Use your own discretion to decide how much to write based on the following example:

Random variable:  a function defined on sample space.  It provides  a numerical summary of the output of an experiment.


2.  Consider a two-sample problem based on self-reported body temper- atures of 15 male and 20 female students.   Suppose that the equal variance assumption holds.  We wish to test the equal mean tempera- ture null against the one-sided alternative that male students have a higher mean body temperature at nominal level 4%.

A student mistakenly uses the critical value from the 4% level two-sided t-test as the critical value in their one-sided t-test.

(a)  [2] What is the actual size of the type I error of the student’s test?

(b)  [2] If the alternative hypothesis holds in the specific application,

is the power of the student’s test higher or lower than the correct one-sided t-test?

Reminder: answer these questions in complete sentences and explain your answer.


3. A linear regression model assumes that the response values in an ex- periment can be expressed as

yi  = xi(T)β + ei

for i = 1, 2, . . . , n, where xi(T)β is the expected value of yi  and ei ’s are iid N(0, σ2 ).

We collected data on gender (x1 , coded binary as -1 (F) and 1 (M)), length of right foot (x2 , in cm), and response height (y, in cm).  The data are posted as Midterm2021Q3.txt on Canvas for ease of numerical computation.

Note that in this case, x = (x0 , x1 , x2 )T  and β = (β0 , β1 , β2 )T .

You can use the following code to load the design matrix X and response vector Y into R:


#  load  data  (already  encode  gender  into  -1,  1)    data  =  read.delim("Midterm2021Q3.txt",  se  =  ",") X  =  cbind(1,data$gender,  data$foot.length)

Y  =  data$height


(a)  [4] For the given data set, obtain the least squares estimates of β .

(b)  [4] Estimate the error variance σ 2  (use the method given in class).

(c)  [4] Estimate the variance matrix of βˆ .

(d)  [4] Construct 95%, two-sided individual (not simultaneous) CIs for β1  and β2  (effects of gender and foot-length). Hint: remember the general recipe for CI construction.

(e)  [4] Estimate the variance of βˆ2 _ βˆ1  (both LS estimators).


4. Consider a hypothetical one-way layout comparing k = 5 treatments. The response values are given as follows:


yy1  =  c(11.44,11.15,10.94,12.38,  9.24)

yy2  =  c(10.40,  13.16,13.53,11.54,12.39,12.59,11.50,11.81)         yy3  =  c(15.66,16.22,13.68,13.81,13.09,15.51,14.74,14.57,14.52) yy4  =  c(10.04,  8.76,  8.26,  7.92)

yy5  =  c(11.20,12.74,10.97,13.80,11.75,10.77,13.51)


(a)  [4] Compute the treatment sum of squares, SS(trt).

(b)  [4] Compute the error sum of squares (also called residual), SS(err).

(c)  [4] Complete the one-way layout ANOVA table.

Source DF   SS   MSS   F

Treatment

Error

Total


5.  Continuing the last problem:


(a)  [4] Test the hypothesis that all treatment means are equal at the

5% level.  Be sure to state the null and alternative hypotheses, and state what the test statistic is and its reference distribution. Then, clearly state your conclusions.

(b)  [4] Construct simultaneous 95% confidence intervals for mean dif-

ferences using Tukey’s method, but present only the first three (that is, 1 vs 2; 1 vs 3; 2 vs 3).

(c)  [3] Find the estimated effects of the 5 treatments and the estimated error variance (i.e., j  and 2 ).

(d)  [4] Suppose the true effects of the 5 treatments are the same as the estimates found in part (c), but the true error variance is ten times larger than the estimate. What is the power of the test for H0  : τ1  = . . . = τ5 ?


6.  Continuing the last problem:


(a)  [4] Suppose the random effects model is more suitable instead so that the variance of the treatment effect is στ(2) .

Obtain an expression for E [(1. _ y¯2. )2] in terms of στ(2)  and σ 2 .

(b)  [4] Based on your result in (a), provide a sensible estimate of στ(2) .

Use your estimate 2  from (Q5c) for σ 2 .


7.  [5] Someone claims that the ratio of height over foot-length is larger for males than females.

Using a randomization test with the data we collected (Midterm2021Q3.txt from Q3), provide your opinion on this claim as a statistician.

Note: computing all permutations is infeasible due to the size of this data set. You may estimate the p-value via simulations.