Você está na página 1de 46

Hypothesis Testing For The

Mean of a Population
What is a Hypothesis?
 A hypothesis is a claim
(assumption) about a
population parameter:

 population mean
Example: The mean monthly cell phone bill
of this city is μ = $42
 population proportion
Example: The proportion of adults in this
city with cell phones is p = .68
The Null Hypothesis, H0

 The hypothesis we wish to test


 Example: The average number of TV sets in
U.S. Homes is equal to three ( H0 : μ  3 )
 Is always about a population parameter,
not about a sample statistic

H0 : μ  3 H0 : X  3
The Null Hypothesis, H0
(continued)
 Begin with the assumption that the null
hypothesis is true
 Similar to the notion of innocent until
proven guilty
 Refers to the status quo
 Always contains “=” , “≤” or “” sign
 Conclusion: Reject or fail to reject Ho
 Acceptance of a hypothesis just means that there is
not enough evidence to refute it.
 Rejection implies that the evidence truly does refute
it.
The Alternative Hypothesis, H1
 To prove a hypothesis in statistics, we generally
set up the opposite of the hypothesis and see if we
can reject it
 e.g.: The average number of TV sets in U.S. homes is not
equal to 3 ( H1: μ ≠ 3 )
 Challenges the status quo
 Never contains the “=” , “≤” or “” sign
 May or may not be accepted
 Is generally the hypothesis that is believed (or
needs to be supported) by the researcher
Level of Significance, 

 Defines the unlikely values of the sample statistic if


the null hypothesis is true
 Defines rejection region of the sampling distribution
 Is designated by  , (level of significance)
 Typical values are .01, .05, or .10
 Is selected by the researcher at the beginning
 Provides the critical value(s) of the test
 The critical region is the range of the sample statistic for which
we reject the null hypothesis.
 The range for which we accept is called the acceptance region.
Level of Significance
and the Rejection Region
Level of significance =  Represents
critical value
H0: μ = 3 /2 /2
H1: μ ≠ 3 Rejection
Two tailed test 0 region is
shaded
H0: μ ≤ 3 
H1: μ > 3
Upper tail test 0

H0: μ ≥ 3

H1: μ < 3
Lower tail test 0
Errors in Making Decisions

 Type I Error
 Reject null hypothesis when it is true
 Considered a serious type of error

 = P (type I Error)
 Called level of significance of the test
 Set by researcher in advance
Errors in Making Decisions
(continued)

 Type II Error
 Accepting the null hypothesis when it
false
β = P (type II Error)
 In hypothesis testing, we generally want to
minimize , the probability of making a type I
error.
 The value of  can be reduced by adjusting the
critical region.
 Decreasing  generally causes  to increase and
vice versa.
 Increasing the sample size n will decrease both 
and .
Outcomes and Probabilities

Possible Hypothesis Test Outcomes

Actual Situation
Decision H0 True H0 False

No error Type II Error


Accept
Key: (1 -  ) (β)
Outcome H0
(Probability) Reject Type I Error No Error
H0 () (1-β)
How to choose between Type I
and Type II errors
 Choice depends on the cost of the error
 Choose little type I error when the cost of rejecting the
maintained hypothesis is high
 A criminal trial: convicting an innocent person

 The Exxon Valdise: Causing an oil tanker to sink

 Choose large type I error when you have an interest 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.
5 Steps Hypothesis Testing
Procedure
1. State the appropriate hypotheses
2. Determine the appropriate test statistic to use;
Collect data and compute the test statistic from
the sample result
3. Find the critical values and determine the
rejection region(s)
4.Compare the test statistic to the critical value to
determine whether to reject or fail to reject Ho
5. Reach appropriate conclusions and state in
plain English
Hypothesis Tests for the Mean

Hypothesis
Tests for 

 Known  Unknown
Z Test of Hypothesis for the
Mean (σ Known)
 Convert sample statistic ( X ) to a Z test statistic
Hypothesis
Tests for 

σ Known σ Unknown

The test statistic is:

X μ
Z 
σ
n
Critical Value
Approach to Testing
 For two tailed test for the mean, σ known:
 Convert sample statistic ( X ) to test statistic (Z
statistic )
 Determine the critical Z values for a specified
level of significance  from a table or
computer
 Decision Rule: If the test statistic falls in the
