hypothesis test about the mean and proportion 9 slides.pdf · 2008-03-12 · hypothesis tests: an...
TRANSCRIPT
DEPARTMENT OF QUANTITATIVE METHODS & INFORMATION SYSTEMS
Introduction to Business StatisticsQM 220
Chapter 9Hypothesis test about the mean and proportion
Dr. Mohammad ZainalSpring 2008
Hypothesis tests: An introduction2
Why do we need to perform a test of hypothesis?
I t t f h th i t t t i i th b li f
2
In a test of hypothesis, we test a certain given theory or beliefabout a population parameter.
We may want to find out, using some sample information,whether or not a given claim about a population parameter istrue.
A soft‐drink company may claim that on average its cancontain 12 ounces of soda. A government agency may want totest whether or not this claim is true or not.
How do we perform that test?
QM-220, M. Zainal
Hypothesis tests: An introduction3
Suppose we take a sample of 100 cans of the soft drink underinvestigation. We find out that the mean amount of soda in
3
investigation. We find out that the mean amount of soda inthese 100 cans is 11.89 ounces
Based on this result can we state that on average all such cansBased on this result, can we state that on average all such canscontain less than 12 ounces of soda and the company is lying tothe public?the public?
Not until we perform a test of hypothesis can we say that.
The reason is that the mean = 11.89 ounces, is obtained from asample ?
The difference may have occurred because of some samplingerror.
QM-220, M. Zainal
Hypothesis tests: An introduction4
Another sample of 100 cans may give us a mean of 12.04.
Th f f t t f h th i t fi d t h
4
Therefore, we perform a test of hypothesis to find out howlarge the difference between 12 ounces and 11.89 ounces is andto investigate whether or not this difference has occurred as ato investigate whether or not this difference has occurred as aresult of chance alone.
N if 11 89 i h f ll d f 100Now, if 11.89 ounces is the mean for all cans and not for 100cans, then we do not need to make a test of hypothesis. Instead,e a i ediately tate that the ea a ou t of oda i allwe can immediately state that the mean amount of soda in all
such cans is less than 12 ounces.
We perform of hypothesis only when we are making a decisionabout a population parameter based the value of a samplet ti ti
QM-220, M. Zainal
statistic .
Hypothesis tests: An introduction5
Two hypothesisConsider an example of a person who has been indicted for
5
o i e a e a p e o a pe o o a ee i i e ocommitting a crime and is being tried in a court. Based on theavailable evidence, the judge will make one of the followingj g gdecisions:
The person is not guilty (null hypothesis, Ho).The person is not guilty (null hypothesis, Ho).
The person is guilty (alternative hypothesis, H1).
A null hypothesis is a claim (or statement) about a populationparameter that is assumed to be true until it is declared false.
An alternative hypothesis is a claim about a populationparameter that will be true if the null hypothesis is false.
QM-220, M. Zainal
Hypothesis tests: An introduction6
The alternative hypothesis is often what the test is attemptingto establish.
6
to establish.
The research hypothesis should be expressed as the alternativehypothesishypothesis.
The conclusion that the research hypothesis is true comesf l d h di h ll h h ifrom sample data that contradict the null hypothesis.
Manufacturers’ claims are usually given the benefit of thedoubt and stated as the null hypothesis.
The conclusion that the claim is false comes from sample datapthat contradict the null hypothesis.
QM-220, M. Zainal
Hypothesis tests: An introduction7
In the court example, we start the prosecution by assuming theperson is not guilty.
7
person is not guilty.
The prosecutors collect all possible evidences to prove the nullhypothesis is false (guilty)hypothesis is false (guilty).
Rejection and nonrejection regionsj j g
Not enough evidence to declare theperson guilty and hence the null
Enough evidence to declare the personguilty and hence the null hypothesis isperson guilty and, hence, the null
hypothesis is not rejected in this regionguilty and, hence, the null hypothesis isrejected in this region
Nonrejection region Rejection region
Level of evidence0
C
Critical point
QM-220, M. Zainal
Hypothesis tests: An introduction8
The null hypothesis:Often represents the existing belief
8
Often represents the existing belief.Is maintained, or held to be true, until a test leads to its rejectionin favor of the alternative hypothesis.in favor of the alternative hypothesis.Is accepted as true or rejected as false on the basis of aconsideration of a test statistic.
A hypothesis is either true or false, and you may fail to reject itor you may reject it on the basis of information.y y j
A test statistic is a sample statistic computed from sample data.The value of the test statistic is used in determining whether orThe value of the test statistic is used in determining whether ornot we may reject the null hypothesis.
QM-220, M. Zainal
Hypothesis tests: An introduction9
Rejection and nonrejection regions9
Actual Situation
The person is not guilty
The person is guilty
Court’sThe person is not guilty
Correct decision
Type II or β errorCourt s
decisionβ
The person is guilty
Type I orα error
Correct decisionguilty α error decision
QM-220, M. Zainal
Hypothesis tests: An introduction10
Adecision may be incorrect in two ways:
Ty e I E o Reje t a t ue Ho
10
Type I Error: Reject a true Ho
The Probability of a Type I error is denoted by α.
α is called the level of significance of the test
Type II Error: Accept a false Ho
The Probability of a Type II error is denoted by β.
1 ‐ β is called the power of the test.
α and β are conditional probabilities:
= P(Reject H H is true)α 0 0
0 0
= P(Reject H H is true)
= P(Accept H H is false)
α
β
QM-220, M. Zainal
Hypothesis tests: An introduction11
In the soft‐drinks example, a Type I error will occur when Hois actually true (that is the cans do contain on average 12
11
is actually true (that is, the cans do contain, on average, 12ounces of soda), but it just happens that we draw a samplewith a mean that is much less than 12 ounces and wewith a mean that is much less than 12 ounces and wewrongfully reject the null hypothesis.
In other words α is the probability of rejecting the nullIn other words, α is the probability of rejecting the nullhypothesis, Ho when in fact it is true.
h f h bl fThe size of the rejection region in a statistics problem of a testof hypothesis depends on the value assigned to α.
In one approach to a test of hypothesis, we assign a value to αbefore making the test.
QM-220, M. Zainal
Hypothesis tests: An introduction12
Any value can be assigned to α, the commonly used values are01 025 05 and 10 Usually does not exceed 10
12
.01, .025, .05, and .10. Usually does not exceed .10.
In the court trial case, if the person is declared not guilty at thee d of the t ial It doe ot i di ate that the e o ha i deedend of the trial. It does not indicate that the person has indeednot committed the crime.
It is possible that the person is guilty but there is no enoughevidence to prove the guilt. In this situation there are again
b ltwo possibilities.The person has not committed the crime and is declared notguilty (correct)guilty (correct).The person has committed the crime but, because of the lack ofenough evidence, is declared not guilty (type II error)
QM-220, M. Zainal
g g y ( yp )
Hypothesis tests: An introduction13
A Type II error will occur when the null hypothesis Ho isactually false (that is, the soda contained in all cans, on
13
actually false (that is, the soda contained in all cans, onaverage, is less than 12 ounces), but it happens by chance thatwe draw a sample with a mean that is close to or greater thanp g12 ounces.
If we wrongfully conclude do not reject Ho The value of βIf we wrongfully conclude do not reject Ho. The value of βrepresents the probability of making a Type II error. Itrepresents the probability that Ho is not rejected whenrepresents the probability that Ho is not rejected whenactually Ho false.
The value 1 β is called the power of the test and it representsThe value 1‐β is called the power of the test and it representsthe probability of not making a type II error.
QM-220, M. Zainal
Hypothesis tests: An introduction14
A contingency table illustrates the possible outcomes of astatistical hypothesis test.
14
statistical hypothesis test.
Actual Situation
H0 True H0 FalseConclusion
CorrectD i i
Type II Error or βAccept H0 Decision β errorp 0
CorrectDecision
Type I Error orα errorReject H0
QM-220, M. Zainal
Hypothesis tests: An introduction15
Always remember that there are two possible states of nature:
H i t
15
Ho is true
Ho is false
There are two possible decisions:
Fail to reject Ho as truej
Reject Ho as false
α and β depend on each other lowering anyone one of themα and β depend on each other, lowering anyone one of them will raise the other one.
D h f b h d bDecreasing the two types of error can be achieved by increasing the sample size.
QM-220, M. Zainal
Hypothesis tests: An introduction16
Tails of a testThe tails of a statistical test are determined by the need for an
16
The tails of a statistical test are determined by the need for anaction. If action is to be taken if a parameter is greater thansome value a, then the alternative hypothesis is that the, ypparameter is greater than a, and the test is a right‐tailed test.
Ho: μ ≤ (or =) 50Ho: μ ≤ (or =) 50
H1: μ > 50
QM-220, M. Zainal
Hypothesis tests: An introduction17
If action is to be taken if a parameter is less than some value a,then the alternative hypothesis is that the parameter is less than
17
then the alternative hypothesis is that the parameter is less thana, and the test is a left‐tailed test
Ho: μ ≥ (or ) 12Ho: μ ≥ (or =) 12
H1: μ < 12
QM-220, M. Zainal
Hypothesis tests: An introduction18
If action is to be taken if a parameter is either greater than orless than some value a, then the alternative hypothesis is that the
18
less than some value a, then the alternative hypothesis is that theparameter is not equal to a, and the test is a two‐tailed test.
Ho: μ 50Ho: μ =50
H1: μ ≠ 50
QM-220, M. Zainal
Hypothesis tests: An introduction19
Left Tailed Right Tailed Two Tailed
19
Left-TailedTest
Right-TailedTest
Two-TailedTest
Sign in the null ≥ ≤ghypothesis Ho = or ≥ = or ≤ =
Sign in the alternative h h i < > ≠hypothesis H1 ≠
Critical region In the left tail In the right tail In both tails
The null hypothesis always has an equal sign (=) or greaterthan or equal (≥) or less than or equal sign (≤)
QM-220, M. Zainal
Hypothesis tests: An introduction20
How to make test of hypothesis?
W ill h f ll i d k h f
20
We will use the following two procedures to make the test ofhypothesis.
The p‐value approach: We calculate the p‐value for theobserved value of sample statistic then we compare it to the
d t i d i ifi l lpredetermined significance level.
Using the predetermined significance level α
QM-220, M. Zainal
Hypothesis tests: An introduction21
Example: Explain which of the following is a two‐tailed, aleft‐tailed, and a right tailed test.
21
left tailed, and a right tailed test.
a. Ho : μ = 45, H1: μ > 45
b. Ho : μ = 23, H1: μ ≠ 23
c. Ho : μ = 75, H1: μ < 75
d. Ho : μ ≤ 45, H1: μ > 45
e. Ho : μ ≥ 10, H1: μ < 10
QM-220, M. Zainal
Hypothesis tests: An introduction22
Example: Consider Ho : μ = 23, H1: μ ≠ 23
What type of error would you make if the null hypothesis is
22
What type of error would you make if the null hypothesis isactually false and you fail to reject it?
What type of error would you make if the null hypothesis isWhat type of error would you make if the null hypothesis isactually true and you reject it?
QM-220, M. Zainal
Hypothesis tests: An introduction23
Example: Write the null and alternative hypotheses for each ofthe following examples. Determine if each is a case of a two‐
23
the following examples. Determine if each is a case of a twotailed, a left‐tailed, or a right‐tailed test.
a To test if the mean number of hours spent working per week bya. To test if the mean number of hours spent working per week bycollege students who hold jobs is different from 20 hours.
b To test whether or not a bankʹs ATM is out of service for anb. To test whether or not a bank s ATM is out of service for anaverage of more than 10 hours per month.
c To test if the mean length of experience of airport securityc. To test if the mean length of experience of airport securityguards is different from three years
d To test if the mean credit card debt of college seniors is less thand. To test if the mean credit card debt of college seniors is less than$1000.
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach24
The rejection region of a statistical hypothesis test is the rangeof numbers that will lead us to reject the null hypothesis in
24
of numbers that will lead us to reject the null hypothesis incase the test statistic falls within this range.
The rejection region also called the critical region is definedThe rejection region, also called the critical region, is definedby the critical points.
The rejection region is defined so that, before the samplingtakes place, our test statistic will have a probability α of fallingithi th j ti i if th ll h th i i twithin the rejection region if the null hypothesis is true.
In this procedure, we find a value such that a given nullhypothesis is rejected for any α greater than this value and it isnot rejected for any α less than this value.
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach25
The p‐value is the smallest level of significance at which thegiven null hypothesis is rejected.
25
given null hypothesis is rejected.
Using this p‐value, we state the decision. If we have apredetermined value of α then we compare the value of ppredetermined value of α, then we compare the value of pwith α and make a decision.
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach26
In the p‐value approach, we reject the null hypothesis Ho if
p value < α
26
p-value < α
and we do not reject the null hypothesis if
l ≥p-value ≥ α
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach27
To find the area under the standard normal curve beyond thesample mean, first we calculating the z value for x
27
sample mean, first we calculating the z value for x
if is knownxz μ σ−=
if is unknown
x
xz
σμ σ− if is unknown
x
zs
σ=
The value of z calculated for the sample mean using theformula is also called observed value of z
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach28
Then, we find the area under the tail of the normal distributioncurve beyond this of z.
28
curve beyond this of z.
This area gives the p‐value or one‐half of the p‐valuedepending on whether it is one tailed test or a two tailed testdepending on whether it is one‐tailed test or a two‐tailed test.
A test of hypothesis procedure that uses the p‐value approachinvolves the following four steps.
State the null and alternative hypothesis.
Select the distribution to use.
Calculate the p‐value.p
Make a decision
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach29
Example: The management of Priority Health Club claims thatits members lose an average of 10 pounds or more within the
29
its members lose an average of 10 pounds or more within thefirst month after joining the club. A consumer agency that wantsto check this claim took a random sample of 36 members of thisphealth club and found that they lost an average of 9.2 poundswithin the first month of membership with a standard deviationof 2.4 pounds.
Find the p‐value for this test.p
What will your decision be if α = .01? What if α = .05?
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach30
Example: At Canon Food Corporation, it took an average of 50minutes for new workers to learn a food processing job. The
30
minutes for new workers to learn a food processing job. Thesupervisor at the company wants to find if the mean time takenby new workers to learn the food processing procedure on thisy p g pnew machine is different from 50 minutes. A sample of 40workers showed that it took, on average, 47 minutes for them tolearn the food processing procedure on a new machine with astandard deviation of 7 minutes.
Find the p‐value for the test that the mean learning time for thefood processing procedure on the new machine is different from50 minutes.
What will your conclusion be if α = .01 ?
QM-220, M. Zainal
Hypothesis tests about µ for using the p-value approach31
Example: Consider Ho: μ = 72 versus HI: μ > 72. A randomsample of 36 observations taken from this population produced
31
sample of 36 observations taken from this population produceda sample mean of 74.07 and a standard deviation of 6.
a Calculate the p valuea. Calculate the p‐value.
b. Considering the p‐value of part a, would you reject the null hypothesis if the test were made at the significance level of 01?hypothesis if the test were made at the significance level of .01?
c. Considering the p‐value of part a, would you reject the null hypothesis if the test were made at the significance level of 025?hypothesis if the test were made at the significance level of .025?
QM-220, M. Zainal
Hypothesis tests about µ for large samples32
Instead of using the p‐value approach, we will use what is called the test statistic.
32
We calculate the test statistic in the following way:
x xμ μ− −
To Perform a test of hypothesis with predetermined αx x
x xz ors
μ μσ
= =
o e o a e o ypo e i i p e e e i eState the null and alternative hypotheses.Select the distribution to use.Select the distribution to use.Determine the rejection and nonrejection regions.Calculate the value of the test statistic.
Make a decision (reject Ho if |z| > z α).
QM-220, M. Zainal
Hypothesis tests about µ for large samples33
Example: The TIV Telephone Company provides long‐distancetelephone service in an area. According to the companyʹs
33
records, the average length of all long‐distance calls placedthrough this company in 1999 was 12.44 minutes. Thecompanyʹs management wanted to check if the mean length ofcompany s management wanted to check if the mean length ofthe current long‐distance calls is different from 12.44 minutes. Asample of 150 such calls placed through this company produceda mean length of 13.71 minutes with a standard deviation of 2.65minutes. Using the 5% significance level, can you conclude thatthe mean length of all current long‐distance calls is differentthe mean length of all current long distance calls is differentfrom 12.44 minutes?
QM-220, M. Zainal
Hypothesis tests about µ for large samples34
Example: The mayor of a large city claims that the average networth of families living in this city is at least $300,00. A random
34
sample of 100 families is selected from this city produced amean net worth of $288,000 with a standard deviation of$80 000 Using the 2 5% significance level can you conclude that$80,000. Using the 2.5% significance level, can you conclude thatthe mayor’s claim is false?
QM-220, M. Zainal
Hypothesis tests about µ for small samples35
As in the confidence intervals, we may face the very same situations in which the sample is small (n < 30)
35
situations in which the sample is small (n < 30)
If we are dealing with small sample sizes, we will have twoscenarios:scenarios:
1‐The original population is normal and σ is known.
2 Th i i l l i i ( i l ) l d i2‐The original population is (approximately) normal and σ isunknown.
I h fi i h l di ib iIn the first scenario, we use the normal distribution to test μ.
In the second scenario, we can’t use the normal distribution totest μ. Instead, we will use the t‐distribution.
QM-220, M. Zainal
Hypothesis tests about µ for small samples36
Conditions under which the t‐distribution is used to make tests of hypothesis about μ.
36
yp μ1‐ The population from which the sample is drawn is
(approximately) normally distributed
2‐ The sample size is small (that is, n < 30)
3‐ The population standard deviation, σ , is unknown
The value of the test statistic t for the sample mean is:
xx
x st where ss nμ−
= =
The value of t calculated for sample mean is called the observed value of t.
QM-220, M. Zainal
Hypothesis tests about µ for small samples37
Example: Canon Inc. has introduced a copying machine thatfeatures two‐color copying capability in a compact system
37
py g p y p ycopier. The average speed of the standard compact systemcopier is 27 copies per minute. Suppose the company wants totest whether the new copier has the same average speed as itsstandard compact copier. Conduct a test at an α = 0.05 level ofsignificancesignificance.
Ho: μ = 27
H1 27H1: μ ≠ 27
n = 24
QM-220, M. Zainal
Hypothesis tests about µ for small samples38
For α = 0.05 and df = 24 - 1 = 23, the critical values of t are ± 2.069The test statistic is:
38
The test stat st c s: Do not reject Ho if: [-2.069 ≤ t ≤ 2.069]
The t Distribution
0.8
0.7
0.6
0.5
.95 7.4s =0.5
0.4
0.3
0.2
0.1
.025 .025
24.6-277.4= x ot s
μ−=
Lower Rejection Upper Rejection
0.0
Nonrejection
t0 2.069-2.069
−1.59
-2 4 1 59 D t j t H
24n
Lower Rejection Region
Upper Rejection Region
Nonrejection Region
2.41.51
= 1.59 Do not reject Ho=− ⇒
QM-220, M. Zainal
Hypothesis tests about µ for small samples39
Example: A pediatricians claim that the mean age at whichchildren start walking is 12.5. I wanted to check if this claim is
39
gtrue so I took a random sample of 18 and found that the meanage at which these children started walking was 12.9 with astandard deviation of .80 month. Using the 1% significancelevel, can you help me concluding that the mean age at which allchildren start walking is different from 12 5 months? Assumechildren start walking is different from 12.5 months? Assumethat the ages at which all children start walking have anapproximately normal distribution.pp y
QM-220, M. Zainal
Hypothesis tests about µ for small samples40
Example: Grand Auto Corporation produces auto batteries. Thecompany claims that its top‐of‐the line Never Die batteries are
40
p y pgood, on average, for at least 65 months. A consumer protectionagency tested 15 such batteries to check this claim. It found themean life of these batteries to be 63 months with a standarddeviation of 2 months. At the 5% significance level can youconclude that the claim of the company is true? Assume that theconclude that the claim of the company is true? Assume that thelife of sue battery has an approximately normal distribution.
QM-220, M. Zainal
Hypothesis tests about µ for small samples4141
QM-220, M. Zainal
Hypothesis tests about population proportion42
Often we want to conduct a test of hypothesis about apopulation proportion
42
population proportion.
The procedure here includes all the steps we carried for thelsample mean.
As we learned in chapter 7, the sample proportion isapproximately normal for large n.
p̂ p pq−ˆ
ˆp
p
p p pqz wheren
σσ−
= =
The value of z calculated for sample proportion is called theobserved value of z.
QM-220, M. Zainal
Hypothesis tests about population proportion43
Example: In a poll by the National Center for Women and Aging
t B d i U i it 51 % f th 50 id th t
43
at Brandeis University, 51 % of the women over 50 said that
aging is not as bad as they had expected. Assume that this result
holds true for the 2002 population of all women aged 50 and
over. In a recent random sample of 400 women aged 50 and
over, 54% said that aging is not as bad as they had expected.
Using the 1 % significance level, can you conclude that the
current percentage of women aged 50 and over who think that
aging is not as bad as they had expected is different from thatagi g is ot as bad as t ey ad e pected is di e e t o t at
for 2002?
QM-220, M. Zainal
Hypothesis tests about population proportion44
Example: When working properly, a machine that is used to
k hi f l l t d t d th 4%
44
make chips for calculators does not produce more than 4%
defective chips. Whenever the machine produces more than 4%
defective chips, it needs an adjustment. To check if the machine
is working properly, the quality control department at the
company often takes samples of chips and inspects them to
determine if they are good or defective. One such random
sample of 200 chips taken recently from the production line
contained 14 defective chips. Test at the 5% significance levelco tai ed de ecti e c ips est at t e 5% sig i ica ce e e
whether or not the machine needs an adjustment.
QM-220, M. Zainal
Hypothesis tests about population proportion45
Example: Direct Mailing Company sells computers and
t t b il Th l i th t t l t 90% f
45
computer parts by mail. The company claims that at least 90% of
all orders are mailed within 72 hours after they are received.
The quality control department at the company often takes
samples to check if this claim is valid. A recently taken sample
of 150 orders showed that 129 of them were mailed within 72
hours. Do you think the companyʹs claim is true? Use a 2.5%
significance level.
QM-220, M. Zainal
Hypothesis tests about population proportion46
Hypothesis tests: a rule of thumb
When the p‐value is smaller than 0 01 the result is called very
46
When the p‐value is smaller than 0.01, the result is called verysignificant.
When the p‐value is between 0.01 and 0.05, the result is called
significant.
When the p‐value is between 0.05 and 0.10, the result is
id d b i ll i ifi t ( d b t tconsidered by some as marginally significant (and by most as not
significant).
When the p‐value is greater than 0.10, the result is considered
not significant.
QM-220, M. Zainal
o ig ifi a