0% found this document useful (0 votes)
26 views13 pages

HA 2 Solved

The document discusses two clinical trials. The first compares sleep times with and without a sleeping drug and finds no significant difference. The second compares IQ scores of children whose mothers smoked versus did not smoke, finding a significant difference. It provides details on hypotheses tests, confidence intervals, and output from the statistical software Stata to analyze the data.

Uploaded by

noorkomal47
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views13 pages

HA 2 Solved

The document discusses two clinical trials. The first compares sleep times with and without a sleeping drug and finds no significant difference. The second compares IQ scores of children whose mothers smoked versus did not smoke, finding a significant difference. It provides details on hypotheses tests, confidence intervals, and output from the statistical software Stata to analyze the data.

Uploaded by

noorkomal47
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Home Assignment 2

Due on 25 May, 2021


Total Marks: 100

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)

Patient Hours of sleep Difference


Drugs Placebo
1 6.1 5.2 0.9
2 6 7.9 -1.9
3 8.2 3.9 4.3
4 7.6 4.7 2.9
5 6.5 5.3 1.2
6 5.4 7.4 -2.0
7 6.9 4.2 2.7
8 6.7 6.1 0.6
9 7.4 3.8 3.6
10 5.8 7.3 -1.5
11 6.7 6 0.7
12 5.9 6 -0.1
13 7.1 6.5 0.6
14 8.1 7.8 0.3
15 7.5 7.0 0.5

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

T= X bar- mu/(s/square root of n

Tcal= 0.853-0/(1.88/√15)= 0.853/0.48= 1.75


Ttab= 1.761
Df= 15-1= 14

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

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

2. A study was conducted on pregnant women and subsequent development of their


children. One of the questions of interest was whether the IQ of children would differ for
mothers who smoked cigarettes during pregnancy and those who did not smoke at all.
The IQ scores at age 4 for the children of the 25 non-smoker and 21 smoker mothers
were collected as follows: (25 points)

© 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

a. Assume the populations of measurements to be normally distributed, test whether 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? Before
testing the difference in mean check the assumption of equality of variances of IQ scores
for smoker and non-smoker mothers. Use 5 % significance level.

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

Mu1= non smokers


Mu2= smokers
Ho: mu1=mu2 or mu1-mu2=0
Ha: mu1 not = mu2 or or mu1-mu2 not= 0 (2 sided test)

Level of significance= 5% or 0.05

As the variances are equal so;


T=

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

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

Ha: diff < 0 Ha: diff != 0 Ha: diff > 0


Pr(T < t) = 0.9969 Pr(|T| > |t|) = 0.0061 Pr(T > t) = 0.0031

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

(109.4-102.6) +2.01 (2.33)= 11.48

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

Ha: diff < 0 Ha: diff != 0 Ha: diff > 0


Pr(T < t) = 0.9969 Pr(|T| > |t|) = 0.0061 Pr(T > t) = 0.0031

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

Ho: Po = 0.9 (2 tailed test)


Ha: Po not = 0.9

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

Ha: p < 0.9 Ha: p != 0.9 Ha: p > 0.9


Pr(Z < z) = 0.0038 Pr(|Z| > |z|) = 0.0077 Pr(Z > z) = 0.9962

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)

Level of Sig: 0.05

Apply Chi square test

X2= χ2 = ∑(Oi – Ei)2/Ei


Expected Frequencies table
BMI Educational level
High school Less than high school Total
Normal 77x228/261= 67.26 77x33/261= 9.73 77
Overweight 120x228/261= 104.82 120x33/261= 15.17 120
Obese 64x228/261= 55.92 64x33/261= 8.1 64
Total 228 33 261
Table for (O – E)2/E
BMI Educational level
High school Less than high school
Normal (70-67.26)2/67.26= 0.11 (7-9.73)2/9.73= 0.76
Overweight (105-104.82)2/104.82= (15-15.17)2/15.17=
0.0003 0.0019
Obese (53-55.92)2/55.92= 0.15 (11-8.1)/8.1= 1.03

Total= 0.11+0.0003+0.15+0.76+0.0019+1.03= 2.05

Df= (R-1)(C-1)= (3-1)(2-1)=2

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

Pearson chi2(2) = 2.0785 Pr = 0.354

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)

P1= proportion of severe colds at age 12


P2= proportion of severe colds at age 14

H0: P1 = P2
Ha: P1 not= P2

Level of sig= 5% or 0.05

Xo2= (b-c)2/b+c = (144-256)2/(144+256) = 12544/400= 31.36


Df= (r-1)(c-1)= (2-1)(2-1)= 1
Xo2tab= 3.841

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.

Odds ratio= b/c = 144/256= 0.56

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:

. mcci 212 144 256 707

| 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

Proportion with factor


Cases .2699014
Controls .3548143 [95% Conf. Interval]
--------- --------------------
difference -.0849128 -.1150345 -.0547911
ratio .7606838 .6910295 .837359
rel. diff. -.1316099 -.18061 -.0826098

odds ratio .5625 .4553919 .6925884 (exact)

.
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

Conduct the appropriate statistical test at 5 % significance level. (12 points)

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

Test statistic= min (n+, | n-|)


TS = 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)

You might also like