Download Example 1.Suppose that a pharmaceutical company

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

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Transcript
Handout 12. Chapter 8.4: Testing hypotheses about a
population mean m (large samples).
Example 2 . In trying a person for a crime, the jury
needs to decide between one of two possibilities:
Example 1.Suppose that a pharmaceutical company
is concerned that the mean potency µ of an
antibiotic does not meet the minimum government
potency standards. They need to decide between
two possibilities:
–The mean potency µ does not exceed the mean
allowable potency.
– The mean potency µ exceeds the mean
allowable potency.
– The person is guilty.
– The person is innocent.
• To begin with, the person is assumed innocent.
• The prosecutor presents evidence, trying to
convince the jury to reject the original
assumption of innocence, and conclude that the
person is guilty.
Main steps in testing statistical
hypotheses.
Types of Hypotheses: Two-Tailed Tests
•
1.Formulate the null hypothesis
and the research (alternative)
hypothesis.
The null hypothesis, H0:status quo, present state. Assumed to be
true until we can prove otherwise.
The alternative hypothesis, H1: it is called research, because it
implies that some action is to be performed. We do not prove H0
rather look for evidence to support H1.
–
H1 will be accepted as true if we can disprove H0
Court trial:
•
Example 3: Is it true that the average hourly wage of construction
workers in California is different from $14, which is the national
average?
– Answering this question is equivalent to testing the hypothesis :
H0: µ=14 against H1: µ≠14
where µ is the average hourly wage of construction workers in
the USA.
This is an example of a two-tailed test of hypotheses.
µ<14
µ=14
µ>14
Pharmaceuticals:
H0: innocent
H0: µ does not exceed allowed amount
H1: guilty
H1: µ exceeds allowed amount
directions of H1
1
Intuition
Types of Hypotheses: The one-tailed test
The statistic used to estimate the population mean µ is
the sample mean.
Data provide evidence against H0 , if the value of x
is larger than 8. How much larger?
•
Example 4: The average duration of Alzheimer’s disease from the
onset of symptoms until death is 8 years. A pharmaceutical
company claims to have developed a new drug which increases the
expected lifetime.
– Verifying the company’s claim would be equivalent to testing:
H0: µ=8 against H1: µ>8
where µ is the average duration of the disease (i.e. average time
before death).
This is an example of the one-tailed test of hypotheses.
µ=8
µ>8
µ=8
Data provide evidence against H0 if the value of
is different from 14. How much difference?
µ<14
direction of
H1
1.Formulate the null hypothesis and the research (alternative)
hypothesis.
2.Find the test statistic :
3.Find the rejection region (based on the critical values approach or
p-values ):
–
A rule that tells us for which values of the test statistic, or for
which p-values, the null hypothesis should be rejected.
4.Conclusion:
–
Either “Reject H0” or “Do not reject H0”, along with a statement
about the reliability of your conclusion.
How do you decide when to reject H0?
–
Depends on the significance level α, the maximum tolerable
risk in making a mistake, if you decide to reject H0.
–
Usually, the significance level is α = .01 , α = .1or α = .05.
µ=14
x
µ>14
2.Define a sample based test statistic- a statistic
calculated from the sample which will allow us to
reject or not reject H0.
Parts of a Statistical Test-
A single statistic calculated from the sample which will allow us to reject or
not reject H0.
µ>8
•
Assume that H0 is true. The sample mean x is our
best estimate of µ, and we use it in a standardized
form as the test statistic:
Z=
x − µ0 x − µ0
≈
σ / n s/ n
since x has an approximate normal distribution with mean µ0
and standard deviation σ / n .
2
Test Statistic for two –sided hypothesis
•
•
•
If H0 is true the value of x should be close to µ0, and z
will be close to 0. If H0 is false, x will be much larger or
smaller than µ0, and z will be much larger or smaller
than 0, indicating that we should reject H0.
For one- tailed :
– H1:µ > µ0 or H1: µ < µ0
Rejection regions are calculated using only one tail of
the sampling distribution.
Two Types of Errors
There are two types of errors which can occur in a statistical test.
Actual Fact Guilty
Jury’s
Decision
Innocent
Actual Fact H0 true
Your
(Accept H0)
Decision
H0 false
(Reject H0)
Guilty
Correct
Error
Correct
Type II Error
Innocent
Error
Correct
H0 true
(Accept H0)
H0 false
(Reject H0)
Type I Error Correct
Define:
• In this type of reasoning we can make errors:
– Type I error: reject the null hypothesis when this is true. (Indeed
the null hypothesis is true but we observe a rare event, with a
small probability)
– Type II error: the null hypothesis is not true, but we do not
reject it.
• In Example4.
Type I error –the drug in reality is not effective, but the sample average
is much bigger than 8,we did reject H0 . Result :we put a not effective
drug in a market.
Type II error –this drug is effective , but based on our sample we failed
to reject H0 .Result : We did not put the effective drug on the market.
Significance Level-defining the critical values and rejection
regions.
Fix a maximum value for the probability of the first type error. This
value is denoted by α and called significance level of the test.
• We then look for the critical value to divide the sample space in
acceptance and rejection region so that the probability of the first
type error is kept equal to α.
α
zα
α/2
zα/2
0.10
0.05
0.01
1.282
1.645
2.326
0.05
0.025
0.005
1.645
1.960
2.576
Critical value
α = P(Type I error) = P(reject H0 when H0 is true)
β =P(Type II error) = P(accept H0 when H0 is false)
The value of a is the significance level, and is controlled by the experimenter.
Sample space
8
Acceptance region:A
Area = α
Rejection region: R
3
:
Scheme
•
Example -continue .
The average duration of Alzheimer’s disease from the onset of symptoms until
death is 8 years. A pharmaceutical company claims to have developed a new
drug which increases the expected lifetime.
Verifying the company’s claim would be equivalent to testing:
To test H0: µ=µ0 use the test statistic
Z=
X − µ0
S
n
H
~ N(0,1)
H
1. If H1: µ>µ0 the rejection region is
R={ values z such that z > zα }
2. If H1: µ< µ0 the rejection region becomes
R={ values z such that z <- zα }.
3. If H1: µ≠ µ0 the rejection region becomes
R={ values z such that either z <- zα/2 or z > zα/2 }.
Find the rejection region:
α = 0.05, find zα such that p(Z> zα )=0.05.
zα = 1.645
Decision
: Reject
H
1.645
Acceptance
o
if
z
calc
0
> z α = 1.645
z=8
Rejection
Since the value of the test statistic lies in the
rejection region, the conclusion is to reject H0
and conclude that this drug is effective and increases
the expected lifetime.
1
We
test
: µ
= 8
: µ
> 8
have
a sample
X − µ 0
s /
n
calculate
10 − 8
z calc =
2 /
64
Z
( or µ ≤ 8 )
n = 64,
x = 10;
S 2 = 4
=
= 8
Acceptance/Rejection-another method
P- value is the probability ,calculated under Ho
that the test statistic takes a value equal to or more
extreme than the value observed.
-A large p-value means that the event we observe is highly
likely, if Ho is true, so there is nothing against the null
hypothesis. Do not reject H0
- A small p-value means that the event we observe is very
unlikely if the null hypothesis is true. Reject H0.
Conclusions: we reject the null hypothesis
If the p-value is smaller than the preassigned value a,
If a is not given – use a=0.05.
4
Example 3 –continue
Is it true that the average hourly wage of construction workers in
California is different from $14, which is the national average?
We then use the following reasoning:
If H0 is true, how likely is it to observe a value of the sample mean
equal to or larger than 10? We want to compute the probability of
this event:
From a sample of 49 individuals, we compute
that the sample mean is 14.5 and the standard deviation is 2.
Area = α/2
1)
Area = α/2
p( X
14
| H0)
10
- 8
)
2
64
≅ 0
p(Z
≥
p(Z
≥
Rejection Acceptance Rejection
region
region
region
Critical values
≥ 10
8)
=
So, data provide evidence against the null hypothesis.
The conclusion is: reject H0 and accept H1and
conclude that the drug increases the expected lifetime.
H0 : µ = 14
H1 : µ ≠ 14
test
3)
4)
Let α = 0.05, find zα/2 such that
P(Z> zα/2 )=0.025.
Zα/2 = 1.96
Reject Ho if z calc >1.96 or
Z calc <-1.96
x − µ0
Z=
s/ n
14.5 − 14
z calc=
= 1.75
2 / 49
-1.96
Rejection
1.96
Acceptance
5) Do not reject Ho and
conclude that the
average wage is $14.
p - value
= P (Z > 1.75)
= (1 − 0 . 9599 ) + 0 . 0401
+ P(Z < - 1.75)
=
= 0 . 0802
or
p − value
p − value
= 2 P ( Z > 1 . 75 ) = 0 . 0802
> α = 0 . 05
we do not reject
H o at α = 0 . 05
Rejection
5
p-value approach
Review: Steps in Hypothesis Testing
1. Specify the population value of interest.
2. Formulate the appropriate null and alternative
hypotheses.
3. Specify the desired level of significance.
– Also called observed level of significance
4. Determine the rejection region.
5. Obtain sample evidence and compute the
statistic.
• p-value: Probability of obtaining a test
statistic more extreme ( ≤ or ≥ ) than the
observed sample value given H0 is true
test
6. Reach a decision and interpret the result.
– Smallest value of α for which H0 can be
rejected
• Compare the p-value with α
– If p-value < α , reject H0
– If p-value ≥ α , do not reject H0
Hypothesis on a population mean.
Suppose the hypotheses are about the parameter m-population mean .
H0: m=m0
The test statistic is
x − µ
Z =
0
σ
n
and the rejection region is given by :
1)
If H1; m>m0
Reject H0 when zcalc>zα
p-value =P(Z > zcal)
2)
If H1; m<m0
Reject H0 when zcalc < -zα
p-value =P(Z < zcal)
3)
If H1; m∫m0
Reject H0 when | zcalc| > zα/2 it means:
p-value =P(|Z| >zcal)
zcalc <-zα/2 or zcalc > zα/2 ,
Reject H0 when p-value is small , let’s say p-value <a ,or p-value <0.05.
Example 5
A phone industry manager thinks that
customer monthly cell phone bill have
increased, and now average over $52 per
month. The company wishes to test this
claim. (Assume σ = 10 is known)
Form hypothesis test:
H0: µ ≤ 52 or =52 the average is not over $52 per month
H1: µ > 52
the average is greater than $52 per month
(i.e., sufficient evidence exists to support the
manager’s claim)
6
Test statistic, zcalc
Example: Find Rejection Region
Obtain sample evidence and compute the test statistic
Suppose a sample is taken with the following results:
n = 64, sample mean = 53.1 (σ=10 was assumed known)
– Then the test statistic is:
Suppose that α = .10 is chosen for this test
Find the rejection region:
Reject H0
Z=
x − µ 53.1 − 52
=
= 0.88
σ
10
64
n
α = .10
Do not reject H0
0
zα=1.28
Reject H0
Reject H0 if z > 1.28
Example: Decision
Reach a decision and interpret the
Reject H0
result:
p -Value Solution
Calculate the p-value and compare to
α
p-value = .1894
P( X ≥ 53.1 | µ = 52.0)
α = .10
Do not reject H0
0
1.28
z = .88
Reject H0
Do not reject H0 since z = 0.88 ≤ 1.28
i.e.: there is not sufficient evidence that the
mean bill is over $52
(continued)
Reject H0
α = .10
0
Do not reject H0
1.28
z = .88
Reject H0
⎛
⎞
⎜
53.1 − 52.0 ⎟
= P⎜ Z <
⎟
10
⎜
⎟
64 ⎠
⎝
p − value = P(Z ≥ 0.88) =
= .1894
Do not reject H0 since p-value = .1894 > α = .10
7
Example 6
• How much time do computer users spend
on the web? An Internet provider claims
that the time spent per week has a normal
distribution with mean µ=13 hours per
week and standard deviation σ=5.2 hours.
In a sample of 25 customers, the average
time was found to be 10 hours. Do the
data support the claim that the average
time spent by the population of computer
users is less than 13 hours per week? Use
α=0.1.
Example 7
• The manager of a health maintenance organization has
set as target that the mean waiting time of patients will
not exceed 30 minutes, and he wishes to check whether
this target is met. In a sample of 22 patients, the average
waiting time was 38 minutes. It can be assumed that the
waiting time in the population has normal distribution
with standard deviation σ=10, and that α=0.01.
• State the null and alternative hypothesis below.
• State the test statistic to use and indicate the rejection
region .
• Does the data provide evidence against the target?
• Describe what a type I error would be and what the
consequences would be.
8