Download Slides on hypothesis testing

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
Transcript
Criminal Trial
Example of hypothesis testing without the statistics:
a criminal trial
Statistical Methods
Introduction to Hypothesis Testing
The jury must decide between two hypotheses:
I
the null hypothesis
H0 : the defendant is innocent
Olivier Dubois
I
the alternative hypothesis
Ha : the defendant is guilty
The jury must make a decision based on the evidence (data).
1 / 20
Conclusions
2 / 20
Errors
I
null hypothesis:
I
the alternative hypothesis:
Type I error:
we decide to reject the null hypothesis when it is in fact true.
(we convict the defendant when he is in fact innocent)
H0 : the defendant is innocent
Ha : the defendant is guilty
We would want the probability of this type of error to be:
In hypothesis testing, there are two possible conclusions:
I
Rejecting the null hypothesis in favor of the
alternative. (convicting the defendant)
I
Failing to reject the null hypothesis.
(there is not enough evidence to convict the defendant)
I
very small for a murder trial (0.001)
I
larger for a civic trial, where a conviction means paying for the
damages to a car (0.4)
P( type I error ) = α
Usually in statistical tests we use α = 0.05 or 0.01.
This is also called the significance level.
4 / 20
3 / 20
Errors
Critical Concepts
1. There are two hypotheses:
the null hypothesis (H0 ) and the alternative hypothesis (Ha )
Type II error:
we fail to reject the null hypothesis when it is in fact false.
(the defendant is aquitted when he is in fact guilty)
2. We begin with the assumption that the null hypothesis is true.
P( type II error ) = β
3. We consider the evidence provided, and determine if it is
sufficiently convincing against the null hypothesis.
The probabilities of type I and II errors are inversely related:
decreasing one will increase the other. So for a given sample,
we cannot make both α and β very small at the same time.
4. Two possible decisions:
The only way to decrease the probability of making errors is to
get more evidence! (get more data)
5 / 20
I
There is enough evidence to support the alternative, so we
reject the null hypothesis.
I
There is NOT enough evidence to support the alternative,
so we fail to reject the null hypothesis.
6 / 20
Steps
Steps explained (1 of 4)
1. State the hypotheses: the null H0 and the alternative Ha
1. State the hypotheses: the null H0 and the alternative Ha
The null hypothesis H0 is always stating the equality (=).
Examples:
2. Select a significance level α and the type of test.
H0 : average height of pine trees = 225 cm
H0 : proportion of yellow fish = 0.2
3. Find the rejection region (upper-tail, lower-tail, two-tail).
H0 : average grade among females = average grade among males
The alternative hypothesis Ha can be either using 6=, > or <.
Examples:
4. Calculate the test statistic, and determine if the value lies
in the rejection region.
Ha : average height of pine trees 6= 225 cm
Ha : proportion of yellow fish > 0.2
Ha : average grade among females < average grade among males
8 / 20
7 / 20
Steps explained (2 of 4)
Steps explained (3 of 4)
3. Find the rejection region (upper-tail, lower-tail, two-tail).
2. Select the significance level α and the type of test.
How often do we accept to make type I errors?
α = P(type I error)
Usually α = 0.05 or 0.01.
Types of test:
mean, proportion, variance, comparing two groups/samples,
small vs large sample?, etc.
two-tail (µ 6= µ0 )
upper-tail (µ > µ0 )
9 / 20
10 / 20
Steps explained (4 of 4)
4. Calculate the test statistic, and determine if the value lies
in the rejection region.
Test for a proportion (if n is large enough)
The test statistic depends on the type of test we are using.
Test for a mean (if data is normally distributed)
t∗ =
X̄ − µ0
√
s/ n
More to come!
∼ tn−1
X̄ − µ0
√
s/ n
∼ N(0, 1)
Note: In the above formulas, µ0 and p0 denote the mean and
proportion that is assumed in the null hypothesis H0 .
Test for a mean (if n > 30)
z∗ =
p̂ − p0
z∗ = p
p0 (1 − p0 )/n
∼ N(0, 1)
11 / 20
12 / 20
Conclusion of the test
Example 1
I
If the value of the test statistic lies in the rejection region,
then we reject the null hypothesis in favor of the alternative.
A department store manager determines that a new billing
system would be cost-effective only if the average monthly
account is more than $170.
I
Otherwise, we fail to reject the null hypothesis.
A random sample of 80 monthly accounts is drawn, for which
the sample mean is $178, with a standard deviation of $30.
Can we conclude that the new system will be cost-effective?
(Use a 5% significance level.)
NEVER SAY THAT WE ACCEPT THE NULL HYPOTHESIS
OR THAT THE NULL HYPOTHESIS IS TRUE!!!
14 / 20
13 / 20
Example 2
Example 3
The University of Colorado claims that graduation rate for
women athletes is 67%. Over the past several years, among a
random sample of 38 women athletes, 21 of them eventually
graduated.
The output voltage for a certain electric circuit is specified to be
130V. A sample of 25 independent readings on the voltage
gave a sample mean of 128.9V and a standard deviation of
2.1V. Assume that the readings follow a normal distribution.
Does this indicate that the percentage of all women athletes
who graduate at the University of Colorado is different from
67%?
Test the hypothesis that the actual output voltage is less than
from 130V, using a 1% significance level.
Use a 5% significance level.
15 / 20
P-value
16 / 20
Finding the P-value
The P-value is the area in the tail of the distribution,
further than the test statistic.
I
The P-value is a measure of how convincing the evidence
is against the null hypothesis.
I
It is the probability of getting the data that we have under
the null hypothesis.
I
The smaller the P-value, the less likely it is that the null
hypothesis is true.
Double the P-value for a two-tail test (6=).
17 / 20
18 / 20
Conclusion of the test
Interpretation of the P-value
(using the P-value)
I
If P is less than 0.01:
the evidence is overwhelming against the null hypothesis.
I
Compare the P-value with the significance level α.
If P is between 0.01 and 0.05:
the evidence is strong against the null hypothesis.
I
If P < α, then we reject the null hypothesis in favor of the
alternative.
If P is between 0.05 and 0.1:
If P > α, then we fail to reject the null hypothesis.
the evidence is weak against the null hypothesis.
I
If P exceeds 0.1:
there is essentially no evidence against the null hypothesis.
19 / 20
20 / 20