1
Week 8
Fundamentals of Hypothesis Testing: One-Sample Tests
Statistics
2
Goals of this note
After completing this noe, you should be able to:
Formulate null and alternative hypotheses for applications involving a single population mean or proportion
Formulate a decision rule for testing a hypothesis
Know how to use the p-value approaches to test the null hypothesis for both mean and proportion problems
Know what Type I and Type II errors are
3
What is a Hypothesis?
A hypothesis is a claim (assumption) about a population parameter:
population mean
population proportion
The average number of TV sets in U.S. homes is equal to three ( )
A marketing company claims that it receives 8% responses from its mailing. ( p=.08 )
3μ
4
States the assumption to be tested
Example: The average number of TV sets in U.S. Homes is equal to three ( )
Is always about a population parameter, not about a sample statistic
The Null Hypothesis, H0
3μ:H0
3μ:H0 3X:H0
5
The Null Hypothesis, H0
Begins 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 May or may not be rejected
(continued)
6
The Alternative Hypothesis, H1
Is the opposite of the null hypothesis 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 Is generally the hypothesis that is believed (or
needs to be supported) by the researcher
7
Hypothesis Testing
We assume the null hypothesis is true If the null hypothesis is rejected we have
proven the alternate hypothesis If the null hypothesis is not rejected we have
proven nothing as the sample size may have been to small
Population
Claim: thepopulationmean age is 50.(Null Hypothesis:
REJECT
Supposethe samplemean age is 20: X = 20
SampleNull Hypothesis
20 likely if μ = 50?Is
Hypothesis Testing Process
If not likely,
Now select a random sample
H0: μ = 50 )
X
9
Do not reject H0 Reject H0Reject H0
There are two cutoff values (critical values), defining the regions of rejection
Sampling Distribution of
/2
0
H0: μ = 50
H1: μ 50
/2
Lower critical value
Upper critical value
50 X
X
20 Likely Sample Results
10
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 the compliment of the confidence coefficient Is selected by the researcher before sampling
Provides the critical value of the test
11
Level of Significance and the Rejection Region
H0: μ ≥ 3
H1: μ < 30
H0: μ ≤ 3
H1: μ > 3
Represents critical value
Lower tail test
Level of significance =
0Upper tail test
Two tailed test
Rejection region is shaded
/2
0
/2H0: μ = 3
H1: μ ≠ 3
12
Type I Error When a true null hypothesis is rejected The probability of a Type I Error is
Called level of significance of the test Set by researcher in advance
Type II Error Failure to reject a false null hypothesis The probability of a Type II Error is β
Errors in Making Decisions
13
Example
The Truth
Verdict
Innocent No error Type II Error
Guilty Type I Error
Possible Jury Trial Outcomes
Guilty Innocent
No Error
14
Outcomes and Probabilities
Actual SituationDecision
Do NotReject
H0
No error (1 - )
Type II Error ( β )
RejectH0
Type I Error( )
Possible Hypothesis Test Outcomes
H0 False H0 TrueKey:
Outcome(Probability)
No Error ( 1 - β )
15
Type I & II Error Relationship
Type I and Type II errors can not happen at the same time
Type I error can only occur if H0 is true
Type II error can only occur if H0 is false
If Type I error probability ( ) , then
Type II error probability ( β )
16
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
17
p-Value Approach to Testing
Convert Sample Statistic (e.g. ) to Test Statistic (e.g. t 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
X
(continued)
18
8 Steps in Hypothesis Testing
1. State the null hypothesis, H0
State the alternative hypotheses, H1
2. Choose the level of significance, α
3. Choose the sample size, n
4. Determine the appropriate test statistic to use
5. Collect the data
6. Compute the p-value for the test statistic from the sample result
7. Make the statistical decision: Reject H0 if the p-value is less than alpha
8. Express the conclusion in the context of the problem
19
Hypothesis Tests for the Mean
Known Unknown
Hypothesis Tests for
20
Hypothesis Testing Example
Test the claim that the true mean # of TV sets in U.S. homes is equal to 3.
1. State the appropriate null and alternative hypotheses
H0: μ = 3 H1: μ ≠ 3 (This is a two tailed
test) 2. Specify the desired level of significance
Suppose that = .05 is chosen for this test 3. Choose a sample size
Suppose a sample of size n = 100 is selected
21
4. Determine the appropriate Test
σ is unknown so this is a t test 5. Collect the data
Suppose the sample results are
n = 100, = 2.84 s = 0.8 6. So the test statistic is:
The p value for n=100, =.05, t=-2 is .048
2.0.08
.16
100
0.832.84
n
sμX
t
Hypothesis Testing Example(continued)
X
22
7. Is the test statistic in the rejection region?
Reject H0 if p is < alpha; otherwise do not reject H0
Hypothesis Testing Example(continued)
The p-value .048 is < alpha .05, we reject the null hypothesis
23
8. Express the conclusion in the context of the problem
Since The p-value .048 is < alpha .05, we have rejected the null hypothesis
Thereby proving the alternate hypothesis
Conclusion: There is sufficient evidence that the mean number of TVs in U.S. homes is not equal to 3
Hypothesis Testing Example(continued)
If we had failed to reject the null hypothesis the conclusion would have been: There is not sufficient evidence to reject the claim that the mean number of TVs in U.S. home is 3
24
One Tail Tests
In many cases, the alternative hypothesis focuses on a particular direction
H0: μ ≥ 3
H1: μ < 3
H0: μ ≤ 3
H1: μ > 3
This is a lower tail test since the alternative hypothesis is focused on the lower tail below the mean of 3
This is an upper tail test since the alternative hypothesis is focused on the upper tail above the mean of 3
25
Reject H0 Do not reject H0
There is only one
critical value, since
the rejection area is
in only one tail
Lower Tail Tests
-t 3
H0: μ ≥ 3
H1: μ < 3
Critical value
X
26
Reject H0Do not reject H0
Upper Tail Tests
tα3
H0: μ ≤ 3
H1: μ > 3
There is only one
critical value, since
the rejection area is
in only one tail
Critical value
t
X
27
Assumptions of the One-Sample t Test
The data is randomly selected
The population is normally distributed orthe sample size is over 30 and the population is not highly skewed
28
Hypothesis Tests for Proportions
Involves categorical values
Two possible outcomes “Success” (possesses a certain characteristic)
“Failure” (does not possesses that characteristic)
Fraction or proportion of the population in the “success” category is denoted by p
29
Proportions
Sample proportion in the success category is denoted by ps
When both np and n(1-p) are at least 5, ps can be approximated by a normal distribution with mean and standard deviation
sizesample
sampleinsuccessesofnumber
n
Xps
pμ sp n
p)p(1σ
sp
(continued)
30
The sampling distribution of ps is approximately normal, so the test statistic is a Z value:
Hypothesis Tests for Proportions
n)p(p
ppZ
s
1
np 5and
n(1-p) 5
Hypothesis Tests for p
np < 5or
n(1-p) < 5
Not discussed in this chapter
31
Example: Z Test for Proportion
A marketing company claims that it receives 8% responses from its mailing. To test this claim, a random sample of 500 were surveyed with 25 responses. Test at the = .05 significance level.
Check:
n p = (500)(.08) = 40
n(1-p) = (500)(.92) = 460
32
Z Test for Proportion: Solution
= .05
n = 500, ps = .05p-value for -2.47 is .0134Decision:Reject H0 at = .05
H0: p = .08
H1: p
.08
Critical Values: ± 1.96
Test Statistic:
Conclusion:z0
Reject Reject
.025.025
1.96
-2.47
There is sufficient evidence to reject the company’s claim of 8% response rate.
2.47
500.08).08(1
.08.05
np)p(1
ppZ
s
-1.96
33
Potential Pitfalls and Ethical Considerations
Use randomly collected data to reduce selection biases Do not use human subjects without informed consent Choose the level of significance, α, before data
collection Do not employ “data snooping” to choose between one-
tail and two-tail test, or to determine the level of significance
Do not practice “data cleansing” to hide observations that do not support a stated hypothesis
Report all pertinent findings
34
Summary
Addressed hypothesis testing methodology
Discussed critical value and p–value approaches to hypothesis testing
Discussed type 1 and Type2 errors
Performed two tailed t test for the mean (σ unknown)
Performed Z test for the proportion
Discussed one-tail and two-tail tests
Addressed pitfalls and ethical issues