0% found this document useful (0 votes)
19 views

Sol Testing 2

This document provides the solutions to homework questions about hypothesis testing using paired medical data comparing the sleeping pill Dalmane to Halcion. For the first question, a paired t-test is used to analyze data from 10 insomniacs measuring hours of sleep with each drug. The test finds the average difference in hours slept of 0.32 hours is statistically significant, suggesting Halcion is not as effective as Dalmane. The second question constructs a 99% confidence interval for the difference in drug efficacies and compares it to the acceptance region that would be used for a statistical test with a type I error rate of 0.01.

Uploaded by

Carl Darcy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Sol Testing 2

This document provides the solutions to homework questions about hypothesis testing using paired medical data comparing the sleeping pill Dalmane to Halcion. For the first question, a paired t-test is used to analyze data from 10 insomniacs measuring hours of sleep with each drug. The test finds the average difference in hours slept of 0.32 hours is statistically significant, suggesting Halcion is not as effective as Dalmane. The second question constructs a 99% confidence interval for the difference in drug efficacies and compares it to the acceptance region that would be used for a statistical test with a type I error rate of 0.01.

Uploaded by

Carl Darcy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

BIOSTATS 540 – Fall 2015 Introductory Biostatistics Page 1 of 5

Unit 7 – Hypothesis Testing


Homework #12 (Unit 7 – Hypothesis Testing, part 2 of 2)

SOLUTIONS

1. Halcion is a sleeping pill that is relatively rapidly metabolized by the body and therefore
having fewer hangover effects the next morning, compared to other sleeping pills. Opponents of
Halcion argue that, because this agent is so rapidly metabolized by the body, patients do not sleep
as long with this drug as with Dalmane. Data on 10 insomniacs, each of whom took Dalmane on
one occasion and Halcion on a second, is collected. The variable measured is number of hours of
sleep:

Number of Hours Sleep with


Patient Dalmane Halcion
1 4.58 3.97
2 5.19 4.88
3 3.94 4.09
4 6.32 5.87
5 7.68 6.93
6 3.48 4.00
7 5.72 5.08
8 7.04 6.95
9 5.27 4.96
10 5.84 5.13

Do these data suggest that Halcion is not as effective as Dalmane with respect to number of
hours of sleep? Carry out an appropriate statistical test and interpret your findings. You may
assume that the measurements of sleep are continuous, distributed normal.

ANSWER

These data are paired measurements of an outcome measured on a continuum in a single sample.
It is of interest to compare the responses of the paired measurements. The
correct test is therefore a paired t-test.

For these data, a paired t-test suggests that the average difference in hours slept (Dalmane –
Halcion) = 0.32 is statistically significant (one sided p-value = .018).

sol_testing_2.docx
BIOSTATS 540 – Fall 2015 Introductory Biostatistics Page 2 of 5

SOLUTION
This question is asking for a hypothesis test of the equality of two means in the setting of paired data. The
data are paired because each participant was measured on two occasions, once on Dalmane and once on
Halcion.

Research Question. Are sleep durations shorter on Dalmane than on Halcion?

Assumptions.
d is distributed Normal (µd , σd2/10)
Differences are calculated as (Dalmane – Halcion)

For these 10 paired measurements, we have

Obs dalmane halcion diff

1 4.58 3.97 0.61


2 5.19 4.88 0.31
3 3.94 4.09 -0.15
4 6.32 5.87 0.45
5 7.68 6.93 0.75
6 3.48 4.00 -0.52
7 5.72 5.08 0.64
8 7.04 6.95 0.09
9 5.27 4.96 0.31
10 5.84 5.13 0.71

HO and HA.

HO : µd = 0
HA : µd > 0 (“Dalmane is better than Halcion”) – one sided

Test statistic is a t-score.

⎡ (d)-E[d)|HO true] ⎤
t score = ⎢ ⎥
ˆ
⎣ SE[(d)|HO true] ⎦

Obtain sample mean of the differences, d

10

