AMS572.01 Midterm Exam Fall, 2011

AMS572.01
Midterm Exam
Fall, 2011
Name _______________________________ID _________________________Signature_________________________
Instruction: This is a close book exam. Anyone who cheats in the exam shall receive a grade of F. Please provide
complete solutions for full credit. The exam goes from 12:50 – 2:10pm. Good luck!
1. The effect of caffeine levels on performing a simple finger tapping task was investigated in a double blind
study. Twenty male college students were trained in finger tapping and randomly assigned to receive two
different doses of caffeine (0 or 100 mg) with 10 students per dose group. Two hours following the caffeine
treatment, students were asked to finger tap and the numbers of taps per minute were counted. The data are
tabulated below.
Caffeine Dose
Finger Taps per Minute
0 mg
242 245 244 248 247 248 242 244 246 242
100 mg
248 246 245 247 248 250 247 246 243 244
(a) Compare the finger tapping speed between the two groups at α =.05. List assumptions necessary – and,
please perform tests for the assumptions that you can test in an exam setting.
(b) Please write up the entire SAS program necessary to answer question raised in (a), including the data step,
and the tests for all assumptions necessary.
Answer:
(a) This is inference on two population means, independent samples. The first assumption is that both
populations are normal. The second is the equal variance assumption which we can test in the exam setting
as the follows.
Group 1 (dose 0 mg): X 1  244.8 , s12  5.73 , n1  10
Group 2 (dose 100 mg): X 2  246.4 , s22  4.27 , n2  10
Under the normality assumption, we first test if the two population variances are equal. That is, H 0 :  12   22 versus
H a :  12   22 . The test statistic is
F0 
s12 5.73

 1.34 , F9,9,0.05,U  3.18 .
s22 4.27
Since F0 < 3.18, we cannot reject H0 . Therefore it is reasonable to assume that  12   22 .
Next we perform the pooled-variance t-test with hypotheses H 0 : 1   2  0 versus H a : 1  2  0
t0 
X 1  X 2  0  244.8  246.4   0

 1.6
1 1
1 1
sp

5

n n2
10 10
Since t0  1.6 is NOT smaller than t18,0.025  2.10092 , we can NOT reject H0 and thus, we conclude that the
finger tapping speed are NOT significantly different between the two groups at the significance level of 0.05.
data finger;
input group taps @@;
datalines;
0 242 0 245 0 244 0 248 0 247 0 248 0 242 0 244 0 246 0 242
1 248 1 246 1 245 1 247 1 248 1 250 1 247 1 246 1 243 1 244
;
run;
1
proc univariate data = finger normal;
class group;
var taps;
run;
proc ttest data = finger;
class group;
var taps;
run;
proc npar1way data = finger;
class group;
var taps;
run;
2. Suppose we have two independent random samples
X 1 , X 2 , , X n1 ~ N  1 ,  12  , and Y1 , Y2 , , Yn2 ~ N  2 ,  22  .
from
two
normal
populations:
2
2
2
2
(a) At the significance level α, please construct a test of the hypothesis H 0 :  1  3 2  0 versus H a :  1  3 2  0 .
(b) Suppose we have confirmed that  12  3 22  0 . At the significance level α, please construct a test to test
H 0 : 31  22  4  0 versus H a : 31  22  4  0 using the pivotal quantity method. Please include the
derivation of the pivotal quantity, the proof of its distribution, and the derivation f the rejection region for full credit.
Answer: Recall we had a more general setting of this problem in Midterm 2010, see below.
All we need to do is to plug in a = 1, b = 3 for part (a), and c = 3, d = 4, e =2 for part (b).
General setting of the problem: Suppose we have two independent random samples from two normal populations i.e.,
X1, X 2 ,
, X n1 ~ N  1 ,  12  , and Y1 , Y2 ,
, Yn2 ~ N  2 ,  22  .
(a). At the significance level α, please construct a test of the hypothesis Ho: a 1  b 2 vs. H1: a 12  b 22 . Here a, b
are known constants.
2
2
(b). Suppose we have confirmed that a 1  b 2 . At the significance level α, please construct a test to test whether
2
2
c1  d  e2 or not using the pivotal quantity method. Here c, d , e are known constants. Please include the derivation
of the pivotal quantity, the proof of its distribution, and the derivation of the rejection region for full credit.
SOLUTION:
This is inference on two normal population means, independent samples.
2
2
2
2
(a) This is the usual F-test on two normal population variances: H 0 :  1 /  2  b / a versus H a :  1 /  2  b / a
The test statistic is: F0 
S12 / S 22
S12 / S 22 H 0

~ Fn1 1,n2 1
2
2
 1,0
