Download Hypothesis Testing: Simple vs. Composite Null Hypotheses and Errors and more Study notes Statistics in PDF only on Docsity!
Statistics 431:
Statistical Inference
Lecture 6: More on hypothesis testing
Simple vs. composite null hypotheses
- We have seen null hypotheses of the form^ and .
- These are^ simple^ null hypotheses: there is only one null distrn, eg.
- Could also have eg^. This is a^ composite^ null hypothesis: there is a set of null distrns , one for each negative.
- This could be a problem: the significance level^ is the probability of rejecting the null hypothesis when it is true. - for a simple null, we pick a critical value to attain level for just one null distrn - for a composite null, must give level for all the null distrns
H 0 : μ = 0 H 0 : p = 1 / 2
N ( 0 , σ 2 ), Bin( n , 1 / 2 ) H 0 : μ ≤ 0 N (μ, σ 2 ) μ α
c (α)
α α
c (α)
Errors in hypothesis testing
- Choose significance level^ : prob. of rejecting a true^.
- One other kind possible mistake: accept a false^.
- Rejecting true^ is a Type I error; accepting false is a Type II error.
- We need a name for the probability of a Type II error:
- consists of many distrns, but to think about^ we have to single out one as having generated the data.
- We would like both^ and^ to be small, but in practice we must always trade them off.
- Hypothesis testing addresses this by^ fixing^ , then looking for a test that makes as small as possible.
α H 0
β = P μ (^) A (accept H 0 )
H (^) A β
H 0
H 0
H 0
α β
α β
= P μ (^) A (test statistic does not fall in rejection region)
Power
- is^ called the^ power^ of the test procedure: the prob. we reject when it is false (a good move).
- We choose^ ,^ , and a test statistic, and we set a significance level (which gives a critical value).
- Then, the power of the test procedure is determined by which particular distrn in really generated the data.
- For a given significance level, and a given^ , different test statistics have different powers.
- Sometimes one test is^ most powerful^ - among all tests at level , it has the largest (best) power, no matter which is true.
- Other times, no test is most powerful. eg:.
1 − β H 0 H (^) A
μ (^) A ∈ H (^) A
α
N (μ, σ 2 ), H 0 : μ = 0 , H (^) A : μ != 0
H 0
H A
μ (^) A ∈ H (^) A
Testing a population mean
- Observe^ IID from a population distrn with unknown mean and variance.
- Consider three kinds of hypothesis setups:
- (two-sided)
- (one-sided)
- (one-sided)
- For all three setups, it turns out that a good test statistic is .
- in cases (2) and (3), though has many distrns, we can set a critical value for by considering just the boundary case (as discussed)
- Just need to figure out critical value at level^ in each case.
X (^) 1 ,... , X (^) n
H 0 : μ = μ 0 vs. H (^) A : μ != μ (^0) H 0 : μ ≤ μ 0 vs. H (^) A : μ > μ (^0) H 0 : μ ≥ μ 0 vs. H (^) A : μ < μ (^0)
T = ( X ¯ − μ 0 )/( S /
n ) H 0 c α μ (^0) α
Testing a mean: critical values
- Same business as with confidence intervals: we can figure out (approximate) null distrn for any population when is large, or (exact) null distrn for a normal population when is small.
- Large sample:^ , so
- (two-tailed test.)
- (upper-tailed test.)
- (lower-tailed test.)
- Small sample, normal population:^ , so
- reject when
- reject when
- reject when
n
T ≈ N ( 0 , 1 )
H (^) A : μ != μ 0 ⇒ reject when | T | > c.
H (^) A : μ > μ 0 ⇒ reject when T > c.
H (^) A : μ < μ 0 ⇒ reject when T < c.
c (α) = z (^) α/ 2.
c (α) = z (^) α.
c (α) = − z (^) α.
| T | > t α 2 ; n − 1 T > t (^) α; n − 1 T < − t (^) α; n − 1
n
T ∼ t (^) n − 1
- How do we figure out^?
- Power 0.9 against^ means a type II error prob
- Interlude at the board.
- In general,
will give power against the alternative , provided the solution is reasonably large. (This is the upper-tailed case.)
- In the example, with^ , we get
- Verify on your own: same formula applies to lower-tailed test.
- Derive for yourself: formula in the case of a two-tailed test. (See Devore for answer.)
n μ = μ ′ β = 0. 1.
n =
σ ( z (^) α + z (^) β ) μ 0 −μ ′
1 − β
α = 0. 05 , power = 0. 9 , σ = 10 , μ 0 = 1 n = ( 10 · ( 1. 64 + 1. 28 )/ − 1 ) 2 ≈ 853.
μ = μ ′ n
CIs and tests: duality
- How does the two-sided test relate to a CI for?
- Imagine we do the test at level^ , and separately, we construct a CI for.
- then the test rejects exactly when the value lies outside the CI
- ie, the test accepts as a plausible mean for (at level ) exactly when lies inside a CI for
- From the reverse perspective: a^ CI for^ consists of exactly those values for which would not be rejected.
- Why? Interlude at the board.
X ¯ ∼ N (μ, σ 2 / n ), T = ( X ¯ − μ 0 )/(σ/√ n ). H 0 : μ = μ 0 vs. H (^) A : μ != μ (^0) μ α 100 ( 1 − α)% μ (^0)
X ¯
H 0 : μ = μ (^0)
μ
μ (^0) α μ 0 100 ( 1 − α)% μ 100 ( 1 − α)% μ μ (^0)
- The p-value is also called the^ observed significance level^ or the achieved significance level , which should make sense.
- The p-value contains more information than the statement “ was rejected at pre-specified level ”: for every possible , the p-value determines the test outcome. - -
- Note:
ie, the p-value is the probability (under ) of seeing another test statistic value at least as large as.
H 0
α
p-value ≤ α ⇐⇒ T > c (α) ⇐⇒ reject
α = PH 0 ( T > c (^) α ) p-value = PH 0 ( T ′^ > T | T )
T
α
p-value > α ⇐⇒ T ≤ c (α) ⇐⇒ accept
H 0
Selecting a test procedure
- To set up a test procedure, we
- define and
- choose a test statistic
- decide to reject for large , small , or large
- choose , which implies critical value
- We want our test to have good power against the alternatives in . So far, for tests about , we have chosen in terms of , with no justification.
- We would like a general principle for choosing a test which guarantees maximal power.
- When this is not possible, we’d like a way of finding tests which often have good power in practice.
H 0 H A
T
| T |
α c (α)
μ X ¯
T T
H A T
- The^ likelihood-ratio statistic^ is
- The likelihood-ratio test procedure (LRT) is:
- choose a critical value
- reject when. (“Reject for small values of the likelihood-ratio statistic.”)
- It can be shown that when^ and^ are simple, the LRT is the most powerful test possible: the Neyman-Pearson lemma.
- It can also be shown that when^ is composite, the LRT is sometimes the best (“uniformly most powerful”) test.
- It turns out that the one-sided tests about^ we have seen so far are equivalent to the LRT, and are uniformly most powerful.
λ( x 1 ,... , x (^) n ) =
maximal lik. for θ ∈ # (^0) maximal lik. for θ ∈ # (^) A
c (α) H 0 λ( x (^) 1 ,... , x (^) n ) < c (α)
H 0 H^ A
H A
μ
- We perform a test, the p-value is 0.0001. “Highly significant.”
- At this point, we know that one of the many values in^ is correct. But which one?
- If the true^ is^ , we ought to reject...
- But practically speaking, does 100.1 vs 100 really matter?
- If we are sure (p = 0.0001) that a new drug is 0.1% more effective than an established, well-studied alternative, should we switch?
- For any^ (no matter how close to 100), a large enough sample size will allow us to reject. Beware of “statistical” significance.
- How to make statistical = practical significance in this example?
Statistical vs. practical significance
H 0 : μ ≤ 100 vs H (^) A : μ > 100.
H A
μ μ ′^ = 100. 1
μ ∈ H (^) A H 0