Topic:Hypothesis Testing Using a p-Value
From SharedExperienceProject
Contents |
Topic Highlights
(What you will learn)
- What a p-value is
- How to compute a p-value
- How to conduct a hypothesis test using a p-value
Introduction and Motivation
(Why learn it)
By now you should know a fair bit about hypothesis testing of the mean from the topics Two Tailed Hypothesis Testing and One Tailed and Small Sample Hypothesis Testing.
In this topic you will round out that knowledge by studying something called a p-value. You will see that the p-value is the largest significance value for which you would not reject your null hypothesis. After learning how to compute the p-value for a given test statistic, you will then see how to use it to test your hypothesis.
This applies for large and small samples, and for both the two- and one-tailed cases.
Learning Activities
(How the levels of understanding will be gained)
| Type | Name | Direction |
| Lecture and discussion |
| Instructor-directed |
| In-class worksheet | Self-directed | |
| Reading |
| Self-directed |
| Personal activities |
| Self-directed |
Learning Objectives
(Levels of understanding to be gained)
| Level of Understanding | Objective(s) |
| Very best |
|
| Highly satisfactory | |
| Satisfactory |
|
| Maybe just enough to pass |
|
Topic Notes: What is a p-Value?
The p-Value Concept
The concept of a p-value is perhaps best introduced through an example.
Example 1
For a hypothesis of the following form:
H0:=
0
Ha:>
0
a) Would you reject H0 in the following case?
b) Would you reject H0 in the following case?
c) How large could the level of significance,
, be such that you would not reject H0?
| Solution to a) |
|---|
|
No, you would no reject H0 because z* is not in the rejection region, or: z* < z1 |
| Solution to b) |
|---|
|
Yes, you would reject H0 because z* is in the rejection region, or: z* > z2 |
| Solution to c) |
|---|
| The largest that |
Part c of Example 1 gives rise to the concept of the p-value:
The p-value is the largest value offor which you would not reject H0.
In other words, it is the point at which the five-step hypothesis testing procedure leads us to switch from rejecting H0 to not rejecting it.
Computing p-Value
As you might imagine, the p-value is different for one and two-tailed cases.
The basic steps are:
- Determine the equation for p from the table below.
- Use either your z-distribution or t-distribution table to find the area
For the t-distribution, the following equations for p-value apply for the above cases:
Case A: p = 2 x (area right or left of z*) = area outside of z*
Case B: p = area left side of z*
Case C: p = area right side of z*
Now try your hand at finding the p-value.
Example 2
You want to test the following hypothesis for the mean of a normally distributed population:
H0:=
0 = 12.5
Ha:> 12.5
So, you take a sample of size n=51 to get the following sample mean and standard deviation:
= 13.4
s = 4.1
a) Find z* (rounded to 2 decimal places)
b) Sketch the situation, showing the p-value
c) Find the p-value
| Solution |
|---|
|
a)
b) c) From the summary table above, we see that we're looking for the area to the right of z* = 1.57: p = area right of z* = 0.50 - P(0 < z < 1.57)
|
Example 3
Now you want to test the following hypothesis:
H0:= 12.5
Ha:![]()
12.5
for the same situation, i.e. where z* = 1.57.
a) Sketch the situation
b) Find the p-value
| Solution |
|---|
|
a) c) From the summary table above, we see that we're looking for twice the area above of z* = 1.57: p = 2 x area right of z* = 2 x our answer in Example 2 = 2 x 0.0582 = 0.1164 |
Example 4
You want to test the a hypothesis of the following form for the mean (of a normally distributed random variable):
H0:=
0
Ha:<
0
You take a sample of size n=12 to get a sample mean and standard deviation from which you to compute the following test statistic:
t* = -2.98
a) Sketch the situation
b) In what range is the p-value?
| Solution |
|---|
|
a) b) From the summary table above, we see that we're looking for the area left of t* = -2.98: p = area to the left of t*With df=n-1=11 and using Table A.5 in Kvanli et al., you can look up the area corresponding to t = 2.98. Because this is a little more tricky that the same thing for the standard normal curve, it is shown below: 1. You should be looking at the row for degrees of freedom, df = 11 2. As shown in the boxed area below, the value t=2.98 falls between 2.718 and 3.106:
It is sufficient in this case to write: 0.005 < p < 0.010 |
Topic Notes: Hypothesis Testing with a p-Value
Once you've found the p-value, there are two ways it can be used to test the hypothesis.
Standard Test - Significance Level Known
If
is given, then the you can determine whether to reject by comparing the p-value to
:
Range of p-value Reject?
p <
reject H0
p > = ![]()
do not reject H0
Rule of Thumb - Significance Level Unknown
If
is not given, then the following rule of thumb applies:
Range of p-value Reject?
p < 0.01
reject H0
p > 0.10 do not reject H0 otherwise inconclusive!
Note that it is okay to say that the test is inconclusive. This is the downside of not specifying a significance level.
Hypothesis Testing Steps
If you are asked to use the p-value to do a hypothesis test, the following steps apply. Only step 4 is different from what you've seen before:
1. Define the hypotheses
2. Sketch the situation
3. Compute the test statistic
4. Determine whether to reject
4a. Find the p-value as described above4b. Use the Standard Test (above) ifis known, or use the Rule of Thumb (above) if
is not known
5. Give a conclusion
Practice Problems
Practice Problem 1
State the conclusion to testing the null hypothesis assuming each of the following situations:
a) p-value = 0.10 and significance level is 0.05
b) p-value = 0.02 and significance level is 0.05
c) p-value = 0.40 and significance level is 0.10
d) p-value = 0.001 and significance level is 0.01
| Solution |
|---|
|
a) do not reject H0 b) reject H0 c) do not reject H0 d) reject H0 |
Practice Problem 2
Find the p-values for the following situations, with calculated test statistics given by z*:
a) H0:
= 50, Ha:
50, z* = 2.53
b) H0:
= 50, Ha:
> 50, z* = 2.53
c) H0:
= 10, Ha:
10, z* = 1.87
d) H0:
= 10, Ha:
> 10, z* = 1.87
| Solution |
|---|
|
a) p = 0.0114 b) p = 0.0057 c) p = 0.0614 d) p = 0.0307 |
Practice Problem 3 (ES)
The time it takes a cupcake store to meet an order is normally distributed. Up until now, the population mean has been 10.2 minute and the population standard deviation has been 1.95 minutes. The owner made some changes overnight though, and claims that his new process is more efficient.
You decide to test the claim by taking a sample of 41 orders. You find that the mean is 9.4 minutes and the standard deviation is 2.4 minutes.
a) Use a significance level of 3% to test whether the changes made by the owner have made a significant improvement in the average time to fill an order
b) Calculate the p-value
c) Does a hypothesis test using the p-value lead you to the same conclusion as in a?
d) What would your conclusion have been if no level of significance had been given?
| Solution to b) |
|---|
|
In a way similar to what we did in Example 2: p = area to the left of z* = 0.50 - P(0 < z < 2.13) = 0.50 - 0.4834 = 0.0166 |
| Solution to c) |
|---|
|
Using the Standard Test described above: p=0.0166 and so according to the Standard Test, we reject H0 because p < So, we reach the same conclusion using the p-value. |
| Solution to d) |
|---|
|
If no significance level had been given, you would have had to use the Rule of Thumb described above to test where p lies with respect to 0.01 and 0.10: Since p = 0.0166, we can say that 0.01 < p < 0.10 So, according to the Rule of Thumb, we cannot draw a conclusion |











