of 48
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
1/48
Basic Business Statistics(8th Edition)
Chapter 9
Fundamentals of HypothesisTesting: One-Sample Tests
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
2/48
Chapter Topics
Hypothesis testing methodology
Z test for the mean ( known)
P-value approach to hypothesis testing Connection to confidence interval estimation
One-tail tests
T test for the mean ( unknown)
Z test for the proportion
Potential hypothesis-testing pitfalls and ethicalconsiderations
W
W
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
3/48
What is a Hypothesis?
A hypothesis is aclaim (assumption)
about the populationparameter
Examples of parametersare population mean
or proportion The parameter must
be identified beforeanalysis
I claim the mean GPA of
this class is 3.5!
1984-1994 T/Maker Co.
Q !
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
4/48
The Null Hypothesis, H0
States the assumption (numerical) to betested
e.g.: The average number of TV sets in U.S.Homes is at least three ( )
Is always about a population parameter( ), not about a sample
statistic ( )
0: 3H Q u
0 : 3H Q u
0 : 3H X u
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
5/48
The Null Hypothesis, H0
Begins with the assumption that the nullhypothesis is true
Similar to the notion of innocent untilproven guilty
Refers to the status quo
Always contains the = sign
May or may not be rejected
(continued)
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
6/48
The Alternative Hypothesis, H1
Is the opposite of the null hypothesis
e.g.: The average number of TV sets in U.S.homes is less than 3 ( )
Challenges the status quo
Never contains the = sign
May or may not be accepted
Is generally the hypothesis that isbelieved (or needed to be proven) to betrue by the researcher
1: 3H Q
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
7/48
Hypothesis Testing Process
Identify the Population
Assume thepopulation
mean age is 50.
( )
REJECT
Take a Sample
Null Hypothesis
No, not likely!
X 20 likely ifIs ?Q! !
0: 50H Q !
20X !
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
8/48
Sampling Distribution of
= 50
It is unlikely that
we would get asample mean ofthis value ...
... Therefore,
we reject thenull hypothesisthat m = 50.
Reason for Rejecting H0
Q20
If H0 is true
X
... if in fact this werethe population mean.
X
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
9/48
Level of Significance,
Defines unlikely values of sample statistic ifnull hypothesis is true
Called rejection region of the sampling distribution Is designated by , (level of significance)
Typical values are .01, .05, .10
Is selected by the researcher at the beginning
Provides the critical value(s) of the test
E
E
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
10/48
Level of Significanceand the Rejection Region
H0: Q u3
H1:Q < 3
0
0
0
H0:Q e 3
H1:Q > 3
H0:Q !3
H1:Q { 3
E
E
E/2
Critical
Value(s)
RejectionRegions
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
11/48
Errors in Making Decisions
Type I Error Rejects a true null hypothesis
Has serious consequences
The probability of Type I Error is Called level of significance
Set by researcher
Type II Error Fails to reject a false null hypothesis
The probability of Type II Error is
The power of the test is
E
1 FF
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
12/48
Errors in Making Decisions
Probability of not making Type I Error
Called the confidence coefficient
1 E
(continued)
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
13/48
Result ProbabilitiesH0: Innocent
The Truth The Truth
Verdict Innocent Guilty Decision H0 True H0 False
Innocent Correct ErrorDo Not
Reject
H0
1 - EType II
Error (F )
Guilty Error CorrectReject
H0
Type IError(E )
Power
(1 - F )
Jury Trial Hypothesis Test
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
14/48
Type I & II Errors Have anInverse Relationship
E
F
If you reduce the probability of one
error, the other one increases so that
everything else is unchanged.
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
15/48
Factors Affecting Type II Error
True value of population parameter Increases when the difference between
hypothesized parameter and its true valuedecrease
Significance level Increases when decreases
Population standard deviation Increases when increases
Sample size Increases when n decreases
F
F
E
F W
F
E
F
n
F
F W
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
16/48
How to Choose betweenType I and Type II Errors
Choice depends on the cost of the errors
Choose smaller Type I Error when the cost ofrejecting the maintained hypothesis is high A criminal trial: convicting an innocent person
The Exxon Valdez: causing an oil tanker to sink
Choose larger Type I Error when you have aninterest in changing the status quo A decision in a startup company about a new piece
of software
A decision about unequal pay for a covered group
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
17/48
Critical ValuesApproach to Testing
Convert sample statistic (e.g.: ) to teststatistic (e.g.: Z, t or F statistic)
Obtain critical value(s) for a specifiedfrom a table or computer
If the test statistic falls in the critical region,reject H0
Otherwise do not reject H0
X
E
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
18/48
p-Value Approach to Testing
Convert Sample Statistic (e.g. ) to TestStatistic (e.g. Z, t or F statistic)
Obtain the p-value from a table or computer
p-value: Probability of obtaining a test statisticmore extreme ( or ) than the observedsample value given H0 is true
Called observed level of significance
Smallest value of that an H0 can be rejected
Compare the p-value with
If p-value , do not reject H0
If p-value , reject H0
X
e u
e
u EE
E
E
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
19/48
General Steps inHypothesis Testing
e.g.: Test the assumption that the true mean number of ofTV sets in U.S. homes is at least three ( Known)W
1. State the H0
2. State the H1
3. Choose4. Choose n
5. Choose Test
0
1
: 3
: 3
=.05
100
Z
H
H
n
test
Q
Q
E
u
!E
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
20/48
100 households surveyed
Computed test stat =-2,
p-value = .0228
Reject null hypothesis
The true mean number of TV
sets is less than 3
(continued)RejectH0
E
-1.645 Z
6. Set up critical value(s)
7. Collect data
8. Compute test statistic
and p-value9. Make statistical decision
10. Express conclusion
General Steps inHypothesis Testing
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
21/48
One-tail Z Test for Mean( Known)
Assumptions
Population is normally distributed
If not normal, requires large samples Null hypothesis has or sign only
Z test statistic
W
e u
/
X
X
X XZn
Q QW W ! !
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
22/48
Rejection Region
Z0
RejectH0
Z0
RejectH0
H0: QuQ
0
H1: Q < Q0
H0: QeQ
0
H1: Q > Q0
Z Must Be SignificantlyBelow 0 to reject H0
Small values of Z dontcontradict H0
Dont Reject H0!
EE
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
23/48
Example: One Tail Test
Q. Does an average box of
cereal contain more than
368 grams of ce
real? A
random sample of 25
boxes showed = 372.5.
The company has
specified W to be1
5 grams.
Test at the E!0.05 level.
368 gm.
H0: Qe368
H1: Q> 368
X
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
24/48
Finding Critical Value: One Tail
Z .04 .06
1.6 .9495 .9505 .9515
1.7 .9591 .9599 .960
8
1.8 .9671 .9678 .9686
.9738 .9750
Z0 1.645
.05
1.9 .9744
Standardized CumulativeNormal Distribution Table
(Portion)What is Z given E = 0.05?
E = .05
Critical Value
= 1.645
.95
1ZW !
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
25/48
Example Solution: One Tail Test
E = 0.5
n= 25
Critical Value:1.645
Test Statistic:
Decision:
Conclusion:Do Not Reject atE = .05
No evidence that true
mean is more than 368
Z0 1.645
.05
Reject
H0:Qe368
H1:Q > 368
1.50
X
Z
n
Q
W
! !
1.50
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
26/48
p -Value Solution
Z0 1.50
P-Value =.0668
ZValue of Sample
Statistic
FromZTable:
Lookup 1.50 to
Obtain .9332
Use the
alternative
hypothesis
to find the
direction of
the rejectionregion.
1.0000
- .9332
.0
668
p-Value isP(Zu1.50) = 0.0668
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
27/48
p -Value Solution(continued)
01.50
Z
Reject
(p-Value = 0.0668) u (E = 0.05)
Do Not Reject.
p Value = 0.0668
E = 0.05
Test Statistic 1.50 is in the Do Not Reject Region
1.645
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
28/48
One-tail Z Test for Mean( Known) in PHStat
PHStat | one-sample tests | Z test for themean, sigma known
Example in excel spreadsheet
W
Microsoft Excel
Worksheet
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
29/48
Example: Two-Tail Test
Q. Does an average box
of cereal contain 368
grams of ce
real? A
random sample of 25
boxes showed =
372.5. The company
has specified W to be15 grams. Test at the
E!0.05 level.
368 gm.
H0:Q !368
H1:Q { 368
X
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
30/48
372.5 3681.5015
25
X
Zn
Q
W
! ! !E = 0
.0
5n= 25
Critical Value: 1.96
Example Solution: Two-Tail Test
Test Statistic:
Decision:
Conclusion:Do Not Reject atE = .05
No Evidence that TrueMean is Not 368Z0 1.96
.025
Reject
-1.96
.025
H0:Q!368
H1:Q{ 368
1.50
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
31/48
p-Value Solution
(p Value = 0.1336) u (E = 0.05)
Do Not Reject.
01.50
Z
Reject
E = 0.05
1.96
p Value = 2 x 0.0668
Test Statistic 1.50 is in the Do Not Reject Region
Reject
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
32/48
PHStat | one-sample tests | Z test for themean, sigma known
Example in excel spreadsheet
Two-tail Z Test for Mean( Known) in PHStatW
Microsoft ExcelW
orksheet
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
33/48
For 372.5, 15 and 25,
the 95% confidence interval is:
372.5 1.96 15 / 25 372.5 1.96 15 / 25
or
366.62 378.38
If this interval contains the hypothesized mean (368),
we donot reject the null hypothesis.
I
X nW
Q
Q
! ! !
e e
e e
t does. Donot reject.
Connection toConfidence Intervals
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
34/48
t Test: Unknown
Assumption
Population is normally distributed
If not normal, requires a large sample T test statistic with n-1 degrees of freedom
W
/
Xt
S n
Q!
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
35/48
Example: One-Tail t Test
Does an average box of
cereal contain more than
368 grams of cereal? Arandom sample of 36
boxes showed X = 372.5,
and s! 15. Test at the E!
0.01 level.
368 gm.
H0:Qe 368
H1: Q" 368
W is not given
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
36/48
Example Solution: One-Tail
E = 0
.01
n= 36, df = 35
Critical Value: 2.4377
Test Statistic:
Decision:
Conclusion:
Do Not Reject at E = .01
No evidence that true
mean is more than 368t350 2.437
7
.01
Reject
H0:Qe368
H1:Q" 368
372.5 3681.80
1536
Xt
Sn
Q ! ! !
1.80
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
37/48
p -Value Solution
01.80
t35
Reject
(p Value is between .025 and .05) u (E = 0.01).
Do Not Reject.
p Value = [.025, .05]
E
=0.01
Test Statistic 1.80 is in the Do Not Reject Region
2.4377
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
38/48
PHStat | one-sample tests | t test for themean, sigma known
Example in excel spreadsheet
t Test: Unknown in PHStatW
Microsoft ExcelW
orksheet
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
39/48
Proportion
Involves categorical values
Two possible outcomes
Success (possesses a certain characteristic) andFailure (does not possesses a certaincharacteristic)
Fraction or proportion of population in the
success category is denoted by p
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
40/48
Proportion
Sample proportion in the success category isdenoted by pS
When both np and n(1-p) are at least 5, pS
can be approximated by a normal distributionwith mean and standard deviation
(continued)
Numberof SuccessesSample Size
s
Xpn
! !
sp pQ !
(1 )s
p
p p
nW
!
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
41/48
Example: Z Test for Proportion
Q. A marketing companyclaims that it receives
4% responses from itsmailing. To test thisclaim, a randomsample of 500 were
surveyed with 25responses. Test at theE = .05 significancelevel.
Check:
500 .04 20
5
1 500 1 .04
480 5
np
n p
! !
u
!
! u
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
42/48
.05 .041.14
1 .04 1 .04
500
Sp p
Zp p
n
$ ! !
Z Test for Proportion: Solution
E = .05
n = 500
Do not reject atE = .05
H0:p !.04
H1:p { .04
Critical Values:s 1.96
Test Statistic:
Decision:
Conclusion:
Z0
Reject Reject
.025.025
1.96-1.96
1.14
We do not have sufficientevidence to reject thecompanys claim of 4%
response rate.
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
43/48
p -Value Solution
(p Value = 0.2542) u (E = 0.05).
Do Not Reject.
01.14
Z
Reject
E = 0.05
1.96
p Value = 2 x .1271
Test Statistic 1.14 is in the Do Not Reject Region
Reject
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
44/48
Z Test for Proportion in PHStat
PHStat | one-sample tests | z test for theproportion
Example in excel spreadsheet
Microsoft Excel
Worksheet
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
45/48
Potential Pitfalls andEthical Considerations
Randomize data collection method to reduce
selection biases
Do not manipulate the treatment of human
subjects without informed consent
Do not employ data snooping to choose
between one-tail and two-tail test, or to
determine the level of significance
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
46/48
Potential Pitfallsand Ethical Considerations
Do not practice data cleansing to hide
observations that do not support a stated
hypothesis
Report all pertinent findings
(continued)
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
47/48
Chapter Summary
Addressed hypothesis testing methodology
Performed Z Test for the mean ( Known)
Discussed p Value approach to hypothesis
testing
Made connection to confidence interval
estimation
W
8/3/2019 Statistics-Fundamentals of Hypothesis Testing
48/48
Chapter Summary
Performed one-tail and two-tail tests
Performed t test for the mean ( unknown) Performed Z test for the proportion
Discussed potential pitfalls and ethical
considerations
(continued)
W