rejection region, reject H0 ; otherwise do not
reject H0
Two Tailed Tests
H0: μ = 3
 There are two
H1: μ  3
cutoff values
(critical values),
defining the
regions of /2 /2
rejection
3 X
Reject H0 Do not reject H0 Reject H0

-Z 0 +Z Z

Lower Upper
critical critical
value value
Example
Test the claim that the true mean # of TV
sets in US homes is equal to 3.
(Assume σ = 0.8)
1. State the appropriate null and alternative
hypotheses
 H0: μ = 3 H1: μ ≠ 3 (This is a two tailed test)
2. Collect the data and compute the test statistic
 Suppose the sample results are
n = 100, Xbar = 2.84 (σ = 0.8 is assumed
known)
So the test statistic is:
Example
(continued)

X μ 2.84  3  .16
Z     2.0
σ 0.8 .08
n 100

3. Set up the critical values


 For  = .05 the critical Z values are ±1.96
Is the test statistic in the rejection region?
Example
(continued)

4. Is the test statistic in the rejection region?

 = .05/2  = .05/2

Reject H0 Do not reject H0 Reject H0


Reject H0 if
Z < -1.96 or -Z= -1.96 0 +Z= +1.96
Z > 1.96;
otherwise
do not Here, Z = -2.0 < -1.96, so the
reject H0 test statistic is in the rejection
region
Example
(continued)
5. Reach a decision and state it in plain English

 = .05/2  = .05/2

Reject H0 Do not reject H0 Reject H0

-Z= -1.96 0 +Z= +1.96


-2.0
Since Z = -2.0 < -1.96, we reject the null hypothesis
and conclude that there is sufficient evidence that the
mean number of TVs in US homes is not equal to 3
p-Value Approach to Testing

 p-value: Probability of obtaining a test


statistic more extreme ( ≤ or  ) than the
observed sample value given H0 is true
 Also called observed level of significance

 Smallest value of  for which H0 can be


rejected
p-Value Approach to Testing
(continued)

 Convert Sample Statistic (e.g. X ) to Test


Statistic (e.g. Z statistic )
 Obtain the p-value from a table or computer
 Compare the p-value with 
 If p-value <  , reject H0
 If p-value   , do not reject H0
Finding P-value
 For Ha:  < o, p-value = P(Z < zo)

 For Ha:  > o, p-value = P(Z > zo)

 For Ha:   o, p-value = 2 * P(Z > |zo|)

 Use standard normal table to calculate p-value


p-Value Example
 Example: How likely is it to see a sample mean of
2.84 (or something further from the mean, in either
direction) if the true mean is  = 3.0?

X = 2.84 is translated
to a Z score of Z = -2.0
/2 = .025 /2 = .025
P(Z  2.0)  .0228
.0228 .0228
P(Z  2.0)  .0228
p-value
=.0228 + .0228 = .0456
-1.96 0 1.96 Z
-2.0 2.0
p-Value Example
(continued)
 Compare the p-value with 
 If p-value <  , reject H0
 If p-value   , do not reject H0

Here: p-value = .0456 /2 = .025 /2 = .025


 = .05
.0228 .0228
Since .0456 < .05, we
reject the null
hypothesis
-1.96 0 1.96 Z
-2.0 2.0
Connection to Confidence Intervals

 A two-sided hypothesis test with a significant


level of  is equivalent to constructing a (1 -
)·100% Confidence Interval
 Check whether the interval contains the nominal
value of the parameter
 Hypothesis test and confidence interval support
one another
Example

For X = 2.84, σ = 0.8 and n = 100, the 95%


confidence interval is:
0.8 0.8
2.84 - (1.96) to 2.84  (1.96)
100 100

2.6832 ≤ μ ≤ 2.9968

 Since this interval does not contain the hypothesized


mean (3.0), we reject the null hypothesis at  = .05
One Tail Tests

 In many cases, the alternative hypothesis


focuses on a particular direction

This is a lower tail test since the


H0: μ ≥ 3
alternative hypothesis is focused on
H1: μ < 3 the lower tail below the mean of 3

H0: μ ≤ 3 This is an upper tail test since the


alternative hypothesis is focused on
H1: μ > 3
the upper tail above the mean of 3
Lower Tail Tests
H0: μ ≥ 3
 There is only one H1: μ < 3