∑d i
⎡ 0.61+ 0.31+ ...+ 0.71 ⎤
d = i=1
= ⎢ ⎥ = 0.32
10 ⎣ 10 ⎦

Preliminary – Obtain sample variance of the differences, Sd2

sol_testing_2.docx
BIOSTATS 540 – Fall 2015 Introductory Biostatistics Page 3 of 5

10 10

∑( ) ∑ (d − 0.32 )
2 2
di − d i
(0.61− 0.32)2 + ...+ (0.71− 0.32)2
Sd2 = i=1
= i=1
= = 0.1688889
(n-1) 9 9

ˆ [ d | H true]
Obtain the estimated standard error, SE O

Sd2 0.1688889
SEˆ [ d | H O true] = = = 0.1299573
n 10

Putting these all together, the solution for the test statistic is

⎡ (d)-E[d)|HO true] ⎤ ⎡ 0.32 - 0 ⎤


t score = ⎢
ˆ ⎥=⎢ ⎥ = 2.4623
⎣ SE[(d)|HO true] ⎦ ⎣ 0.1299573 ⎦

Degrees of freedom = (n-1) = (10-1) = 9.

“Evaluation” rule.

The likelihood of these findings or ones more extreme if HO is true is


⎣ ( )
p-value = Pr ⎡ d ≥ 0.32 | H O true ⎤ .

Calculations.
p-value = Pr [ t score ≥ 2.46] where degrees of freedom = 9

=.018

sol_testing_2.docx
BIOSTATS 540 – Fall 2015 Introductory Biostatistics Page 4 of 5

SurfStat t-distribution calculator to obtain the achieved level of significance (p-value)


http://www.anu.edu.au/nceph/surfstat/surfstat-home/tables/t.php

Enter the following, being sure to click on the radio dial for a RIGHT TAIL

After pressing the RIGHT ARROW, you should obtain 0.0181 in the probability box.

“Evaluate”.
The assumption of the null hypothesis HO (duration of sleep is the same with both drugs) has led to
an unlikely result. Under the null hypothesis the chance that the difference in average hours slept is
as great or greater than 0.32 hours is about 2 in 100. “2 chances in 100” is “unlikely” enough that I
warrants rejecting the null hypothesis. Put another way, in this sample, the average difference of
0.32 hours is statistically significant.

sol_testing_2.docx
BIOSTATS 540 – Fall 2015 Introductory Biostatistics Page 5 of 5

2. For the Halcion versus Dalmane data in Exercise 1, construct a 99% confidence interval
estimate of discrepancy in the efficacies of the two drugs. Compare this to the acceptance region
that would have been obtained had you constructed a statistical test with type I error pre-specified
at 0.01.

ANSWER The 99% confidence interval is (-0.10, 0.74).


The acceptance region is d < 0.3666 .

SOLUTION

Solution for the 99% CI is as follows

ˆ Sd
d = 0.32 SE(d)= = 0.1299573
n

df=(n-1)=9 t1-α /2;df = t .995;9 = 3.25 from the calculator on the web above.

ˆ
99% CI for µ d = d ± (t .995;DF=9 ) SE(d)

= (0.32) ± (3.25)(0.1299573) = (-0.1024, +0.7424)

Solution for the acceptance region of a one sided test with alpha = .01 is obtained by reasoning as follows

Rejection occurs for t-score > the 99th percentile of a student’s t on df=9 à

Rejection occurs for t-score > t.99; df=9 à

Acceptance occurs for t-score < t.99; df=9 à

Substituting in the definition of a t-score allows us to write this equivalently as

d-0
Acceptance occurs for < t .99;df=9 By plugging in numbers for the SE and the percentile à
ˆ
SE(d)

d
Acceptance occurs for < 2.821 where I used the calculator on the web as before à
0.1299573

Acceptance occurs for d < 0.3666

Comparison
These two regions overlap but are not identical. They are not identical because the confidence interval is two
sided whereas the acceptance region is one sided.

sol_testing_2.docx

You might also like