IEOR 165 Homework 2 Due March 5, 2015

advertisement
IEOR 165 Homework 2
Due March 5, 2015
Question 1. A randomized, double-blind experiment was conducted to assess if the several
drugs for reducing postoperative nausea are effective more than 50 percent of the time. The
data are as follows.
Chlorpromazine
Dimenhydrinate
Pentobarbital (100 mg)
Pentobarbital (150 mg)
Number of Patients
100
120
110
330
Incidence of Nausea
58
73
63
185
a. Test the hypothesis that the proportion of incidence of nausea is 50% at the 5 per cent
level.
b. Use the Bonferroni to adjust for multiple testing.
Question 2. The following data relate to the ages at death of a certain species of rats that
were fed 1 of 3 types of diets. Thirty rats of a type having a short life span were randomly
divided into 3 groups of 10 each. The sample means and variances of ages at death (in
months) are:
Sample mean
Sample variance
Very Low Calorie
22.4
24.0
Moderate Calorie
16.8
23.2
High Calorie
13.7
17.1
a. Test the hypothesis, at the 5 percent level of significance, that the mean lifetime of a
rat is not affected by its diet.
b. Repeat assuming the numbers in the groups were 5 for very low calorie, 10 for moderate,
and 15 for high calorie.
c. For the original data, compute the joint 95% CI for the three means. Hint: Use the
Bonferroni correction.
Question 3. Assume that items produced are supposed to be normally distributed with
mean 35 and standard deviation 3. To monitor this process, subgroups of size 5 are sampled.
If the following represents the averages of the first 20 subgroups, does it appear that the
process was in control with significance level 0.05?
1
Subgroup No.
1
2
3
4
5
6
7
8
9
10
X̄
34.0
31.6
30.8
33.0
35.0
32.2
33.0
32.6
33.8
35.8
Subgroup No.
11
12
13
14
15
16
17
18
19
20
X̄
35.8
35.8
34.0
35.0
33.8
31.6
33.0
33.2
31.8
35.6
Question 4. Suppose we would like to use an exponentially weighted moving-average control chart for data that should come from N (µ = 5, σ 2 = 2). Assume the subgroup size is
n = 10, and that we have chosen γ = 0.2. Use a Monte Carlo algorithm to determine the
value of so that the expected number of subgroups that are analyzed before the process is
determined to be out of control (in the case where the process never goes out of control) is
1000. Return your results and code.
2
Solution 1.
a.
Under H0 ,
∑
Xi ∼ Bin(100, 0.5).
∑
Xi ≥ 59 | p = 0.5)
p − value = P (
= 0.0443
Retain H0 .
(1-binocdf(58, 100, 0.5))
∑
Under H0 ,
Xi ∼ Bin(120, 0.5).
∑
p − value = P (
Xi ≥ 74 | p = 0.5)
= 0.0067
Retain H0 .
(1-binocdf(73, 120, 0.5))
∑
Under H0 ,
Xi ∼ Bin(110, 0.5).
∑
p − value = P (
Xi ≥ 64 | p = 0.5)
= 0.0523
Retain H0 .
(1-binocdf(63, 110, 0.5))
∑
Under H0 ,
Xi ∼ Bin(330, 0.5).
∑
p − value = P (
Xi ≥ 186 | p = 0.5)
= 0.0119
The test results is strong enough to reject H0 at the 5 percent level of significance.
(1-binocdf(185, 330, 0.5))
b. (p1 , p2 , p3 , p4 ) = (0.04443, 0.0067, 0.0523, 0.0119)
Reject hypothesis only when pi < α/k = 0.05/4 = 0.0125
Reject H2 and H4 .
Solution 2.
Assume normal data, with equal but unknown variance σ 2 .
a. m = 3, n = 10.
H0 : µ1 = µ2 = µ3 , H1 : some difference.
3
Since Si2 =
1
n−1
∑n
j=1 (Xij
− X i )2 , for i = 1, 2, 3. It follows
SSW =
m ∑
n
∑
(Xij − X i )2
i=1 j=1
=
m
∑
(n − 1)Si2
i=1
= (n − 1)
m
∑
Si2
i=1
= (10 − 1)(24.0 + 23.2 + 17.1)
= 578.7
Also, X =
1
m
∑m
i=1
X i = 13 (22.4 + 16.8 + 13.7) = 17.63. Then we have
SSb = n ·
m
∑
(X i − X)2
i=1
= 10 · [(22.4 − 17.63)2 + (16.8 − 17.63)2 + (13.7 − 17.63)2 ]
= 388.9
TS =
SSb /(m − 1)
388.9/(3 − 1)
=
= 9.072
SSW /(nT − m)
578.7/(30 − 3)
p − value = P (Fm−1,nT −m > T S) = P (F2,27 > 9.072) = 0.00097 < 0.05
So we reject H0 . we are 95% confident that there is a statistically significant difference
between mu1 and mu2 and between mu1 and mu3.
b. m = 3, n1 = 5, n2 = 10, n3 = 15.
H0 : µ1 = µ2 = µ∑
3 , H1 : some difference.
ni
1
2
Since Si = ni −1 j=1
(Xij − X i )2 , for i = 1, 2, 3. It follows
SSW =
=
ni
m ∑
∑
(Xij − X i )2
i=1 j=1
m
∑
(ni − 1)Si2
i=1
= (5 − 1)24.0 + (10 − 1)23.2 + (15 − 1)17.1
= 544.2
1
X = (5(22.4) + 10(16.8) + 15(13.7)) = 16.2
30
SSb =
m
∑
ni (X i − X)2
i=1
= 5(22.4 − 16.2)2 + 10(16.8 − 16.2)2 + 15(13.7 − 16.2)2
= 289.54
4
SSb /(m − 1)
289.54/(3 − 1)
=
= 7.18
SSW /(nT − m)
544.2/(30 − 3)
p − value = P (Fm−1,nT −m > T S) = P (F2,27 > 7.18) = 0.0032 < 0.05
TS =
So we reject H0 .
c. Xi ±
zα/3 si
√
ni
for all i
Solution 3. When in control, X ∼ N (35, 9). n = 5.
√
√
LCL = µ − σ · z(1−α/2) / n = 35 − 3 · 1.96/ 5 = 32.37
√
√
U CL = µ + σ · z(1−α/2) / n = 35 + 3 · 1.96/ 5 = 37.63
X̄ < LCL, so the process is out of control since the 2nd, 3rd, 6th, 16th, 19th subgroup.
Solution 4.
function MCsim()
alpha=0.001:0.0005:0.005;
L = zeros(1,length(alpha));
n=10;
gamma = 0.2;
npath = 10000;
maxIter = 2000;
M = zeros(1,npath);
numSubGrp = zeros(1,npath);
mu = 5;
sigma = sqrt(2);
for k=1:length(alpha)
disp(k);
LCL(k)=mu-sigma*norminv(1-alpha(k)/2)/sqrt(n*(2-gamma)/gamma);
UCL(k)=mu+sigma*norminv(1-alpha(k)/2)/sqrt(n*(2-gamma)/gamma);
M(1) = mean(normrnd(mu,sigma,[1 n]));
for ind=1:npath
j=0;
while(M(j+1)<=UCL(k) && M(j+1)>=LCL(k) && j<=maxIter)
j=j+1;
M(j+1)=gamma*mean(normrnd(mu,sigma,[1 n]))+(1-gamma)*M(j);
end
numSubGrp(ind) = j;
end
L(k) = mean(numSubGrp);
end
out = [alpha’, L’];
end
5
Download