HA 2 Solved
HA 2 Solved
Instruction: Solve all questions by hand calculation and using STATA software (Please attach STATA results).
1. Consider the results of clinical trial to test the effectiveness of a sleeping drug in which
the sleep of ten patients was observed during one night with the drug and one night with
a placebo. The results obtained are shown in below table. For each patient a pair of sleep
times in hours, namely those with the drug and with a placebo, was recorded and
difference between these were calculated. (16 points)
a. Test the hypothesis at 5% level of significance that the average number of hours slept
with drug is more as compared with the placebo.
Data
mu 1= average number of hours slept with drug
mu 2= average number of hours slept with placebo
level of significance = 0.05
Xd= 0.853
Sd= 1.88
N=15
H0: mu d <= 0
Ha: mu d> 0
Alpha= 0.05
Stata output
Paired t test
------------------------------------------------------------------------------
Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
Drug | 15 6.793333 .2209216 .8556256 6.319504 7.267163
placebo | 15 5.94 .3586748 1.389142 5.170719 6.709281
---------+--------------------------------------------------------------------
diff | 15 .8533333 .4874488 1.887881 -.1921404 1.898807
------------------------------------------------------------------------------
mean(diff) = mean(Drug - placebo) t = 1.7506
Ho: mean(diff) = 0 degrees of freedom = 14
Interpretation: As tcal is less than Ttab i.e. 1.75 < 1.761 so we fail to reject Ho at 5% level of significance and we
do not have sufficient evidence to conclude that the average number of hours slept with drug is more as compared
with the placebo.
b. Construct and interpret 95% confidence limit for the true mean difference in sleep time
(hours).
T alpha/2, df= T (0.025, 14)= 2.145
X + t alpha /2,df ( s/ √n)
0.85- 2.145 (0.485)=-0.190
0.85+ 2.145 (0.485)= 1.89
We are 95% confident that the true mean difference in the sleep time will lie between -0.190 hours to
1.89 hours
Stata output
Paired t test
------------------------------------------------------------------------------
Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
Drug | 15 6.793333 .2209216 .8556256 6.319504 7.267163
placebo | 15 5.94 .3586748 1.389142 5.170719 6.709281
---------+--------------------------------------------------------------------
diff | 15 .8533333 .4874488 1.887881 -.1921404 1.898807
------------------------------------------------------------------------------
mean(diff) = mean(Drug - placebo) t = 1.7506
Ho: mean(diff) = 0 degrees of freedom = 14
Ha: mean(diff) < 0 Ha: mean(diff) != 0 Ha: mean(diff) > 0
Pr(T < t) = 0.9491 Pr(|T| > |t|) = 0.1019 Pr(T > t) = 0.0509
© 2021, Aga Khan University. All Rights reserved (This material is the property of The Aga Khan University and may not be
reproduced, copied, modified or adapted, without prior written consent)
Smoking status IQ score
Smoker 101,115,103,103,105,106,109,111,110,119,
112,98,99,93,99,89,90,91,101,104,98
Non-smoker 104,119,117,106,105,109,109,111,119,100,
122,100,105,103,109,99,100,102,105,109,
108,110,120,121,123
Data:
Group 1= non smokers
N1=25
Xbar 1 = 109.4
S1= 7.65
Group 2=smokers
N1=21
Xbar 2=102.66
S2= 8.18
Sp2= (n1-1)S12+(n2-1)S22/n1+n2-2
Sp2= (25-1)( 7.65)2+ (21-1)( 8.18) 2/25+21-2
Sp2= 1404.54+1338.248/44
Sp2= 2742.788/44= 62.33
T= (109.4-102.6)-0/√62.33 (1/25+1/21)
Tcal= 6.8/2.33=2.91
Ttab=2.01
Df= 25+21-2= 44
Alpha/2= 0.025
Conclusion= As Tcal is greater than Ttab i.e. 2.91>2.01, so we reject Ho at 5% level of significance and we have
sufficient evidence to conclude that mean IQ score at age 4 for children of mothers who did not smoke during
their pregnancy is significantly different to those whose mothers smoked during their pregnancy.
Stata output
b. Construct 95% confidence interval for the difference in population mean IQ scores at age 4 for
children of mothers who did not smoke during their pregnancy and those whose mothers smoked.
Write a sentence interpreting the confidence interval.
95% CI
(109.4-102.6) -2.01 (2.33)= 6.8- 4.68=2.11
Interpretation: We are 95% confident that the difference in population mean IQ scores at
age 4 for children of mothers who did not smoke during their pregnancy and those whose
mothers smoked will lie between 2.11 to 11.48.
Stata output:
Two-sample t test with equal variances
------------------------------------------------------------------------------
Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
---------+--------------------------------------------------------------------
nonsmo~r | 25 109.4 1.530795 7.653975 106.2406 112.5594
smoker | 21 102.6667 1.786635 8.187389 98.93981 106.3935
---------+--------------------------------------------------------------------
combined | 46 106.3261 1.255732 8.516792 103.7969 108.8553
---------+--------------------------------------------------------------------
diff | 6.733333 2.338707 2.019978 11.44669
------------------------------------------------------------------------------
diff = mean(nonsmoker) - mean(smoker) t = 2.8791
Ho: diff = 0 degrees of freedom = 44
3. A survey claims that 9 out of 10 doctors recommend aspirin for their patients with
headaches. To test this claim, a random sample of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend aspirin. Is this claim accurate? Use alpha = 0.05
(12 points)
Data:
Po= 90% or 0.9
N= 100
X= 82
P hat= x/n= 82/100 = 0.82
Alpha= 0.05
Z= P hat-Po/ √[Po(1-Po)/n]
= 0.82-0.9/√[0.9(1-0.9)/100]
= -0.08/ √0.0009= 0.08/0.03=-2.66
Ztab= -1.96
So, -2.66 is less than -1.96 that means that Zcal < Ztab, hence we reject Ho at 5% level of significance
and we have sufficient evidence to conclude that 9 out of 10 doctors do not recommend aspirin for their
patients with headaches.
Stata calculations:
One-sample test of proportion x: Number of obs = 100
------------------------------------------------------------------------------
| Mean Std. Err. [95% Conf. Interval]
-------------+----------------------------------------------------------------
x| .82 .0384187 .7447006 .8952994
------------------------------------------------------------------------------
p = proportion(x) z = -2.6667
Ho: p = 0.9
4. Obesity is an important risk factor for many diseases. One commonly used measure
of obesity is body mass index (BMI) (kg/m2), which is often categorized as follows:
normal = BMI <25, overweight = BMI 25.0 - 29.9 and obese = BMI ≥ 30.0. The data
in table given below is from a study relating education to BMI category. Is there any
association between BMI categories and Educational level? Test at 5% significance level.
Also report p-value. (14 points)
Ho: There is no association between BMI and Educational level (both variables are independent)
Ha: There is an association between BMI and Educational level (both variables are dependent)
X2 Tab= 5.991
Interpretation: As X2cal is not greater than X2 cal so we fail to reject Ho at 5% level of significance and we do not have sufficient
evidence to conclude that there is any association between BMI categories and Educational level.
Stata Output:
+--------------------+
| Key |
|--------------------|
| frequency |
| expected frequency |
| chi2 contribution |
+--------------------+
| col
row | 1 2 | Total
-----------+----------------------+----------
1| 70 7| 77
| 67.3 9.7 | 77.0
| 0.1 0.8 | 0.9
-----------+----------------------+----------
2| 105 15 | 120
| 104.8 15.2 | 120.0
| 0.0 0.0 | 0.0
-----------+----------------------+----------
3| 53 11 | 64
| 55.9 8.1 | 64.0
| 0.2 1.0 | 1.2
-----------+----------------------+----------
Total | 228 33 | 261
| 228.0 33.0 | 261.0
| 0.3 1.8 | 2.1
P value:
Df=2
As per the chi square table the p value will lie between 0.90 (0.211) to 0.10 (4.605), hence in both the cases its greater than alpha
which is 0.05. As p is not less than alpha so we fail to reject Ho at 5% level of significance to conclude that there is no association
between BMI and educational level.
© 2021, Aga Khan University. All Rights reserved (This material is the property of The Aga Khan University and may not be
reproduced, copied, modified or adapted, without prior written consent)
5. A survey was conducted in which 1319 school children were questioned on the
prevalence of symptoms of severe cold at the age of 12 and again at the age of 14
years. At age 12, 356 (27%) children were reported to have severe colds in the past 12
months compared to 468 (35.5%) at age 14.
Was there a significant difference in the prevalence of severe cold at two different ages? Also
estimate and interpret Odds ratio (15 points)
H0: P1 = P2
Ha: P1 not= P2
Interpretation: As Xo2 cal is greater than Xo2 tab i.e. 31.36 > 3.841 so we reject H0 at 0.05 level of
significance and we have sufficient evidence to conclude that there is a significant difference in the
prevalence of severe cold at two different ages.
Interpretation= The odds of having severe cold at age 12 is 0.56 times the odds of having severe
cold at age 14.
Stata Output:
| Controls |
Cases | Exposed Unexposed | Total
-----------------+------------------------+------------
Exposed | 212 144 | 356
Unexposed | 256 707 | 963
-----------------+------------------------+------------
Total | 468 851 | 1319
McNemar's chi2(1) = 31.36 Prob > chi2 = 0.0000
Exact McNemar significance probability = 0.0000
.
6. Before treatment with a new drug a group of insomniacs have a median sleeping time of
2 hours per night. A drug is administered and it is known that if it has an effect, it will
increase sleeping time, but some doctors doubt if it will have any effect. Are their doubt
justified if the hours per night slept by 11 insomniacs after taking the drug are:
1.8 2.7 2.4 2.9 0.2 3.7 5.1 8.3 2.1 2.4
Ho: ∆d = 2
Ha: ∆d is not = 2
Alpha= 0.05
Sleeping 1.8 2.7 2.4 2.9 0.2 3.7 5.1 8.3 2.1 2.4
hours
difference -0.2 0.7 0.4 0.9 -1.8 1.7 3.1 6.3 0.1 0.4
N+ is = 8
Absolute N- is 2
Critical value= 1
N=11
Alpha= 0.05
Two tailed
Interpretation as test statistic is not less than critical value so we fail to reject Ho at 5% level of significance and we
do not have sufficient evidence to justify researcher’s doubts about the drug.
Stata output:
7. A subject of recent research in obstetrics is the medical management of women who go
into labor prematurely. Terbutaline is a drug that is effectively used to arrest labor and
prolong the duration of pregnancy beyond 36 weeks. However, it has some undesirable
side-effects, which limits its use for some women. Another possibility is to give
terbutaline in combination with another drug (metoprolol), which could neutralize these
side effects. As a result of a clinical trial, it was found that 65% of the women who took
terbutaline alone and 60% of the women who took terbutaline and metoprolol had a
pregnancy lasting greater than 36 weeks. The result of this study was not significant at
5% level with 200 women in each group. In order to detect a significant difference if
present, the investigators propose a new clinical trial. How many patients are needed in
each group to conduct a two-sided test with 95% power and 5% significance level?
(6 points)
Data:
P1= proportion of the women who took terbutaline alone= 65% or 0.65
P2= proportion of the women who took terbutaline and metoprolol= 60%= 0.6
Power= 95%
Level of sig = 5% 0r 0.05
At least 2542 participants are needed in each group to conduct a two-sided test with 95% power and 5% significance
level.
OpenEpi Output:
© 2021, Aga Khan University. All Rights reserved (This material is the property of The Aga Khan University and may not be
reproduced, copied, modified or adapted, without prior written consent)