critical value, since
the rejection area is
in only one tail 

Reject H0 Do not reject H0


-Z Z
0

μ X

Critical value
Upper Tail Tests

H0: μ ≤ 3
 There is only one
critical value, since H1: μ > 3
the rejection area is
in only one tail 

Do not reject H0 Reject H0


Z Zα
0

X μ

Critical value
Example: Upper Tail Z Test
for Mean ( Known)
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 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)
Example: Test Statistic
(continued)

Obtain sample evidence and compute the test


statistic
Suppose a sample is taken with the following
results: n = 64, X = 53.1 (=10 was assumed known)
 Then the test statistic is:

Xμ 53.1  52
Z    0.88
σ 10
n 64
Example: Find Rejection Region
(continued)
 Suppose that  = .10 is chosen for this test

Find the rejection region: Reject H0

 = .10

Do not reject H0 Reject H0


0 1.28

Reject H0 if Z > 1.28


Review:
Finding Critical Value - One Tail

Standard Normal
What is Z given  = 0.10? Distribution Table (Portion)
.90 .10
Z .07 .08 .09
 = .10
1.1 .8790 .8810 .8830
.90
1.2 .8980 .8997 .9015
z 0 1.28
1.3 .9147 .9162 .9177
Critical Value
= 1.28
Example: Decision and Conclusion
(continued)
Reach a decision and interpret the result:
Reject H0

 = .10

Do not reject H0 Reject H0


1.28
0
Z = .88
Fail to reject H0 since Z = 0.88 ≤ 1.28
i.e.: there is no sufficient evidence that the
mean bill is over $52
p -Value Solution
(continued)

Calculate the p-value and compare to 


p-value = .1894

Reject H0 P( X  53.1 | μ  52.0)


 = .10
 53.1  52.0 
 P Z  
0  10/ 64 
Do not reject H0 Reject H0
1.28  P(Z  0.88)  1  .8106
Z = .88
 .1894
Fail to reject H0 since p-value = .1894 >  = .10
t Test of Hypothesis for the Mean
(σ UnKnown)
 Convert sample statistic ( X ) to a t test statistic
Hypothesis
Tests for 

σ Known σ Unknown

The test statistic is:

X μ
t n-1 
S
n
 From the five steps of hypothesis testing, when
dealing with hypothesis test with unknown σ,
which most of the time occurs, the main
different is calculating the test statistics and
determining the critical region
 We have to compute s for calculating t statistics
 We use tdf, for one sided test and tdf,/2 for two sided
test where df = n-1
Example: One sided t test
Nickel-hydrogen (Ni-H) batteries use a nickel plate as the
anode. A critical quality characteristic is the plate’s porosity
which control the interface of the anode with the potassium
hydroxide electrolyte solution. For this particular battery
cell, the manufacturer has set a target porosity of 80% as
measured by a standard test. The porosity is essentially
controlled by sintering process at high temperature. The
production people have expressed concerns that the plate
is being overfired and thus is not sufficiently porous
Data have been collected as follows: 79.1 79.5 79.3 79.3
78.8 79.0 79.2 79.7 79.0 79.2
Solution
1. Stating hypotheses:
Ho:  ≥ 80
Ha:  < 80

2. Conduct experiment ~ calculate t statistics:

X μ
t n -1 
s
n
n
1 792.1
x
n

i 1
xi 
10
 79.21

n i 1 yi2  (i 1 yi ) 2
n n

s2   0.06767
n ( n  1)

s  0.26

test statistic t   9.60


3. Critical Region
tdf, = t9,0.05 = - 1.833

4. Conclusion:
t statistics = -9.60 is less than t critical region, we may
reject Ho

5. Conclusion in English:
We have enough evidence to suggest that the true
mean porosity is less than 80% which supports the
contention that the sintering process is overfiring the
plate
Checking the Confidence
Interval
 The confidence interval is:
s
x  t df , / 2  79.21  2.262 * 0.0822
n
 [79.02, 79.40]

 This result support hypothesis test


P-value

 P (T < -9.60) = 0

 In this example we pick  = 0.05


 Since P-value is less than , we reject Ho
Other Tests
 Proportion
 Two independent samples
 Paired t-test
 Variances
 2 test

Você também pode gostar