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

Assignment 2

2020

Part one

1.  (Total for Q1:  11 points)

a.  (5 points) Here are the numbers of degrees of freedom: dfT R  = a − 1 = 5 − 1 = 4, and dfE  = 30 − 5 = 25.

MSE  = MST R /F = 84.655/7.0866 = 11.94579. Here are the sum of squares:

SSE  = dfE MSE  = 25 (11.94579) = 298.6447;   SST R  = dfT R MST R  = 4 (84.655) = 338.62.

p-value

 

 

b.  (1 point) The evidence that the means differ is is significant (F (4, 25) = 7.0866, p = .00059).

c.  (3 points) We estimate the error variance to be 2  = MSE  = 11.9458. The coefficient of determination is equal to

R2  =  =  = 0.5313.

The observed value of Cohen’s f is

fˆ =  =  = 0.9720.

d.  (2 points) A 95% confidence interval for µ 1 µ2  is

y¯1  y¯2 ± t0 .025;25 ^MSE ^1/n1 + 1/n2  = (−2.996, 5.223)

where t0 .025;25  = 2.05954, n1  = n2  = n = 6, y¯1  = 9.315 and y¯2  = 8.202, and MSE  = 11.94579.

2.  (Total for Q2:  3 points)

(a)  (1 point) We are not assigning the need to go the ER to the patients, so it is an observational study. (b)  (2 points) If your condition is serious, regardless if it is the weekend or not, you should seek medical help. The higher risk of death associated to the weekend can probably explained by confounders. It is

most likely that your chances of death are not related to the weekend, but rather they are related to the seriousness of your condition.


(c)  Many answers are acceptable here . It is possible that there are more extreme cases on the weekend at the ER. For example, many people have riskier behaviour on the weekend, like extreme sports, and abuse of alcohol, which might lead to a higher chance of serious injury. A person might also wait until the weekend because of work, but this might have worsened the condition. So a possible confounder is the seriousness of the condition.  Once we adjust for this confounder, it might be possible that there are no difference between the weekend and the weekdays.

3.  (6 points)

(a)  (2 points) The officer’s are given a photo with or without eye contact. This defines an experimental

factor with  2 levels.   The corresponding experimental unit is the officer.   They are also blocking according the officer’s gender.  This blocking variable is an observational factor.   So it is a mixed

study, i.e. both experimental and observational.

(b)  (3 points)

• The eye contact factor has 2 levels: eye contact, no eye contact.

• The blocking factor has two levels: MALE, FEMALE.

• The factor level combinations are (eye contact, MALE), (eye contact, FEMALE), (non eye contact, MALE), (no eye contact, FEMALE).

(c)  (1 point) It is a complete randomized blocking design (CRBD).

(d) The experimental unit is the officer .

4.  (4 points) These are paired data. A 95% confidence interval for the mean difference µD  between the stroke volume before the exercising program and after the program is

d¯± t0 .025;10   = (−17.837, −8.163),

where d¯ = 70 − 83 = − 13, t0 .025;10  = 2.2281, sd  = 7.2, and n = 11.  We are confident that the mean

 

Part Two

5.  (Total points for Q5:  6 points)

We import the data and display the structure of the dataframe.

RadialTires<-read .csv ( "RadialTires .csv")

str (RadialTires)

##  ’data .frame’:        8  obs .  of    3  variables:

##   $  Car        :  int    1  2  3 4  5  6  7  8

##   $ Brand .1: num   36 .9 43 .3  36 .2  32 .1  37 .2  . . .

##   $ Brand .2: num   34 .3 42 .3  35 .5  31 .9  38  . . .

(a)  (2  points) According to Student’s paired $t$0test, the brand effects are not significant  (T (7)  =

1.8091; p = .1134).


with (RadialTires,t .test (Brand.1,Brand.2 ,paired=TRUE))

 

##

##    Paired  t-test

##

##  data:    Brand . 1  and  Brand .2

##  t  =  1 .8091,  df  =  7,  p-value  =  0 . 1134

##  alternative  hypothesis:  true  difference  in  means  is  not  equal  to  0

##  95  percent  confidence  interval:

##   -0 .1898828    1 .4266328

##  sample  estimates:

## mean  of the differences

##                               0 .618375

(b)  (2 points) A 95% confidence interval for the difference in the mean life (in kilometres) between brand 1 and brand 2 is (−0.19, 1.43). We should not have favour any of the two brands.

(c)  (2 points)

There is a linear tendency in the normal probability for the difference in the lifetime between the two brands. The plot suggest that the difference between the lifetimes is normally distributed.

source ("MyFunctions .r")

with (RadialTires,ppnorm(Brand.1-Brand.2))

 

99.9

99

90

75

50

25

5

1

0.1


Normal Probability Plot

 

 

 

−1                   0                    1                    2                    3

Sample Quantiles


 

6.  (4 points)

The power function is

Power(n) = P (F F0 .05;a 1=2,N a=3 n 3 ),

where F has an F (a − 1 = 2, N a = 3 n − 3, λ = N f2  = 3 n (0.25)2 ) distribution.

We define an R function to compute the power as a function of n.

power<-function(n)

{

1-pf(qf(0.95 ,2 ,3*n-3),2 ,3*n-3 ,3*n* .25 ˆ2)

}


We evaluate the power function at n = 2, 3, 4, and so on until the power is at least 0.8.

n<-1

repeat

{

n<-n+1

if  (power (n)>=0.8) break ;

}

n

 

##  [1]  53

We require 53 experimental units per treatment group.