Upload
skyler-barnett
View
26
Download
4
Embed Size (px)
DESCRIPTION
BS704 Class 7 Hypothesis Testing Procedures. HW Set #6. Chapter 7 Problems 4, 7, 8, 20 and 25 R Problem Set 6 (on Blackboard) Due October 26 Please complete Quiz 8 Before Oct 26. Objectives. - PowerPoint PPT Presentation
Citation preview
BS704 Class 7 Hypothesis Testing Procedures
HW Set #6
Chapter 7Problems 4, 7, 8, 20 and 25R Problem Set 6 (on Blackboard)Due October 26
Please complete Quiz 8 Before Oct 26
Objectives
Define null and research hypothesis, test statistic, level of significance and decision rule
Understand Type I and Type II errors Differentiate hypothesis testing
procedures based on type of outcome variable and number of samples
Hypothesis Testing
Research hypothesis is generated about unknown population parameter
Sample data are analyzed and determined to support or refute the research hypothesis
Hypothesis Tests About m
Example: A large, national study was conducted in 2007 and found that the mean systolic blood pressure for males aged 50 was 130. In 2008, an investigator hypothesizes systolic blood pressures have increased.
To test this hypothesis we set up two competing hypotheses
Null H0: m = 130Research H1: m > 130
Hypothesis Tests About m
To test the hypotheses a random sample is selected from the population of interest.
Suppose a sample of n=108 males age 50 in 2008 is selected and their systolic blood pressures are analyzed. Of primary interest is the mean systolic blood pressure in the sample ( ). X
If the sample mean is 130, which is more likely true?
Yes N
o
0%0%
1. H0
2. H1
If the sample mean is 150, which is more likely true?
Yes N
o
0%0%
1. H0
2. H1
If the sample mean is 135, which is more likely true?
Yes N
o
0%0%
1. H0
2. H1
Hypothesis Tests About m
We must determine a critical value such that if our sample mean is less than the critical value we will conclude that H0 is true (i.e., m=130), and if our sample mean is greater than the critical value we will conclude that H1 is true (i.e., m > 130).
Hypothesis Tests About m
Instead of determining critical values for the sample mean - which would be specific to each application (since depends on the unit of measurement), - appeal to the Central Limit Theorem.
Hypothesis Tests About m
For large n - is approximately normally distributed. Assuming that H0 is true (or "under the null hypothesis") we can standardize , producing a Z score (test statistic).
If 130 then Z 0 H0 probably true.
If >130 then Z > 0 H1 probably true.
What value of Z is considered “large” ?
In Example suppose that s=15 and n=108.
X
XX
Hypothesis Tests About m
We must select a level of significance, denoted a, which is defined as the probability of rejecting H0 when H0 is true.
The level of significance is generally in the range of 0.01 to 0.10.Once a level of significance is selected, a decision rule is formulated.
Hypothesis Tests About m
Decision rule:
Reject H0 if Z > 1.645
Do Not Reject H0 if Z < 1.645
Once the decision rule is in place, we compute the value of the test statistic.
Suppose in example, X=135.
3.46 =
108
15130 - 135
=
n
sμ - X
= Z 0
Hypothesis Tests About m
The final step - draw a conclusion.
The test statistic falls in the rejection region - we reject H0 (3.46 > 1.645). We have significant evidence, a = 0.05, to show that the mean systolic blood pressure for males aged 50 in 2008 has increased from 130.
Hypothesis Testing Procedures
1. Set up null and research hypotheses, select a
2. Select test statistic3. Set up decision rule4. Compute test statistic5. Draw conclusion & summarize
significance (p-value)
P-values P-values represent the exact
significance of the data Estimate p-values when rejecting H0
to summarize significance of the data (can approximate with statistical tables, can get exact value with statistical computing package)
P-value is the smallest a where we still reject H0
Hypothesis Testing for m
Continuous outcome 1 Sample
H0: =m m0
H1: >m m0, m<m0, m≠m0
Test Statisticn>30 (Find critical
value in Table 1C,
n<30 Table 2)
ns/
μ-X Z 0
ns/
μ-X t 0
Hypothesis Testing for m
The National Center for Health Statistics (NCHS) reports the mean total cholesterol for adults is 203. Is the mean total cholesterol in Framingham Heart Study participants significantly different?
In 3310 participants the mean is 200.3 with a standard deviation of 36.8.
Hypothesis Testing for m
1. H0: =203m
H1: m≠203 =0.05a
2. Test statistic
3. Decision rule Reject H0 if z > 1.96 or if z < -1.96
ns/
μ-X Z 0
Hypothesis Testing for m
4. Compute test statistic
5. Conclusion. Reject H0 because -4.22 < -1.96. We have statistically significant evidence at a=0.05 to show that the mean total cholesterol is different in the Framingham Heart Study participants.
22.43310/8.36
2033.200
ns/
μ-X Z 0
Hypothesis Testing for m
Significance of the findings. Z = -4.22.
Table 1C. Critical Values for Two-Sided Tests a Z0.20 1.2820.10 1.6450.05 1.9600.010 2.5760.001 3.2910.0001 3.819 p<0.0001.
Interpreting P-Values
If p < a then reject H0
Errors in Hypothesis Tests
Conclusion of Statistical TestDo Not Reject H0 Reject
H0
H0 true Correct Type I error
H0 false Type II error Correct
Practice Example – Is social networking a health risk?
Hypertexting (>120 text messages per day) has been associated with health risks (Frank et al, Nov 2010). In 2010, the mean number of texts per day was 55. Is texting increasing in 2012? A sample of 75 teens report sending a mean of 61 texts per day (SD = 15). Is there evidence of an increase in texting in 2012?
Practice Example – Is social networking a health risk?
1. H0: = 55m
H1: m > 55 =0.05a
2. Test statistic 4. Test Statistic
3. Decision rule 5. Reject H0.
Reject H0 if z > 1.645
ns/
μ-X Z 0 5.3
7515/
55-61 Z
In an upper tailed test with a=0.05. If Z=-2.5 would you reject H0: m=50?
Yes N
o
0%0%
1. Yes2. No
We run a test and do not reject H0. Which is most likely…
We
mad
e th
e co
rrec
t...
We
com
mitt
ed a
Typ
e ...
We
com
mitt
ed a
Typ
e ..
1 o
r 2
1 o
r 3
0% 0% 0%0%0%
1. We made the correct decision
2. We committed a Type I error
3. We committed a Type II error
4. 1 or 25. 1 or 3
New Scenario Outcome is dichotomous (p=population
proportion) Result of surgery (success, failure) Cancer remission (yes/no)
One study sample Data
On each participant, measure outcome (yes/no)
n, x=# positive responses, n
xp̂
Hypothesis Testing for p Dichotomous outcome 1 Sample
H0: p=p0
H1: p>p0, p<p0, p≠p0
Test Statistic
(Find critical value in Table 1C)
5)]pn(1,min[np 00
n
)p-(1p
p-p̂ Z
00
0
Hypothesis Testing for p
The NCHS reports that the prevalence of cigarette smoking among adults in 2002 is 21.1%. Is the prevalence of smoking lower among participants in the Framingham Heart Study?
In 3536 participants, 482 reported smoking (482/3536=0.136).
Hypothesis Testing for p
1. H0: p=0.211
H1: p<0.211 =0.05a
2. Test statistic
3. Decision rule Reject H0 if z < -1.645
n
)p-(1p
p-p̂ Z
00
0
Hypothesis Testing for p
4. Compute test statistic
5. Conclusion. Reject H0 because -10.93 < -1.645. We have statistically significant evidence at a=0.05 to show that the prevalence of smoking is lower among the Framingham Heart Study participants. (p<0.0001)
93.10
3536)211.01(211.0
211.0136.0
n)p-(1p
p-p̂ Z
00
0
Practice Example – Is social networking a health risk?
Hypertexting (>120 text messages per day) has been associated with health risks (Frank et al, Nov 2010). In 2010, 19% of teens were hypertexting. Is hypertexting increasing in 2012? In a sample of 75 teens, 16 report sending more than 120 texts per day. Is hyper-texting increasing in 2012?
Practice Example – Is social networking a health risk?
1. H0: p=0.19
H1: p > 0.19 =0.05a
2. Test statistic 4. Test Statistic
3. Decision rule 5. Do not reject H0.
Reject H0 if z > 1.645
n
)p-(1p
p-p̂ Z
00
0 44.0
750.19)-0.19(1
0.19-0.21 Z
Sample Data: n=75, x=16
=0.21
New Scenario
Outcome is continuous SBP, Weight, cholesterol
Two independent study samples Data
On each participant, identify group and measure outcome
)s(ors,X,n),s(ors,X,n 22
22212
111
Two Independent Samples
RCT: Set of Subjects Who Meet Study Eligibility Criteria
Randomize
Treatment 1 Treatment 2Mean Trt 1 Mean Trt 2
Two Independent Samples
Cohort Study - Set of Subjects Who Meet Study Inclusion Criteria
Group 1 Group 2Mean Group 1 Mean Group 2
Hypothesis Testing for (m1-m2)
Continuous outcome 2 Independent Sample
H0: m1=m2 (m1-m2 = 0)
H1: m1>m2, m1<m2, m1≠m2
An RCT is planned to show the efficacy of a new drug vs. placebo to lower total cholesterol.
H0:
mP=m
N H1:
m...
H0:
mP=m
N H1:
...
H0:
mP=m
N H1:
...
0% 0%0%
What are the hypotheses?
1. H0: mP=mN H1: mP>mN
2. H0: mP=mN H1: mP<mN
3. H0: mP=mN H1: mP≠mN
Hypothesis Testing for (m1-m2)
Test Statisticn1>30 and (Find critical
valuen2> 30 in Table 1C,
n1<30 or Table 2)
n2<30
21
21
n
1
n
1Sp
X - XZ
21
21
n
1
n
1Sp
X - Xt
Pooled Estimate of Common Standard Deviation, Sp
Previous formulas assume equal variances (s1
2=s22)
If 0.5 < s12/s2
2 < 2, assumption is reasonable
2nn
1)s(n1)s(nSp
21
222
211
Hypothesis Testing for (m1-m2)
A clinical trial is run to assess the effectiveness of a new drug in lowering cholesterol. Patients are randomized to receive the new drug or placebo and total cholesterol is measured after 6 weeks on the assigned treatment.
Is there evidence of a statistically significant reduction in cholesterol for patients on the new drug?
Hypothesis Testing for (m1-m2)
Sample Size Mean Std DevNew Drug 15 195.9 28.7Placebo 15 217.4 30.3
Hypothesis Testing for (m1-m2)
1. H0: m1=m2
H1: m1<m2 =0.05a
2. Test statistic
3. Decision rule, df=n1+n2-2 = 28
Reject H0 if t < -1.701
21
21
n
1
n
1Sp
X - Xt
Assess Equality of Variances Ratio of sample variances: 28.72/30.32 =
0.90
2nn
1)s(n1)s(nSp
21
222
211
5.2989.87021515
1)30.3(151)28.7(15Sp
22
Hypothesis Testing for (m1-m2)
4. Compute test statistic
5. Conclusion. Reject H0 because -2.92 <
-1.701. We have statistically significant evidence at a=0.05 to show that the mean cholesterol level is lower in patients on treatment as compared to placebo. (p<0.005)
92.2
151
151
5.29
4.2279.195
n1
n1
Sp
X - Xt
21
21
A two sided test for the equality of means produces p=0.20. Reject H0?
Yes N
o
0%0%
1. Yes2. No3. Maybe
New Scenario
Outcome is continuous SBP, Weight, cholesterol
Two matched study samples Data
On each participant, measure outcome under each experimental condition
Compute differences (D=X1-X2) dd s,Xn,
Two Dependent/Matched Samples
Subject ID Measure 1 Measure 21 55 702 42 60..
Measures taken serially in time or under different experimental conditions
Crossover Trial
Treatment Treatment
Eligible RParticipants
Placebo Placebo
Each participant measured on Treatment and placebo
Hypothesis Testing for md
Continuous outcome 2 Matched/Paired Sample
H0: md=0
H1: md>0, md<0, md≠0
Test Statisticn>30 (Find critical
value in Table 1C,
n<30 Table 2)
ns
μ - XZ
d
dd
ns
μ - Xt
d
dd
Hypothesis Testing for md
Is there a statistically significant difference in mean systolic blood pressures (SBPs) measured at exams 6 and 7 (approximately 4 years apart) in the Framingham Offspring Study?
Among n=15 randomly selected participants, the mean difference was -5.3 units and the standard deviation was 12.8 units. Differences were computed by subtracting the exam 6 value from the exam 7 value.
Hypothesis Testing for md
1. H0: md=0
H1: md≠0 =0.05a
2. Test statistic
3. Decision rule, df=n-1=14 Reject H0 if t > 2.145 or if t < -2.145
ns
μ - Xt
d
dd
Hypothesis Testing for md
4. Compute test statistic
5. Conclusion. Do not reject H0 because -2.145 < -1.60 < 2.145. We do not have statistically significant evidence at a=0.05 to show that there is a difference in systolic blood pressures over time.
60.115/8.12
03.5
ns
μ - Xt
d
dd
New Scenario
Outcome is dichotomous Result of surgery (success, failure) Cancer remission (yes/no)
Two independent study samples Data
On each participant, identify group and measure outcome (yes/no)
2211 p̂,n,p̂,n
Hypothesis Testing for (p1-p2)
Dichotomous outcome 2 Independent Sample
H0: p1=p2
H1: p1>p2, p1<p2, p1≠p2
Test Statistic
(Find critical value in Table 1C)
21
21
n1
n1
)p̂-(1p̂
p̂-p̂ Z
5)]p̂(1n,p̂n),p̂(1n,p̂min[n 22221111
Hypothesis Testing for (p1-p2)
Is the prevalence of CVD different in smokers as compared to nonsmokers in the Framingham Offspring Study?
Free of CVD
History of CVD
Total
Nonsmoker 2757 298 3055
Current smoker 663 81 744
Total 3420 379 3799
Hypothesis Testing for (p1-p2)
1. H0: p1=p2
H1: p1≠p2 =0.05a
2. Test statistic
3. Decision rule Reject H0 if Z < -1.96 or if Z > 1.96
21
21
n
1
n
1)p̂-(1p̂
p̂-p̂ Z
Hypothesis Testing for (p1-p2)
4. Compute test statistic
21
21
n
1
n
1)p̂-(1p̂
p̂-p̂ Z 0.0975
3055
298p̂ 0.1089,
744
81p̂ 21
0.09883055744
29881p̂
927.0
30551
7441
0.0988)-0.0988(1
0.0975-0.1089 Z
Hypothesis Testing for (p1-p2)
5. Conclusion. Do not reject H0 because -1.96 < 0.927 < 1.96. We do not have statistically significant evidence at a=0.05 to show that there is a difference in prevalent CVD between smokers and nonsmokers.
Study of Single verses Weekly Antenatal Corticosteroids
What do p-values mean in Table 1? What do p-values mean in Table 3?
Study of Single verses Weekly Antenatal Corticosteroids
Did randomization work?
Primary outcome
Is trial a success?
Practice ProblemRun Test for Primary Outcome
Composite Morbidity
Group Sample Size # EventsWeekly 256 56Single 246 66
Solution
1. H0: p1=p2
H1: p1≠p2 =0.05a
2. Test statistic
3. Decision rule Reject H0 if Z < -1.96 or if Z > 1.96
21
21
n
1
n
1)p̂-(1p̂
p̂-p̂ Z
Solution
4. Compute test statistic
5. Do not Reject H0 since -1.96<-1.294<1.96.
21
21
n
1
n
1)p̂-(1p̂
p̂-p̂ Z 0.268
246
66p̂ 0.219,
256
56p̂ 21
0.243246256
6656p̂
294.1
2461
2561
0.243)-0.243(1
0.268-0.219 Z