0% found this document useful (0 votes)
13 views46 pages

Hypothesis Testing 112

The document provides an overview of hypothesis testing in statistics, detailing key concepts such as null and alternative hypotheses, significance levels, and types of errors. It outlines the steps involved in hypothesis testing, including formulating hypotheses, selecting significance levels, and making decisions based on test statistics and p-values. Examples illustrate the application of these concepts in real-world scenarios, emphasizing the importance of understanding statistical significance and confidence intervals.

Uploaded by

operations.team
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views46 pages

Hypothesis Testing 112

The document provides an overview of hypothesis testing in statistics, detailing key concepts such as null and alternative hypotheses, significance levels, and types of errors. It outlines the steps involved in hypothesis testing, including formulating hypotheses, selecting significance levels, and making decisions based on test statistics and p-values. Examples illustrate the application of these concepts in real-world scenarios, emphasizing the importance of understanding statistical significance and confidence intervals.

Uploaded by

operations.team
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

Epidemiology and Biostatistics

Topic: Hypothesis Testing

Presenter(s): Prof. Hanan Al-Modallal


Topic: Student Learning Outcomes (SLOs)

By the end of the lecture, students should be able to:

1. Recognize the concepts of critical value, critical region, and region for rejection

2. Demonstrate a sold understanding of interval estimation and hypothesis testing

3. Explain the purpose of Null hypothesis testing, including role of sampling error

4. Describe the basic logic of Null hypothesis testing

5. Describe the role of relationship strength and sample size in determining statistical
significance

2
Topic: Hypothesis Testing

Key Concept
This section presents individual components of a hypothesis test, and the following
sections use those components in comprehensive procedures.
The role of the following should be understood:
 null hypothesis
 alternative hypothesis
critical region
 significance level
 critical value
 P-value
 Type I and II error

3
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
The Null Hypothesis, H0

 States the claim or assertion to be tested


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
Topic: Hypothesis Testing

Hypothesis Tests

Statistical hypothesis
• A statement, or claim, about a population parameter.
• Need a pair of hypotheses
• the null hypothesis that represents the claim
• the other, its alternative hypothesis

6
The Null Hypothesis, H0

• 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
• May or may not be rejected
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
• May or may not be proven
• Is generally the hypothesis that the researcher is
trying to prove
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 0.01, 0.05, or 0.10
• Is selected by the researcher at the beginning
• Provides the critical value(s) of the test
Level of Significance
and the Rejection Region
Level of significance = a Represents
critical value
H0: μ = 3 a/2 a/2
Rejection
H1: μ ≠ 3 Two-tail test 0 region is
shaded
H0: μ ≤ 3 a
H1: μ > 3
Upper-tail test 0

H0: μ ≥ 3
a
H1: μ < 3
Lower-tail test 0
Errors in Making Decisions
 Type I Error
 Reject a true null hypothesis
 Considered a serious type of error

The probability of Type I Error is 

 Called level of significance of the test


 Set by the researcher in advance
Errors in Making Decisions
(continued)

 Type II Error
 Fail to reject a false null hypothesis

The probability of Type II Error is β


Outcomes and Probabilities

Possible Hypothesis Test Outcomes

Actual
Situation
Decision H0 True H0 False
Do Not
No error Type II Error
Key: Reject
(1 - a ) (β)
Outcome H0
(Probability) Reject Type I Error No Error
H0 (a) (1-β)
Type I & II Error Relationship

 Type I and Type II errors cannot 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 ( β )
Z Test of Hypothesis for
the Mean (σ Known)
• Convert sample statistic ( X ) to a Z test statistic
Hypothesis
Tests for 

σKnown
Known σUnknown
Unknown
(Z test) (t test)
The test statistic is:

X μ
Z 
σ
n
Two-Tail Tests
 There are two H0: μ = 3
cutoff values H1: μ ¹
(critical values), 3
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
Lower-Tail Tests
H0: μ ≥ 3
 There is only one