/  2,0
b/a
At the significance level α, we will reject H0 if F0 is smaller than Fn1 1,n2 1, / 2, L or F0 is greater than Fn1 1,n2 1, / 2,U
b 2
 . Here is a simple outline of the derivation of the test:
a
H 0 : c1  d  e2 versus H a : c1  d  e2 , which are equivalent to: H 0 : c1  e2  d versus
2
2
2
2
2
(b) Given that a 1  b 2 , we set  2   and thus  1 
H a : c1  e2  d
2


(a) We start with the point estimator for the parameter of interest  c1  e2  : cX  eY . Its distribution is
N c1  e2 ,  2  c 2b /  an1   e2 / n2  using the mgf for N  ,  2  which is M t   exp t   2 t 2 / 2 ,


and the independence properties of the random samples. From this we have
Z
 cX  eY    c
1
 e 2 
 c 2b /  an1   e2 / n2
~ N  0,1 . Unfortunately, Z can not serve as the pivotal quantity because σ is
unknown.
(b) We next look for a way to get rid of the unknown σ following a similar approach in the construction of the pooled-
a

2
variance t-statistic. We found that W    n1  1 S12   n2  1 S 22  /  2 ~  n21  n2  2 using the mgf for  k
b

 1 
which is M t   

 1  2t 
k/2
, and the independence properties of the random samples.
(c) Then we found, from the theorem of sampling from the normal population, and the independence properties of the
random samples, that Z and W are independent, and therefore, by the definition of the t-distribution, we have
 cX  eY    c
obtained our pivotal quantity: T 
1

 e 2 
a
 n1  1 S12   n2  1 S22
b
* c 2b /  an1   e 2 / n2
n1  n2  2
~ tn1  n2  2 .

(d) The rejection region is derived from P T0  c | H 0   , where
T0 
 cX  eY   d
H0
a
 n1  1 S12   n2  1 S22
b
* c 2b /  an1   e 2 / n2
n1  n2  2
~ tn1  n2  2 . Thus c  t n1  n2  2, / 2 . Therefore at the
significance level of α, we reject H 0 in favor of H a iff T0  t n1  n2 2, / 2
iid
3. We have two independent samples X1 ,
, X n1 ~ N ( 1 , 12 ) and Y1 ,
iid
, Yn2 ~ N (2 ,  22 ) , where
 H 0 : 1  2  0
 12   2 2   2 and n1  2n2 . For the hypothesis of 
 H a : 1  2    0
(a) Please derive the general formula for power calculation for the pooled variance t-test based on an effect
size of EFF at the significance level of α.

Recall - Definition: Effect size = EFF =| | (e.g. Eff=1)

(b) With a sample size of 40 in group 1, and 20 in group 2, α = 0.05, and an estimated effect size ranging from
0.8 to 1.2, please calculate the power of your pooled variance t-test.
Answer:
(a) Let n2  n, thus n1  2n2  2n
3
T.S : T0 =
(X Y)  0
( X  Y ) H0

~ t3 n  2
1 1
3
Sp

Sp
n1 n2
2n
At α=0.05, reject H 0 in favor of H a iff T0  t3n2,
Power = 1-β = P(reject H 0 | H a ) = P(T0  t3n2, | H a : 1  2    0)
= P(
= P(
(X Y)
 t3n2, | H a : 1  2  )
3
Sp
2n
(X Y)  

 t3n2, 
| H a : 1  2  )
3
3
Sp
Sp
2n
2n
≈ P(T  t3n2,  Eff *


2n
)
| H a : 1  2  ) (Effect size = 
 Sp
3
(b) With n = 20, α = 0.05, Eff = 0.8 to 1.2, the power is calculated as follows:

Power (Eff = 0.8) = P  T  t58,0.05  0.8*


40
| H a : 1  2   
3

 P T  1.67  2.92  P T  1.25  0.8918

Power (Eff = 1.2) = P  T  t58,0.05  1.2*


40
| H a : 1  2   
3

 P T  1.67  4.38  P T  2.71  0.9956
Note: the T statistic above follows a t-distribution with 58 (=40+20-2) degrees of freedom.
Therefore we conclude that the power will range from 89.18% to 99.56% for the given effect size of 0.8 to 1.2.
Note: In the exam situation, you have no access to R and thus you can simply provide a rough estimate of the
power based on your T-table. For the given problem, the degree of freedom is larger than what is given in the Ttable, and thus we use the Z-table to approximate. The power is thereby estimated to be from 89.44% to 99.66%
for the given effect size of 0.8 to 1.2.
Oh well, you have done your best for your midterm. Now cheer up please. You will have
plenty of chances to improve your scores – the quizzes, the team project, and the final
exam.
And I wish you all a very happy and safe Halloween!
4