STAT120C Homework 3 - ics.uci.eduzhaoxia/teaching/stat120c/hw3_2018.pdf · STAT120C Homework 3 1....

2

Click here to load reader

Transcript of STAT120C Homework 3 - ics.uci.eduzhaoxia/teaching/stat120c/hw3_2018.pdf · STAT120C Homework 3 1....

Page 1: STAT120C Homework 3 - ics.uci.eduzhaoxia/teaching/stat120c/hw3_2018.pdf · STAT120C Homework 3 1. Assume that we have Iindependent random samples ... Apply the Bonferroni method to

STAT120C Homework 3

1. Assume that we have I independent random samples. For i = 1, · · · , I, we assume that the ith randomsample (Yi1, Yi2, · · · , YiJ) came from the normal distribution with with mean µi and variance σ2. Theseassumptions can be summarized using the following statistical model:

Yij = µi + εij , i = 1, · · · , I ; j = 1, · · · , J

where εijiid∼ N(0, σ2). Show that the MLE of µi is µi = Yi· = 1

J

∑Jj=1 Yij .

2. The statistical model of Problem 2 can also be written to

Yij = µ+ αi + εij , i = 1, · · · , I ; j = 1, · · · , J

where εijiid∼ N(0, σ2) and

∑Ii=1 αi = 0. Derive the MLEs for µ, and αi

3. Consider two independent random samples. The first one Y1,1, · · · , Y1,9 is a random sample fromN(µ1, σ

2) and the second one Y2,1, · · · , Y2,9 is a random sample from N(µ2, σ2). The parameters

µ1, µ2, σ2 are unknown. We want to conduct hypothesis tesing

H0 : µ1 = µ2 v.s. H1 : µ1 6= µ2

If we use the two-sample t-test, we would calculate the following test statistic

T =Y1· − Y2·√s2p( 1

9 + 19 )

where Yi· =∑J

j=1 Yij , i = 1, 2 and s2p =

∑2i=1

∑9j=1(Yij−Yi·)

2

9+9−2 . If we use the F-test from one-way ANOVA,we would calculate the following test statistic

F =SSB/(2− 1)

SSW/(2× (9− 1))

where SSB = 9∑2

i=1(Yi· − Y··)2 and SSW =∑2

i=1

∑9j=1(Yij − Yi·)2.

Show that F = T 2. (Hint: show that Y1· − Y ·· = 12 (Y1· − Y2·) and Y2· − Y ·· = − 1

2 (Y1· − Y2·))

4. The concentration (in nanogram per milliliter) of plasma epinephrine were measured for 30 dogs,with 10 dogs under each of the three anesthesia methods: isofluorane, halothane, and cyclopropaneanesthesia; the measurements are given in the following table (Perry et al. 1974). One scientificquestion is whether there is a difference in treatment effects. Answer the following questions. Whenappropriate, relevant R code and output should be handed in.

Dog Dog Dog Dog Dog Dog Dog Dog Dog Dog1 2 3 4 5 6 7 8 9 10

Isofluorane .28 .51 1.00 .39 .29 .36 .32 .69 .17 .33Halothane .30 .39 .63 .68 .38 .21 .88 .39 .51 .32

Cyclopropane 1.07 1.35 .69 .28 1.24 1.53 .49 .56 1.02 .30

(a) State the null and alternative hypothesis. Which test should be used to condcut hypothesistesting? Be sure to state the test statsitic and its null distribution.

1

Page 2: STAT120C Homework 3 - ics.uci.eduzhaoxia/teaching/stat120c/hw3_2018.pdf · STAT120C Homework 3 1. Assume that we have Iindependent random samples ... Apply the Bonferroni method to

(b) What assumptions do you make about the data in order to derive the null distribution of the teststatistic?

(c) Use the following R code to read data. Calculate the sum of squares using R and then calculatethe test statistic. Note, you CANNOT use the “aov” in R, but you can use other functions, suchas “mean”, “sum”, “var”, etc. Construct the anova table, which includes sources of variability,sums of squares, means of squares, degrees of freedom, and F statistic. Should you reject the nullhypothesis at level α = 0.05?

#read data into R

iso = c(.28, .51, 1.00, .39, .29, .36, .32, .69, .17, .33)

hal = c(.30, .39, .63, .68, .38, .21, .88, .39, .51, .32)

cyc = c(1.07, 1.35, .69, .28, 1.24, 1.53, .49, .56, 1.02, .30)

(d) Use the function “aov” in R to confirm the results you just obtained. Do you get the same resultsand conclusion? The following R code is useful.

#put them into a single vector

y = c(iso, hal, cyc)

#create the treament variable

treatment = factor(rep(c("iso","hal","cyc"), each=10))

#use the "aov" function to create an object ...

#use the "summary" function see the ANOVA table

(e) Apply the Bonferroni method to find a set of simultaneous 95% confidence intervals for the pairwisecomparisions.

2