critical value, since H1: μ < 3
the rejection area is
a
in only one tail

Reject H0 Do not reject H0


-Z 0
Z

μ X

Critical value
Upper-Tail Tests
 There is only one H0: μ ≤ 3

critical value, since H1: μ > 3


the rejection area is
in only one tail a

Do not reject H0 Reject H0


Z 0 Zα
_
X μ

Critical value
6 Steps in
Hypothesis Testing

1. State the null hypothesis, H0 and the alternative


hypothesis, H1
2. Choose the level of significance, , and the sample
size, n
3. Determine the appropriate test statistic and
sampling distribution
4. Determine the critical values that divide the
rejection and nonrejection regions
6 Steps in
Hypothesis Testing
(continued)

5. Collect data and compute the value of the test


statistic
6. Make the statistical decision and state the
managerial conclusion. If the test statistic falls into
the nonrejection region, do not reject the null
hypothesis H0. If the test statistic falls into the
rejection region, reject the null hypothesis.
Express the managerial conclusion in the context
of the problem
Example: Testing with Rejection
Regions
Employees in a large accounting firm claim that the mean salary of the
firm’s accountants is the same as that of its competitor’s, which is
$45,000. A random sample of 30 of the firm’s accountants has a mean
salary of $43,500 with a standard deviation of $5200. At
α = 0.05, test the employees’ claim.

21
Solution: Testing with Rejection
Regions
• H 0: • Test Statistic
• Ha: μ < $45,000 x   43, 500  45, 000
z 
•  = 0.05  n 5200 30
• Rejection Region:  1.58
• Decision: Fail to reject H0
Since the p-value falls outside the
0.05
rejection region, we fail to reject the
z null hypothesis and can say that
-1.645 0
there is not sufficient evidence to
-1.58
support the employees’ claim that
the mean salary is less than
22
$45,000.
Example: Testing with Rejection
Regions
The mean cost of raising a child from birth to age 2 in a
rural area is $10,460. You believe this value is incorrect, so
you select a random sample of 900 children (age 2) and
find that the mean cost is $10,345 with a standard
deviation of $1540. At α = 0.05, is there enough evidence
to conclude that the mean cost is different from $10,460

23
Solution: Testing with Rejection
Regions
• H0: μ = $10,460 • Test Statistic
• Ha: μ ≠ $10,460 x   10, 345  10, 460
z 
•  = 0.05  n 1540 900
• Rejection Region:  2.24
• Decision: Reject H0
At the 5% level of significance,
0.025 0.025 you have enough evidence to
z conclude the mean cost of
-1.96 0 1.96
raising a child from birth to age
-2.24 2 in a rural area is significantly
different from $10,460.
24
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
Hypothesis Testing
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-tail test)
2. Specify the desired level of significance and the
sample size
 Suppose that  = 0.05 and n = 100 are chosen
for this test
Hypothesis Testing
Example
3. Determine the appropriate technique
 σ is known so this is a Z test.
4. Determine the critical values
 For  = 0.05 the critical Z values are ±1.96
5. Collect the data and compute the test statistic
 Suppose the sample results are
n = 100, X = 2.84 (σ = 0.8 is assumed known)
So the test statistic is:
X  μ 2.84  3  .16
Z      2.0
σ 0.8 .08
n 100
Hypothesis Testing Example
• 6. Is the test statistic in the rejection region?

 = 0.05/2  = 0.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
Hypothesis Testing Example
6(continued). Reach a decision and interpret the result

 = 0.05/2  = 0.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 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 = 0.025 /2 = 0.025
P(Z   2.0) 0.0228
0.0228 0.0228
P(Z  2.0) 0.0228

p-value
= 0.0228 + 0.0228 = 0.0456
-1.96 0 1.96 Z
-2.0 2.0
p-Value Example
• Compare the p-value with 
• If p-value <  , reject H0
• If p-value   , do not reject H0

Here: p-value = 0.0456 /2 = 0.025 /2 = 0.025


 = 0.05
