Download Lecture 27 - UVic Math

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

Gaia hypothesis wikipedia , lookup

Psychometrics wikipedia , lookup

Transcript
Stat 260 - Lecture 27
• Recap of Last Class: We introduced the t
distribution and used it to derive a 100(1 −
α)% CI for the mean of a normal population (valid for small samples).
• Today: We will introduce hypothesis testing: a process which uses sample data to
make decisions regarding population parameters.
• Definition: A statistical hypothesis is a
claim or assertion about the value of a single or several parameters.
Parameters can be population characteristics or characteristics of a probability distribution.
• For example, if µ is a population mean, we
might be interested in testing the hypothesis µ = 40 or µ = 0 or µ > 0 and so on...
• In any hypothesis testing problem there are
two contradictory hypotheses under consideration. For example, one hypothesis
might claim µ = 0.75 and the other µ 6=
0.75.
Or, if the parameter of interest was a population proportion, then one hypothesis might
be p = 0.5 and the corresponding contradictory hypothesis might be p > 0.5.
• The objective of hypothesis testing is to
decide, based on a sample of observed data,
which of the two hypotheses is correct.
Hypothesis → Data → Decision
• In testing statistical hypotheses the problem is formulated so that one of the claims
is initially favored. The initially favored
claim will not be rejected in favor of the
alternative claim unless the evidence in a
sample of data contradicts it and provides
strong support for the alternative claim →
Similar to a criminal trial where we start
by assuming an individual is innocent (first
hypothesis) and only reject this claim if we
see strong evidence to the contrary.
• Definition: The null hypothesis denoted
by H0 is the claim that is initially assumed
to be true. The alternative hypothesis,
denoted by Ha, is the claim that contradicts H0.
• The null hypothesis will be rejected in favor
of the alternative hypothesis only if the
evidence ion the sample suggests that H0
is false. If the sample does not contradict
H0, we will not reject it.
• So, there are two possible outcomes from
a hypothesis test
1. reject H0
2. fail to reject H0
• In all cases we consider, the null hypothesis
will be an equality statement such as
H0 : θ = θ0
where θ0 is a specified and known value
called the null value of the parameter.
• The alternative to H0 : θ = θ0 can take one
of several forms depending on the context
1. Ha : θ > θ0
2. Ha : θ < θ0
3. Ha : θ 6= θ0
• Test Procedures: A test procedure is a
rule, based on a sample of data, for deciding whether to reject H0.
• A test procedure is specified by the following:
1. A test statistic, a function of the sample data on which the decision is to be
based.
2. A rejection region, the set of all test
statistic values for which H0 will be rejected.
• For example, if we were interested in testing a population mean
H0 : µ = 4 Vs Ha : µ > 4
we might base our test procedure on the
statistic X̄, since
E[X̄] = µ
If the observed value, x̄, is much larger than
4 we would reject H0. So, for example, we
might take as our rejection region
{x̄ : x̄ > 6}
Errors in Hypothesis Testing
• When conducting tests of hypothesis, two
types of errors can be made:
1. A type I error consists of rejecting the
null hypothesis when it is true.
2. A type II error involves not rejecting
H0 when H0 is false.
The possible errors and decisions can be
summarized in a table.
• Since the decisions are based on statistics,
which before the data are collected, are
random variables any test procedure has
an associated probability of type I error
which we denote by α and probability of
type II error which we denote by β. A
good test procedure leads to small α and
β.
• The value of α is usually fixed beforehand
to control, the type I error of the test. This
fixed type I error rate, α, is known as the
level of significance or size of the test.
A typical value is α = 0.05.
Large Sample Test for a Population Mean
• Consider testing a population mean µ. The
null hypothesis will state that µ takes a
particular value, the null value which we
denote by µ0.
H0 : µ = µ0
There are three possible alternative we might
be interested in
1. Ha : µ > µ0 (one-sided alternative)
2. Ha : µ < µ0 (one-sided alternative)
3. Ha : µ 6= µ0 (two-sided alternative)
• Our test will be based on the statistic
Z=
X̄ − µ0
√
S/ n
• We will assume the n > 40 so that when
H0 : µ = µ0 is true we have
Z ∼ N (0, 1)
That is, under the null hypothesis, our statistic
X̄ − µ0
Z=
√
S/ n
has a N (0, 1) distribution.
• Consider testing H0 : µ = µ0 against Ha :
µ > µ0
• If the true value of µ is greater than µ0 then
since E[X̄] = µ we would expect X̄ −µ0 > 0
→
X̄ − µ0
√ >0
S/ n
So positive values of our statistic, Z, give
evidence against the null hypothesis, H0 :
µ = µ0, in favor of the alternative, Ha : µ >
µ0 .
• We will therefore reject H0 when Z ≥ c for
some fixed constant c > 0. How should we
choose c?
• We determine c by fixing the type I error
at α.
α = P (type I error)
= P (H0 is rejected when H0 is true)
= P (Z ≥ c when H0 is true)
1 − φ(c) (when H0 is true)
so we have
α = 1 − φ(c)
→ c = zα
the (1−α)th percentile of the standard normal distribution.
• So a size α test of H0 : µ = µ0 against
Ha : µ > µ0 rejects H0 in favor of Ha when
X̄ − µ0
√ ≥ zα
S/ n
• Using similar reasoning, a size α test of
H0 : µ = µ0 against Ha : µ < µ0 reject H0
in favor of Ha when
X̄ − µ0
√ ≤ zα
S/ n
• Finally, if the alternative is two-sided, Ha :
µ 6= µ0, we will reject H0 for both large and
large negative values of Z. That is, we will
reject H0 when
Z ≥ c or Z ≤ −c
for some constant c > 0.
• Again, we choose c so that the type I error
rate is fixed at size α.
α = P (type I error)
= P (H0 is rejected when H0 is true)
= P (Z ≥ c or Z ≤ −c when H0 is true)
1 − φ(c) + φ(−c) (when H0 is true)
= 2(1 − φ(c))
→ 1 − φ(c) =
α
2
→ c = zα/2
so we reject H0 : µ = µ0 in favor of Ha :
µ 6= µ0 when
Z ≥ z α or Z ≤ −z α
2
2
• So in summary, for testing a population
mean H0 : µ = µ0, we use the statistic
Z=
X̄ − µ0
√
S/ n
The rejection region for a level α test for
each possible alternative is
Alternative
Ha : µ > µ0
Ha : µ < µ0
Ha : µ 6= µ0
Rejection Region
Z ≥ zα
Z ≤ −zα
Z ≥ z α or Z ≤ −z α
2
2
• The test is valid provided n > 40, regardless of the population distribution.
• This is known as a Z-test since, under H0,
the test statistic has a standard normal distribution.
P-values
• When conducting a hypothesis test, a standard measure of the strength of evidence
against H0 is known as the P-value. The
smaller the P-value, the more evidence there
is against H0.
• Definition: The P-value is the probability,
computed under the assumption the H0 is
true, that a rerun of the experiment would
yield a value of the test statistic that is at
least as extreme as the observed value.
• Once the p-value has been determined, the
conclusions of the hypothesis test at any
particular level α results from comparing
the p-value to α:
1. P-value ≤ α → reject H0 at level α
2. P-value > α → do not reject H0 at level
α
• For testing a population mean using a Ztest, the P-value is easily obtained from
the computed value of the test statistic
x̄ − µ0
z=
√
S/ n
• Once z has been calculated the P-value for
testing H0 : µ = µ0 is obtained as
Alternative
Ha : µ > µ0
Ha : µ < µ0
Ha : µ 6= µ0
P-value
1 − φ(z)
φ(z)
2[1 − φ(|z|)]
• In each case, the P-value represents the
probability, assuming the null hypothesis is
true, that an additional run of the experiment would yield a test statistic at least as
extreme as the observed value.
• In our example for testing
H0 : µ = 30 against Ha : µ < 30
we found z = −0.73.
In this case the
P-value = φ(−0.73) = 0.2327
and since this is > 0.05 we do not reject
H0 at level α = 0.05.
• Homework: Problem set 28