Download Statistical Hypotheses

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Foundations of statistics wikipedia , lookup

Psychometrics wikipedia , lookup

Omnibus test wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
Statistical Hypotheses
A statistical hypothesis is an assertion or conjecture about a population,
which may be expressed in terms of
◦ some parameter: mean is zero;
◦ some parameters: mean and median are identical; or
◦ some sampling distribution: this sample is normally distributed.
Test problem - decide between two hypotheses
◦ the null hypothesis H0 and
◦ the alternative hypothesis Ha .
Popperian approach to scientific theories
◦ Scientific theories are subject to falsification.
◦ It is impossible to verify a scientific theory.
Null hypothesis H0
default (current) theory which we try to falsify
Alternative hypothesis Ha
alternative to adopt if null hypothesis is rejected
Examples:
◦ Clinical study of new drug - H0 : drug has no effect
◦ Criminal case - H0 : suspect is not guilty
◦ Safety test of nuclear power station - H0 : power station is not safe
◦ Chances of new investment - H0 : project not profitable
◦ Testing for independence - H0 : random variables are independent
Testing Hypotheses II, Feb 18, 2004
-1-
Statistical Tests
Example: Testing for pesticide in discharge water
Suppose the Environmental Protection Agency takes 10 readings on the
amount of pesticide in the discharge water of a chemical company.
Question: Does the concentration cP of pesticide in the water exceed the
allowed maximum concentration c0 ?
◦ Before taking action against the company, the agency must have some
evidence that the concentration cP exceeds the allowed level.
◦ Without evidence the agency assumes that the pesticide concentration
cP is within the limits of the law.
Consequently, the null hypothesis of the agency is that the pesticide concentration cP does not exceed c0 . Thus the question corresponds to the
test problem
H0 : c P ≤ c 0
vs
Ha : c P > c 0 .
Suppose that the company regularly also runs tests on the amount of pesticide in the discharge water.
Question: Does the concentration cP of pesticide in the water exceed the
allowed maximum concentration c0 ?
◦ The aim of the company is to avoid fines for exceeding the allowed
level. Thus the company wants to make sure that the concentration
stays within the allowed limits.
Thus, the null hypothesis of the company should be that the pesticide
concentration cP exceeds c0 . The question now corresponds to the test
problem
H0 : c P ≥ c0
vs
Testing Hypotheses II, Feb 18, 2004
Ha : c P < c 0 .
-2-
Six Steps of Conducting a Test
Steps of a significance test
1. Determine null hypothesis H0 and alternative Ha .
2. Decide on probability of type I error, the significance level α.
3. Find an appropriate test statistic T .
4. Based on the sampling distribution of T , formulate a criterion for
testing H0 against Ha .
5. Calculate value of the test statistic T .
6. Decide whether or not to reject the null hypothesis H0 .
Example: Fair coin (contd)
We want to decide from 100 tosses of a coin whether it is fair or not. Let
θ be the probability of heads.
1. Test problem:
H0 : θ = 21
vs
Ha : θ 6=
1
2
2. Significance level:
α = 0.05
(most commonly used significance level)
3. Test statistic:
T =X
(number of heads in 100 tosses of the coin)
4. Rejection criterion:
reject H0 if T ∈
/ [40, 60]
5. Observed value of test statistic: Suppose after 100 tosses we obtain
t = 55
6. Decision: Since 55 does not lie in the rejection region, we
do not reject H0 .
Testing Hypotheses II, Feb 18, 2004
-3-
One and Two-sided Hypotheses
Example: Blood cholesterol after a heart attack
Suppose we are interested in whether the blood cholesterol level two days
after a heart attack differs from the average cholesterol level in the (general)
population (µ0 = 193).
Two cases:
◦ We are interested in any difference from the population mean µ0 . Then
we have a two-sided test problem
H0 : µY1 = µ0
vs
H0 : µY1 6= µ0 .
◦ We suspect that the cholesterol level after a heart attack might me
higher than in the general population. In this case, we have a one-sided
test problem
H0 : µY1 = µ0
vs
H0 : µY1 > µ0 .
Remark:
◦ More generally, we might be interested in one-sided test problems of
the form
H0 : µY1 ≤ µ0
vs
H0 : µY1 > µ0 ,
which accounts for the possibility that µ might be smaller than µ0 .
◦ For all common test situations (in particular those discussed in this
course), the form of the test does not depend on the form of H0 , but
only on the parameter value in H0 that is closest to Ha , that is µ0 .
Testing Hypotheses II, Feb 18, 2004
-4-
Test Statistic
Let θ be the parameter of interest.
Two-sided test problem
H0 : θ = θ0 against Ha : θ 6= θ0
One-sided test problem
H0 : θ = θ0 against Ha : θ > θ0
(or Ha : θ < θ0 )
Suppose that θ̂ is an estimate for θ.
◦ If θ = θ0 (null hypothesis), we expect the estimate θ̂ to take a value
near θ0 .
◦ Large deviations from θ0 are evidence against H0 .
This suggests the following decision rules:
◦ Ha : θ > θ0 : reject H0 if θ̂ − θ0 is much larger than zero
◦ Ha : θ < θ0 : reject H0 if θ̂ − θ0 is much smaller than zero
◦ Ha : θ 6= θ0 : reject H0 if |θ̂ − θ0 | is much larger than zero
Problem: Often the sampling distribution of the estimate θ̂ depends on the
unknown parameter θ.
Definition (Test statistic)
A test statistic is a random variable
◦ that measures the compatibility between the null hypothesis and the
data and
◦ has a sampling distribution which we know (under H0 ).
Testing Hypotheses II, Feb 18, 2004
-5-
Test Statistic
Example: Blood cholesterol after a heart attack
Data: X1 , . . . , X28
◦ blood cholesterol level of 28 patients two days after a heart attack
2
◦ assumed to be normally distributed with mean µX and variance σX
The parameter µ can be estimated by the sample mean
28
2 1 P
σX
X̄ =
Xi ∼ N µX ,
.
28 i=1
28
This suggests to the standardized sample mean as a test statistic
X̄ − µ0
√
∼ N (0, 1)
σ/ 28
(under H0 ).
Test H0 : µ ≤ 193 vs Ha : µ > 193 at significance level α = 0.05
◦ Test statistic: Assume σ = 47.7 to be known.
T =
X̄ − µ0
√
σ/ 28
◦ Rejection criterion: Reject H0 if T > z0.05 = 1.645
◦ Outcome of test: Since the observed value of T is
t=
253.9 − 193
√
= 6.76,
47.7/ 28
we reject the null hypothesis that µ = 193.
Testing Hypotheses II, Feb 18, 2004
-6-
Tests for the Mean
Tests for the mean µ (σ 2 known):
◦ Test statistic:
T =
X̄ − µ0
√
σ/ n
◦ Two sided test:
H0 : µ = µ0 against Ha : µ 6= µ0
reject H0 if |T | > zα/2
◦ One sided tests:
H0 : µ = µ0 against Ha : µ > µ0
reject H0 if T > zα
(µ < µ0 )
(T < −zα )
Tests for the mean µ (σ 2 unknown):
◦ Test statistic:
T =
X̄ − µ0
√
s/ n
◦ Two sided test:
H0 : µ = µ0 against Ha : µ 6= µ0
reject H0 if |T | > tn−1,α/2
◦ One sided tests:
H0 : µ = µ0 against Ha : µ > µ0
reject H0 if T > tn−1,α
(µ < µ0 )
(T < −tn−1,α )
Example: Blood cholesterol after a heart attack
Estimating the standard deviation from the data, we obtain the test statistic
T =
X̄ − µ0
√
∼ t27 .
s/ 28
Noting that t27,0.05 = 1.703 and t = 6.76, we still reject H0 .
Testing Hypotheses II, Feb 18, 2004
-7-
Tests and Confidence Intervals
Consider level α significance test for the two-sided test problem
H0 : θ = θ0 vs Ha : θ 6= θ0 .
Let
◦ T = Tθ0 (X) be the test statistic of the test (depends on θ0 )
◦ R be the critical region of the test
Then
C(X) = {θ : Tθ (X) ∈
/ R}
is a (1 − α) confidence interval for θ: If θ is the true parameter, then
Pθ θ ∈ C(X) = Pθ Tθ (X) ∈/ R = 1 − Pθ Tθ (X) ∈ R = 1 − α.
We have
θ0 ∈ C(X) ⇔ Tθ0 (X) ∈
/ R ⇔ H0 is not rejected
Result A level α two-sided significance test rejects the null hypothesis
H0 : θ = θ0 if and only if the parameter θ0 falls outside a (1 − α)
confidence interval for θ.
Example: Normal distribution
iid
Let X1 , . . . , Xn ∼ N (µ, σ 2 ). We reject H0 : µ = µ0 if
X̄ − µ0 √ > tn−1,α/2
s/ n
or equivalently
X̄ − µ0 > tn−1,α/2 √s
n
Rearranging terms, we find that we reject if
h
i
s
s
µ0 ∈
/ X̄ − tn−1,α/2 √ , X̄ + tn−1,α/2 √ .
n
Testing Hypotheses II, Feb 18, 2004
n
-8-
The P -value
Definition (P -value)
The probability that under the null hypothesis H0 the test statistic
would take a value as extreme or more extreme that that actually
observed is called the P -value of the test.
The P -value is often interpreted a measure for the strength of evidence
against the null hypothesis: the smaller the P -value, the stronger the evidence.
However:
◦ The P -value is a random variable (under H0 uniformly distr. on [0, 1]).
◦ Without a measure of its variability it is not safe to interpret the actually observed P -value.
◦ If the P -value is smaller than the chosen significance level α, we reject
the null hypothesis H0 .
Three approaches to deciding on test problem:
◦ reject if θ0 ∈
/ C(X)
◦ reject if T (X) ∈ R
◦ reject if P -value p ≤ α
Example: Blood cholesterol after a heart attack
The observed value for the test statistic
T =
X̄ − µ0
√
∼ t27 .
s/ 28
is t = 6.76. The corresponding P -value is
P(T > 6.76) = 1.47 · 10−07.
We thus reject the null hypothesis.
Equivalently, the confidence interval for µ is [235.43, 272.42]. Since it does
not contain µ0 = 193 we reject H0 (for the third and last time!).
Testing Hypotheses II, Feb 18, 2004
-9-
Example
Data: Banks’ net income
◦ percent change in net income between first half of last year and first
half of this year
◦ sample mean x̄ = 8.1%
◦ sample standard deviation s = 26.4%
Test problem: H0 : µ = 0 against Ha : µ 6= 0
. ttesti 110 8.1 26.4 0
One-sample t test
-----------------------------------------------------------------| Obs
Mean
Std. Err.
Std. Dev.
[95% Conf. Interval]
----+------------------------------------------------------------x | 110
8.1
2.517141
26.4
3.111108
13.08889
-----------------------------------------------------------------Degrees of freedom: 109
Ho: mean(x) = 0
Ha: mean < 0
t =
3.2179
P < t =
0.9991
Ha: mean != 0
t =
3.2179
P > |t| =
0.0017
Ha: mean > 0
t =
3.2179
P > t =
0.0009
Critical value of t distribution with 109 degrees of freedom:
t109,0.025 = 1.982
Result:
◦ |t| > t109,0.025 , therefore the test rejects H0 at significance level α = 0.05.
◦ Equivalently, µ0 = 0 ∈
/ [3.11, 13.09] and thus the test rejects H0 .
◦ Equivalently, P -value is less than α = 0.05 and thus the test rejects H0 .
Testing Hypotheses II, Feb 18, 2004
- 10 -