0.0228 0.0228
Since 0.0456 < 0.05,
we reject the null
hypothesis
-1.96 0 1.96 Z
-2.0 2.0
Connection to Confidence Intervals

 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  = 0.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
the lower tail below the mean of 3
H1: μ < 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
Example: Test Statistic
Obtain sample 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: Decision
Reach a decision and interpret the result:
Reject H0

 =
0.10

Do not reject H0 Reject H0


0
1.28
Z = 0.88

Do not reject H0 since Z = 0.88 ≤ 1.28


i.e.: there is not sufficient evidence that the
mean bill is over $52
p -Value Solution
(continued)
Calculate the p-value and compare to 
(assuming that μ = 52.0)
p-value = 0.1894

Reject H0 P( X 53.1)
 = 0.10
 53.1  52.0 
P Z  
0  10/ 64 
Do not reject H0 Reject H0
1.28 P(Z 0.88) 1 0.8106
Z = 0.88
0.1894

Do not reject H0 since p-value = 0.1894 >  = 0.10


Using P-values to Make a Decision

38
Example: Interpreting a P-value
The P-value for a hypothesis test is P = 0.0237. What is
your decision if the level of significance is
1. 0.05?
Solution:
Because 0.0237 < 0.05, you should reject the null
hypothesis.
2. 0.01?
Solution:
Because 0.0237 > 0.01, you should fail to reject the
null hypothesis.

39
Finding the P-value
After determining the hypothesis test’s standardized test
statistic and the test statistic’s corresponding area, do one
of the following to find the P-value.
a. For a left-tailed test, P = (Area in left tail).
b. For a right-tailed test, P = (Area in right tail).
c. For a two-tailed test, P = 2(Area in tail of test statistic).

40
Example: Finding the P-value
Find the P-value for a left-tailed hypothesis test with a
test statistic of z = -2.23. Decide whether to reject H0 if
the level of significance is α = 0.01.

Solution:
For a left-tailed test, P = (Area in left tail)

P = 0.0129

z
-2.23 0
Because 0.0129 > 0.01, you should fail to reject H0
41
Example: Finding the P-value
Find the P-value for a two-tailed hypothesis test with a
test statistic of z = 2.14. Decide whether to reject H0 if
the level of significance is α = 0.05.

Solution:
For a two-tailed test, P = 2(Area in tail of test statistic)
1 – 0.9838
P = 2(0.0162)
= 0.0162
0.9838 = 0.0324
z
0 2.14
Because 0.0324 < 0.05, you should reject H0
42
Z-Test for a Mean μ
• Can be used when the population is normal and  is known, or for
any population when the sample size n is at least 30.
• The test statistic is the sample mean
x
• The standardized test statistic is z

x   standard error 
z x
 n n
• When n  30, the sample standard deviation s can be substituted for
.

43
Example: Hypothesis Testing
Using P-values
In an advertisement, a pizza shop claims that its mean delivery time is
30 minutes. A random selection of 36 delivery times has a sample mean
of 28.5 minutes and a standard deviation of 3.5 minutes. Is there
enough evidence to support the claim at  = 0.01? Use a P-value.

44
Solution: Hypothesis Testing
Using P-values
• H 0: • P-value
• Ha: μ < 30 min
0.0051
•  = 0.01
z
• Test Statistic: -2.57 0
x  • Decision: 0.0051 < 0.01
z
 n Reject H0
28.5  30

3.5 36
 2.57
45
Topic: References

References

- Katz, D. L., Elmore, J. G., Wild, D., & Lucan, S. C. (2016). Jekel's Epidemiology,
Biostatistics and Preventive Medicine. Elsevier Health Sciences
- Merrill, R. M. (2013). Fundamentals of epidemiology and biostatistics: Combining the
basics. Jones & Bartlett Learning
- Bernard, R. (2017). Fundamental of Biostatistics. Jones & Bartlett Learning

46

You might also like