Lecture7 Hypothesis
Lecture7 Hypothesis
Hyelim Son
Review
The two main activities of inferential statistics are using
sample data to:
(1) estimate a population parameter
(2) Or test a hypothesis or claim about a population
parameter.
Confidence intervals allowed us to find ranges of
reasonable values for parameters we were interested in.
Hypothesis testing will let us make decisions about specific
values of parameters or relationships between parameters.
Chapter Objective
Develop the ability to conduct hypothesis tests for claims
made about
(1) a population proportion p
(2) a population mean
(3) a population standard deviation .
Main Objective
The main objective of this chapter is to develop the ability
to conduct hypothesis tests for claims made about a
population proportion p, a population mean , or a
population standard deviation .
Introduction
In hypothesis testing, we use sample data to choose
Key Concept
This section presents individual components of a
hypothesis test. We should know and understand the
following:
How to identify the null hypothesis and alternative hypothesis
from a given claim, and how to express both in symbolic form
How to calculate the value of the test statistic, given a claim
and sample data
How to choose the sampling distribution that is relevant
How to identify the P-value or identify the critical value(s)
How to state the conclusion about a claim in simple and
nontechnical terms
Definitions
hypothesis is a claim or statement about a population
A
characteristic.
Null Hypothesis
Alternative Hypothesis
Definitions
A Null hypothesis - the status quo - initially assumed true
An Alternative Hypothesis - the researchers proposal what you hope to show
The goal of a statistical test is to evaluate the viability of the
null hypothesis in the light of the data that we have
collected.
Depending on the data, the null hypothesis will either be
rejected or it wont be rejected (it is never accepted).
Steps 1, 2, 3
Identifying H0 and H1
Example
Assume that 100 babies are born to 100 couples treated
with the XSORT method of gender selection that is
claimed to make girls more likely.
We observe 58 girls in 100 babies. Write the
hypotheses to test the claim the with the XSORT
method, the proportion of girls is greater than the 50%
that occurs without any treatment.
H 0 : p 0.5
H1 : p 0.5
more than 50% of the vote and that the alternative hypothesis
is that candidate A will not win more than 50%.
Suppose we sampled 15 voters and recorded who voted for A.
What would you conclude if no one in the sample voted for
A (X = 0)?
If 50% of voters really did vote for A, it is highly improbable to
Step 4
Select the Significance Level
significance level
Significance Level
First, we need to identify significance level so that we
Step 5
Identify the Test Statistic and Determine
its Sampling Distribution
Test Statistic
The test statistic is a value used in making a decision
about the null hypothesis
It is found by converting the sample statistic to a
score with the assumption that the null hypothesis is
true.
Test Statistic
First choose the correct test statistic, and identify the
Rejection Region
The rejection region specifies the values of the
Example
We are interested in the population parameter .
If is a specific vale of we may wish to test
: =
: >
against
Example
Lets assume that our null has =0 such that
: =0
When null hypothesis is true, our distribution may look like
the following
Example
Lets assume that our null has =0 such that
: =0
: >
Suppose we set rejection region like this: {> k}, k=1.64
Example
Then depending on our location of test statistic
We either reject or not reject the null hypothesis
If {> 1,64} : reject the null hypothesis
if { 1.64} cannot reject the null hypothesis
Step 6
Find the Value of the Test Statistic, Then
Find Either the P-Value or the Critical
Value(s)
1. First transform the relevant sample statistic to a
standardized score called the test statistic.
2. Then find the P-Value or the critical value(s).
Example
Lets again consider the claim that the XSORT gender
selection method increases the likelihood of having a girl.
Preliminary results from a test of the XSORT method of
gender selection involved 100 couples who gave birth to 58
girls and 42 boys.
Use the given claim and the preliminary results to calculate
the value of the test statistic.
Use z test statistic, so that a normal distribution is used to
approximate a binomial distribution.
Example - Continued
H 0 : p 0.5
H1 : p 0.5
We work under the assumption that the null hypothesis is
true with p = 0.5.
The sample proportion of 58 girls in 10 births results in:
58
p
0.58
100
p p
0.58 0.5
z
1.60
pq
0.5 0.5
n
100
We know from previous chapters that a z score of 1.60 is
not unusual.
At first glance, 58 girls in 100 births does not seem to
support the claim that the XSORT method increases the
likelihood a having a girl (more than a 50% chance).
Hypothesis testing
Test statistics alone cannot give us enough information to
value.
Two-tailed Test
H 0 :
H1 :
Left-tailed Test
H 0 :
H1 :
Right-tailed Test
H 0 :
H1 :
P-Value
The P-value (or probability value) is the probability
of getting a value of the test statistic that is at least
as extreme as the one representing the sample
data, assuming that the null hypothesis is true.
Critical region in
the left tail:
Critical region in
the right tail:
Critical region in
two tails:
Epicker
Suppose we have a test statistic value of 1.96
1. What is the p-value if we are conducting a right tailed
hypothesis test?
a)
b)
c)
d)
0.05
0.025
0.1
0.975
Epicker
Suppose we have a test statistic value of 1.96
1. What is the p-value if we are conducting a left tailed
hypothesis test?
a)
b)
c)
d)
0.05
0.025
0.1
0.975
Epicker
Suppose we have a test statistic value of 1.96
1. What is the p-value if we are conducting a two tailed
hypothesis test?
a)
b)
c)
d)
0.05
0.025
0.1
0.975
P-Value
The null hypothesis is rejected if the P-value is
very small, such as 0.05 or less.
Example
H 0 : p 0.5
H1 : p 0.5
The test statistic was :
p p
0.58 0.5
z
1.60
pq
0.5 0.5
n
100
Example
Critical Value
A critical value is any value that separates the
critical region (where we reject the null
hypothesis) from the values of the test statistic
that do not lead to rejection of the null hypothesis.
The critical values depend on the nature of the
null hypothesis, the sampling distribution that
applies, and the significance level .
Example
For the XSORT birth hypothesis test, the critical value and
critical region for an = 0.05 test are shown below:
Critical Value
If the test is one tail, the critical value would be depending
Decision Criterion
P-value Method:
Using the significance level :
If P-value , reject H0.
If P-value > , fail to reject H0.
e.g. If =0.05 and p value=0.0548, pvalue> , so fail to reject
Decision Criterion
Critical Value Method:
If the test statistic falls within the critical
region, reject H0.
If the test statistic does not fall within the
critical region, fail to reject H0.
e.g. If critical region is z=1.645 to infinity and test statistic z=1.60, then the
test statistic is not within the critical region, so we fail to reject the null
Example
For the XSORT baby gender test, the test had a test
statistic of z = 1.60 and a P-Value of 0.0548. We tested:
H 0 : p 0.5
H1 : p 0.5
Example
For the XSORT baby gender test, there was not sufficient
evidence to support the claim that the XSORT method is
effective in increasing the probability that a baby girl will be
born.
Caution
Never conclude a hypothesis test with a statement of
reject the null hypothesis or fail to reject the null
hypothesis.
Always make sense of the conclusion with a statement
that uses simple nontechnical wording that addresses the
original claim.
Type I Error
Type II Error
Errors
Example
Assume that we are conducting a hypothesis test of the
claim that a method of gender selection increases the
likelihood of a baby girl, so that the probability of a baby
girls is p > 0.5.
Here are the null and alternative hypotheses:
H 0 : p 0.5
H1 : p 0.5
a) Identify a type I error.
b) Identify a type II error.
Example - Continued
A type I error is the mistake of rejecting a true null
hypothesis:
We conclude the probability of having a girl is greater than
Example - Continued
A type II error is the mistake of failing to reject the null
Definition
The power of a hypothesis test is the probability 1
of rejecting a false null hypothesis.
The value of the power is computed by using a particular
significance level and a particular value of the population
parameter that is an alternative to the value assumed true
in the null hypothesis.
Power
1-
Chapter 7
Hypothesis Testing
7-1 Review and Preview
7-2 Basics of Hypothesis Testing
7-3 Testing a Claim about a Proportion
7-4 Testing a Claim About a Mean
7-5 Testing a Claim About a Standard Deviation or
Variance
Key Concept
This section presents complete procedures for
testing a hypothesis (or claim) made about a
population proportion.
This section uses the components introduced in
the previous section for the P-value method, the
traditional method or the use of confidence
intervals.
Key Concept
Two common methods for testing a claim about a
population proportion are (1) to use a normal
distribution as an approximation to the binomial
distribution, and (2) to use an exact method
based on the binomial probability distribution.
Part 1 of this section uses the approximate
method with the normal distribution, and Part 2 of
this section briefly describes the exact method.
Part 1:
Basic Methods of Testing Claims
about a Population Proportion p
Notation
n = sample size or number of trials
p = population proportion
q =1p
Note:
npq
p is the assumed proportion not the sample
proportion.
p p
z
pq
n
P-values:
Critical Values:
Methods to use
P-value method
Critical Value method
Confidence interval method - usually used for estimation
Caution
When testing claims about a population proportion, the
traditional method and the P-value method are equivalent
and will yield the same result since they use the same
standard deviation based on the claimed proportion p.
However, the confidence interval uses anpestimated
standard deviation based upon the sample proportion
Example
Based on information from the National Cyber Security
Alliance, 93% of computer owners believe they have
antivirus programs installed on their computers.
In a random sample of 400 scanned computers, it is found
that 380 of them (or 95%) actually have antivirus software
programs.
Use the sample data from the scanned computers to test
the claim that 93% of computers have antivirus software.
Example - Continued
Requirement check:
1.The 400 computers are randomly selected.
2.There is a fixed number of independent trials with two
categories (computer has an antivirus program or does
not).
3.The requirements np 5 and nq 5 are both satisfied
with n = 400
Example - Continued
P-Value Method:
1.The original claim that 93% of computers have antivirus
software can be expressed as p = 0.93.
2.The opposite of the original claim is p 0.93.
3.The hypotheses are written as:
H 0 : p 0.93
H1 : p 0.93
Example - Continued
P-Value Method:
4. For the significance level, we select = 0.05.
5. Because we are testing a claim about a population
proportion, the sample statistic relevant to this test is:
p p
z
pq
n
380
0.93
400
1.57
0.93 0.07
400
Example - Continued
P-Value Method:
6. Because the hypothesis test is two-tailed with a test statistic of
z = 1.57, the P-value is twice the area to the right of z = 1.57.
The P-value is twice 0.0582, or 0.1164.
Example - Continued
P-Value Method:
7. Because the P-value of 0.1164 is greater than the significance level
of = 0.05, we fail to reject the null hypothesis.
8.We fail to reject the claim that 93% computers have antivirus
software. We conclude that there is not sufficient sample evidence to
warrant rejection of the claim that 93% of computers have antivirus
programs.
Example - Continued
Critical Value Method: Steps 1 5 are the same as for
the P-value method.
6.The test statistic is computed to be z = 1.57. We now find the
critical values, with the critical region having an area of = 0.05, split
equally in both tails.
Example - Continued
Critical Value Method:
7.Because the test statistic does not fall in the critical region, we fail
to reject the null hypothesis.
8.We fail to reject the claim that 93% computers have antivirus
software. We conclude that there is not sufficient sample evidence to
warrant rejection of the claim that 93% of computers have antivirus
programs.
Example - Continued
Confidence Interval Method:
The claim of p = 0.93 can be tested at the = 0.05 level
of significance with a 95% confidence interval.
Using the methods of Section 7-2, we get:
0.929 < p < 0.971
This interval contains p = 0.93, so we do not have
sufficient evidence to warrant the rejection of the claim
that 93% of computers have antivirus programs.
Part 2
Exact Method for Testing Claims
about a Proportion p
Testing Claims
Using the Exact Method
Left-tailed test:
The P-value is the probability of getting x or fewer
successes among n trials.
Right-tailed test:
The P-value is the probability of getting x or more
successes among n trials.
Two-tailed test:
Example
In testing a method of gender selection, 10 randomly
selected couples are treated with the method, and 9 of the
babies are girls.
Use a 0.05 significance level to test the claim that with
this method, the probability of a baby being a girl is
greater than 0.75.
Example - Continued
We will test
H 0 : p 0.75
H1 : p 0.75
Example - Continued
The probability of 9 or more successes is 0.2440252,
which is the P-value of the hypothesis test.
The P-value is high (greater than 0.05), so we fail to reject
the null hypothesis.
There is not sufficient evidence to support the claim that
with the gender selection method, the probability of a girl
is greater than 0.75.
Chapter 7
Hypothesis Testing
7-1 Review and Preview
7-2 Basics of Hypothesis Testing
7-3 Testing a Claim about a Proportion
7-4 Testing a Claim About a Mean
7-5 Testing a Claim About a Standard Deviation or
Variance
Key Concept
This section presents methods for testing a claim about a
population mean.
Part 1 deals with the very realistic and commonly used
case in which the population standard deviation is not
known.
Part 2 discusses the procedure when is known, which is
very rare.
Part 1
When is not known, we use a t test that incorporates
the Student t distribution.
n = sample size
x = sample mean
x = population mean
Requirements
1. The sample is a simple random sample.
2. Either or both of these conditions is satisfied:
Test Statistic
x x
t
s
n
For running the test, both for pvalue method and critical
Example
Listed below are the measured radiation emissions (in W/kg)
corresponding to a sample of cell phones.
Use a 0.05 level of significance to test the claim that cell
phones have a mean radiation level that is less than 1.00
W/kg.
0.38
0.55
1.54
1.55
0.50
0.60
0.92
0.96
1.00
0.86
1.46
Example - Continued
Requirement Check:
We assume the sample is a simple random sample.
The sample size is n = 11, which is not greater than 30, so we
Example - Continued
The points are reasonably close to a straight line and there is
no other pattern, so we conclude the data appear to be from a
normally distributed population.
Example - Continued
Step 1: The claim that cell phones have a mean radiation
level less than 1.00 W/kg is expressed as < 1.00 W/kg.
Step 2: The alternative to the original claim is 1.00 W/kg.
Step 3: The hypotheses are written as:
H 0 : 1.00 W/kg
H1 : 1.00 W/kg
Example - Continued
Step 4: The stated level of significance is = 0.05.
Step 5: Because the claim is about a population mean , the
statistic most relevant to this test is the sample mean: .
Example - Continued
Step 6: Calculate the test statistic and then find the P-value or the critical
value from Table A-3:
x x 0.938 1.00
t
0.486
s
0.423
n
11
Example - Continued
Step 7: Critical Value Method: Because the test statistic of
t = 0.486 does not fall in the critical region bounded by the
critical value of t = 1.812, fail to reject the null hypothesis.
Example - Continued
Step 7: P-value method: Technology, such as a TI-83/84 Plus
calculator can output the P-value of 0.3191. Since the P-value
exceeds = 0.05, we fail to reject the null hypothesis.
Example
Step 8: Because we fail to reject the null hypothesis, we
conclude that there is not sufficient evidence to support the
claim that cell phones have a mean radiation level that is less
than 1.00 W/kg.
Finding P-Values
Assuming that neither software nor a TI-83 Plus calculator is
available, use Table A-3 to find a range of values for the Pvalue corresponding to the given results.
a) In a left-tailed hypothesis test, the sample size is n = 12,
and the test statistic is t = 2.007.
b) In a right-tailed hypothesis test, the sample size is n = 12,
and the test statistic is t = 1.222.
c) In a two-tailed hypothesis test, the sample size is n = 12,
and the test statistic is t = 3.456.
Example Confidence
Interval Method
We can use a confidence interval for testing a claim about
.
For a two-tailed test with a 0.05 significance level, we
construct a 95% confidence interval.
For a one-tailed test with a 0.05 significance level, we
construct a 90% confidence interval.
Example Confidence
Interval Method
Part 2
When is known, we use test that involves the standard
normal distribution.
In reality, it is very rare to test a claim about an unknown
population mean while the population standard deviation is
somehow known.
x x
z
For running the test, both for pvalue method and critical
value method, use the standard normal distribution
Example
If we repeat the cell phone radiation example, with the
assumption that = 0.480 W/kg, the test statistic is:
x x 0.938 1.00
z
0.43
0.480
n
11
Epicker
Find the corresponding p value for the previous example
where
x x 0.938 1.00
z
0.43
0.480
n
11
Chapter 7
Hypothesis Testing
7-1 Review and Preview
7-2 Basics of Hypothesis Testing
7-3 Testing a Claim about a Proportion
7-4 Testing a Claim About a Mean
7-5 Testing a Claim About a Standard Deviation or
Variance
Key Concept
This section introduces methods for testing a claim
made about a population standard deviation or
population variance 2.
The methods of this section use the chi-square
distribution.
= sample size
= sample standard deviation
= sample variance
= claimed value of the population standard
deviation
Requirements
1. The sample is a simple random sample.
2. The population has a normal distribution.
(This is a much stricter requirement than the
requirement of a normal distribution when testing claims
about means.)
Chi-Square Distribution
Test Statistic
(n 1) s
2
Caution
The 2 test of this section is not robust against a
departure from normality, meaning that the test does not
work well if the population has a distribution that is far
from normal.
The condition of a normally distributed population is
therefore a much stricter requirement in this section than
it for t statistic.
Example
Listed below are the heights (inches) for a simple random
sample of ten supermodels.
Consider the claim that supermodels have heights that
have much less variation than the heights of women in
the general population.
We will use a 0.01 significance level to test the claim that
supermodels have heights with a standard deviation that
is less than 2.6 inches.
70
71
69.25
68.5
Summary Statistics:
69
70
71
70
70
69.5
Example - Continued
Requirement Check:
1. The sample is a simple random sample.
2. We check for normality, which seems reasonable
based on the normal quantile plot.
Example - Continued
Step 1: The claim that the standard deviation is less
than 2.6 inches is expressed as < 2.6 inches.
Step 2: If the original claim is false, then 2.6 inches.
Step 3: The hypotheses are:
H 0 : 2.6 inches
H1 : 2.6 inches
Example - Continued
Step 4: The significance level is = 0.01.
Step 5: Because the claim is made about , we use the
chi-square distribution.
Example - Continued
Step 6: The test statistic is calculated as follows:
10 1 0.7997395
(n 1) s
x
0.852
2
2
2.6
2
Example - Continued
Step 6: The critical value of 2 = 2.088 is found from
Table A-4, and it corresponds to 9 degrees of freedom
and an area to the right of 0.99.
Example - Continued
Step 7: Because the test statistic is in the critical region,
we reject the null hypothesis.
There is sufficient evidence to support the claim that
supermodels have heights with a standard deviation that
is less than 2.6 inches.
Heights of supermodels have much less variation than
heights of women in the general population.
Example - Continued
P-Value Method:
P-values are generally found using technology, but Table
A-4 can be used if technology is not available.
Using a TI-83/84 Plus, the P-value is 0.0002897.
Example - Continued
P-Value Method:
Since the P-value = 0.0002897, we can reject the null
hypothesis (it is under the 0.01 significance level).
We reach the same exact conclusion as before regarding
the variation in the heights of supermodels as compared
to the heights of women from the general population.
Example - Continued
Confidence Interval Method:
Since the hypothesis test is left-tailed using a 0.01 level
of significance, we can run the test by constructing an
interval with 98% confidence.
Example - Continued
Based on this interval, we can support the claim that
< 2.6 inches, reaching the same conclusion as
using the P-value method and the critical value
method.