SLIDE 1 1/18/2007 1
219323 Probability y and Statistics for Software and Knowledge Engineers
Lecture 9: Hypothesis Testing (cont.)
Monchai Sopitkamon, Ph.D.
Outline
Significance Levels (8.2.4) z-Tests (8.2.5)
ests (8 5)
Summary (8.3)
SLIDE 2
1/18/2007 2
Significance Levels I (8.2.4)
The null hypothesis H0 is rejected if
The null hypothesis H0 is rejected if the p-value is smaller than size α (significance level), and H0 is accepted if the p-value is larger than α.
Significance Levels II (8.2.4)
Error classification for hypothesis tests
SLIDE 3 1/18/2007 3
Two-Sided Hypothesis Test for a Population Mean
( )
s x n t μ − =
Size α tw o- sided t-test
Two-Sided Hypothesis Test for a Population Mean: Example
Sample size n = 18 observations
Table III provides critical points as in the left Table. Consider the test statistics |t| = 3.24, 1.625, 1.74≤|t|≤2.898
α tα/2,17 0.10 1.740 0.05 2.110 0.01 2.898
Excel sheet
SLIDE 4 1/18/2007 4
Relationship Between Confidence Intervals & Hypothesis Tests I
The value µ0 is contained within a 1 - α
µ0 level two-sided CI
if the p-value for the two-sided hypothesis test H0 : µ = µ0 versus HA : µ ≠ µ0
⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + −
− −
n s t x n s t x
n n 1 , 2 / 1 , 2 /
,
α α
A
is larger than α. So, if µ0 is contained within the 1 - α level CI, the hypothesis test with size α accepts the null hypothesis, and if µ0 is contained outside the 1 - α level CI, the hypothesis test rejects H0
Relationship Between Confidence Intervals & Hypothesis Tests II
Relationship betw een hypothesis testing and confidence intervals for tw o- sided problem s
SLIDE 5 1/18/2007 5 Relationship Between Confidence Intervals & Hypothesis Tests III: Ex.47 pg.363
With t0.005, 29 = 2.756 (from Table III), a
99% two-sided t-interval for the mean tensile strength is Since µ0 = 40.0 is not contained within this CI which is consistent with the
( )
67 . 39 , 36 . 37 30 299 . 2 756 . 2 518 . 38 , 30 299 . 2 756 . 2 518 . 38 ,
1 , 2 / 1 , 2 /
= ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ × + × − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + −
− −
n s t x n s t x
n n α α
this CI, which is consistent with the hypothesis test H0 : µ = 40.0 versus HA : µ ≠ 40.0 having a p-value of 0.0014, so that the null hypothesis is rejected at size α = 0.01.
Excel sheet
Relationship Between Confidence Intervals & Hypothesis Tests III: Ex.14 pg.363
With t0.05, 59 = 1.671, a 90% two-sided t-
interval for the mean cylinder diameter is Since µ0 = 50.0 is contained within this CI, which is consistent with the hypothesis test H : µ = 50 0 versus
( )
028 . 50 , 970 . 49 60 134 . 671 . 1 999 . 49 , 60 134 . 671 . 1 999 . 49 ,
1 , 2 / 1 , 2 /
= ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ × + × − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + −
− −
n s t x n s t x
n n α α
hypothesis test H0 : µ = 50.0 versus HA : µ ≠ 50.0 having a p-value of 0.954, so that the null hypothesis is accepted at size α = 0.1.
Excel sheet
SLIDE 6
1/18/2007 6
One-Sided Hypothesis Test for a Population Mean I
( )
s x n t μ − =
Size α one- sided t-test
One-Sided Hypothesis Test for a Population Mean II
( )
s x n t μ − =
Size α one- sided t-test
SLIDE 7
1/18/2007 7
Relationship Between Confidence Intervals & Hypothesis Tests I
Relationship betw een hypothesis testing and confidence intervals for one- sided problem s
Relationship Between Confidence Intervals & Hypothesis Tests II
Relationship betw een hypothesis testing and confidence intervals for one- sided problem s
SLIDE 8 1/18/2007 8
Summarization of relationships between CIs, p-values, and significance levels (α) for two- sided and one-sided problems
One-Sided Problem Example: Ex.48 pg.366: Car Fuel Efficiency
The one-sided hypothesis are
H0 : µ ≥ 35.0 versus HA : µ < 35.0 Since the t-statistic = -1.119 > t-critical -t0.01, 19 =
- 1.328, a size α = 0.10 hypothesis test accepts
the null hypothesis. This is also consistent w/ the previous analysis where the p-value = 0.1386 > α = 0.10. Besides, the one-sided 90% t-interval
⎞ ⎛ ⎞ ⎛
contains the value µ0 = 35.0, as expected.
( )
14 . 35 , 20 915 . 2 328 . 1 271 . 34 , ,
1 ,
∞ − = ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ × + ∞ − = ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ + ∞ − ∈
−
n s t x
n α
μ
Excel sheet
SLIDE 9
1/18/2007 9
Power Levels
Significance level α prob that null
g p hypothesis is rejected when it is true (Type I error)
Small significance levels are
employed in hypothesis tests so that the prob of Type I error is small. T pe II error (prob that n ll
Type II error (prob that null
hypothesis is accepted when it is false) should also be minimized, thus the introduction of the “Power of a Hypothesis Test” concept.
Power of a Hypothesis Test
Power = 1 – (prob of Type II error)
Power 1 (prob of Type II error) = prob that the null hypothesis is rejected when it is false.
The larger the power value, the
better the experiment For a fi ed significance le el the
For a fixed significance level α, the
power of a hypothesis test increases as the sample size n increases.
SLIDE 10
1/18/2007 10
Outline
Significance Levels (8.2.4) z-Tests (8.2.5)
z Tests (8.2.5)
Summary (8.3)
z-Tests (8.2.5)
Used when the population SD σ is
Used when the population SD σ is known, rather than the sample SD s.
Uses z-statistic:
( )
σ μ0 − = x n z
which has standard normal dist when µ = µ0
SLIDE 11 1/18/2007 11
Two-Sided z-Test I
The p-value for the two-sided hypothesis testing problem testing problem H0 : µ = µ0 versus HA : µ ≠ µ0 based on a data set of n observations w/ a sample mean and a population SD σ is p-value = 2 x Φ(-|z|) where the Φ(x) is standard normal CDF
x
and which is known as the z-statistic.
( )
σ μ0 − = x n z
Two-Sided z-Test II
A size α test rejects the null hypothesis H0 if
the test statistic |z| falls in the rejection region |z| > zα/2 and accepts the null hypothesis H0 if the test statistic |z| falls in the acceptance region |z| ≤ zα/2 the 1 - α level two-sided CI
⎞ ⎛
consists of the values µ0 for which this hypothesis testing problem has a p-value > α,
- r the values µ0 for which the size α
hypothesis test accepts the null hypothesis.
⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + − ∈ n z x n z x σ σ μ
α α 2 / 2 /
,
SLIDE 12 1/18/2007 12
One-Sided z-Test I (H0: µ≤µ0)
The p-value for the two-sided hypothesis testing problem H0 : µ ≤ µ0 versus HA : µ > µ0 H0 : µ ≤ µ0 versus HA : µ µ0 based on a data set of n observations w/ a sample mean and a population SD σ is p-value = 1 – Φ(z) A size α test rejects the null hypothesis when z > zα and accepts the null hypothesis when z ≤ zα
x
⎞ ⎛
z zα the 1 - α level one-sided CI consists of the values µ0 for which this hypothesis testing problem has a p-value > α,
- r the values µ0 for which the size α
hypothesis test accepts the null hypothesis
⎟ ⎠ ⎞ ⎜ ⎝ ⎛ ∞ − ∈ , n z x σ μ
α
One-Sided z-Test II (H0: µ≥µ0)
The p-value for the two-sided hypothesis testing problem H0 : µ ≥ µ0 versus HA : µ < µ0 H0 : µ ≥ µ0 versus HA : µ µ0 based on a data set of n observations w/ a sample mean and a population SD σ is p-value = Φ(z) A size α test rejects the null hypothesis when z < -zα and accepts the null hypothesis when z ≥ -zα
x
⎞ ⎛
z zα the 1 - α level one-sided CI consists of the values µ0 for which this hypothesis testing problem has a p-value > α,
- r the values µ0 for which the size α
hypothesis test accepts the null hypothesis
⎟ ⎠ ⎞ ⎜ ⎝ ⎛ + ∞ − ∈ n z x σ μ
α
,
SLIDE 13
1/18/2007 13
Outline
Significance Levels (8.2.4) z-Tests (8.2.5)
z Tests (8.2.5)
Summary (8.3)
Summary I (8.3)
Decision process for inferences on a population m ean
SLIDE 14
1/18/2007 14
Summary II (8.3)
Sum m ary of the t-procedure
Summary III (8.3)
Sum m ary of the z-procedure