[go: up one dir, main page]

0% found this document useful (0 votes)
16 views45 pages

Chapter 1 - Notes

Chapter 1 covers the fundamentals of hypothesis testing, including definitions of null and alternative hypotheses, types of errors, and procedures for conducting tests. It introduces P-values as an alternative method for decision-making in hypothesis tests, detailing how to calculate them based on different test types. Additionally, it outlines the one-sample tests for population means and variances, emphasizing the importance of sample size and known variances in determining the appropriate statistical approach.

Uploaded by

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

Chapter 1 - Notes

Chapter 1 covers the fundamentals of hypothesis testing, including definitions of null and alternative hypotheses, types of errors, and procedures for conducting tests. It introduces P-values as an alternative method for decision-making in hypothesis tests, detailing how to calculate them based on different test types. Additionally, it outlines the one-sample tests for population means and variances, emphasizing the importance of sample size and known variances in determining the appropriate statistical approach.

Uploaded by

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

Chapter 1: P-values and Hypothesis Testing

(Section 1.1 and 1.2)


 Section 1.1: STAT130 Recap of Hypothesis Tests
o What is a statistical hypothesis?
o Null and alternate hypotheses
o Types of errors
o Hypothesis test procedure
o Rejection rule using the critical value approach
 Section 1.2: Introduction to a P-value
o Calculating P-values in General
o Rejection rule using the P-value approach
1.1 Recall from STAT130: Hypothesis Testing
Statistical hypotheses:
 An assertion (claim, assumption, hypothesis) made about the value of a
specific population parameter (𝜽𝜽).
 Population parameters can be the mean, median, proportion, standard
deviation, etc.
 Notations: population (𝑋𝑋, 𝑁𝑁, 𝜎𝜎, 𝜇𝜇) and sample (𝑥𝑥, 𝑛𝑛, 𝑆𝑆, 𝑥𝑥)̅
 Hypothesis testing just means testing a statistical hypothesis (or claim) to
determine if the claim is true or not and to determine to which extent
(based on a probability, confidence interval, or significance level) it is
true (but never with absolute certainty).
Null & Alternative Hypotheses:

 The null hypothesis (𝐻𝐻0 ) is a statement concerning the exact value of the
parameter (𝜃𝜃) of interest:
𝐻𝐻0 : 𝜃𝜃 = 𝜃𝜃0
The alternative hypothesis (𝐻𝐻1 ) is a statement about the possible values
of the parameter that are believed to be true if 𝐻𝐻0 is not true. Only one
alternative hypothesis is tested at a time:
𝐻𝐻1 : 𝜃𝜃 < 𝜃𝜃0 (left-tailed test) or
𝐻𝐻1 : 𝜃𝜃 > 𝜃𝜃0 (right-tailed test) or
𝐻𝐻1 : 𝜃𝜃 ≠ 𝜃𝜃0 (two-tailed test)
Types of Errors: (Uncertainty and errors arise because we use a sample and not the population)

 There is always a level of uncertainty attached to the conclusion of a


hypothesis test. The uncertainty is related to 2 possible types of errors:

True situation\
𝑯𝑯𝟎𝟎 not rejected 𝑯𝑯𝟎𝟎 rejected
Conclusion

𝑯𝑯𝟎𝟎 true Correct decision Type I Error

𝑯𝑯𝟎𝟎 not true Type II Error Correct decision

 The hypothesis test is carried out to keep the probability of making a


Type I Error as small as possible → P(Type I) = 𝛼𝛼
 𝛼𝛼 is the pre-specified level of significance, usually 𝛼𝛼 = 0.05 ↔ 95%
confidence
Hypothesis Test Procedure:

 Hypothesis tests are carried out by using the set level of significance (𝛼𝛼)
and by assuming the null hypothesis is true.

 We then need to use the collected sample to try and prove it is


impossible for 𝐻𝐻0 to be true (in other words, we need to see if we have
enough evidence to prove that 𝐻𝐻0 is false).

 Thus, the conclusions for the hypothesis test are expressed as follows:

 When 𝑯𝑯𝟎𝟎 is rejected: We have sufficient evidence to conclude


𝑯𝑯𝟏𝟏 (the alternate hypothesis).

 When 𝑯𝑯𝟎𝟎 is not rejected: We do NOT have enough evidence to


conclude the 𝑯𝑯𝟏𝟏 , however, we do NOT accept 𝑯𝑯𝟎𝟎 .
 When 𝐻𝐻0 is rejected, we can say there is a significance in the test (a
significant finding).

Hypothesis Test Decision:

 For a hypothesis test, a test statistic is calculated using information


obtained from the sample.

 The test statistic is then compared to a critical value that is obtained


from the statistical tables and is based on the level of significance 𝛼𝛼 and
the alternative hypothesis, 𝐻𝐻1 (this is called the critical value approach
to hypothesis tests).

 The critical value is the cut-off value of a rejection region.

 The rejection region depends on the alternative hypothesis.


Hypothesis Test Rejection Rule using the Critical Value Approach:

 The rejection rule for any hypothesis test is to reject 𝐻𝐻0 in favour of 𝐻𝐻1 if
the test statistic lies in the rejection region:

 For 𝐻𝐻1 : 𝜃𝜃 < 𝜃𝜃0 (left-tailed test)


𝐻𝐻0 is rejected if the test statistic is less than the critical value.
 For 𝐻𝐻1 : 𝜃𝜃 > 𝜃𝜃0 (right-tailed test)
𝐻𝐻0 is rejected if the test statistic is greater than the critical value.
 For 𝐻𝐻1 : 𝜃𝜃 ≠ 𝜃𝜃0 (two-tailed test)
𝐻𝐻0 is rejected if the test statistic is less than the lower critical value OR if
the test statistic is greater than the upper critical value (two rejection
regions).
1.2 Introduction to P-values:
 A P-value is an alternative approach to obtaining the decision of a
hypothesis test.

 It is used instead of the critical value.

 A P-value is the probability, when assuming the null hypothesis is true, of


obtaining by chance a result as or more extreme than that observed in
the sample.

For example, suppose we want to test whether the average height of the
female students in a STAT140 lecture is less than 1.7 metres.
𝐻𝐻0 : 𝜇𝜇 = 1.7
𝐻𝐻1 : 𝜇𝜇 < 1.7
𝐻𝐻0 : 𝜇𝜇 = 1.7
𝐻𝐻1 : 𝜇𝜇 < 1.7

Suppose we have obtained a sample such that the sample mean 𝑥𝑥̅ = 1.6.
We know there are two possibilities:

1. The sample we obtained could, by chance, have consisted of shorter


female students to obtain a lower sample mean (but in reality 𝜇𝜇 = 1.7).

2. All the female students in the STAT140 lecture could be shorter


therefore resulting in a lower population mean, and thus 𝜇𝜇 should
actually be less than 1.7.

 A P-value is the probability of outcome 1, under the assumption that


𝐻𝐻0 : 𝜇𝜇 = 1.7 is true.
 Therefore, a P-value is a measure of the chance of obtaining a sample
mean of 𝑥𝑥̅ = 1.6 or something more extreme (for a left-tailed test more
extreme would be referring to something even smaller than 1.6).

 For small P-values, we can conclude there is a small chance of outcome


1 occurring if the null hypothesis is true.

 i.e. a small chance of getting such a sample if the null hypothesis is true,
and therefore 𝐻𝐻0 cannot possibly be true, and thus we can reject the
null hypothesis.

 How small must the P-value be to reject the null hypothesis in favour of
the alternative? We compare it to the level of significance, 𝛼𝛼 …
(discussed more from slide 13).
Calculating P-values in General:

 Since a P-value is the probability of obtaining a sample statistic as or


more extreme, its calculation depends on the alternative hypothesis.

 In addition, instead of using the sample statistic to calculate a P-value,


the test statistic is used.

For a left-tailed test:

A more extreme value would be considered as something much smaller.


Thus, if 𝐻𝐻1 : 𝜃𝜃 < 𝜃𝜃0

P-value = Probability that the test statistic is less than or equal to that
calculated.
For a right-tailed test:
A more extreme value would be considered as something much larger.
Thus, if 𝐻𝐻1 : 𝜃𝜃 > 𝜃𝜃0
P-value = Probability that the test statistic is greater than or equal to that
calculated.
For a two-tailed test:
A more extreme value would be considered as something much smaller if
the test statistic is small, or much larger if the test statistic is large, OR if the
absolute value of the test statistic is much larger than that calculated. Thus,
if 𝐻𝐻1 : 𝜃𝜃 ≠ 𝜃𝜃0
P-value = 𝟐𝟐 ×Probability that the test statistic is greater than or equal to the
absolute value of that calculated.
It is multiplied by 2 as there are 2 possibilities for a two-tailed test and 2 rejection regions.
Hypothesis Test Rejection Rule using the P-value Approach:
To demonstrate how the rejection rule using the P-value works, let’s
consider a diagram of the rejection region of a right-tailed test for the
population mean with population variance known, i.e. a Z-test with the
following hypotheses:
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
This means the
𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 rejection region lies to
the right side

rejection region
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0
rejection region

area = 𝛼𝛼
• Recall: The area of a rejection region for ANY hypothesis test is always
equal to 𝛼𝛼, the level of significance.
• For a right-tailed test, P-value = 𝑃𝑃(𝑍𝑍 > 𝑍𝑍0 ) (𝑍𝑍0 being the calculated test
statistic, also known as 𝑍𝑍𝑐𝑐𝑐𝑐𝑐𝑐 )
• i.e. for a right-tailed test, the P-value is simply the area to the right of the
calculated test statistic, 𝑍𝑍0 .
Therefore, the P-value can be used to determine if the test statistic falls in
the rejection region or not by comparing it to 𝛼𝛼.

Suppose 𝑍𝑍0 lies in the rejection region:

𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0
rejection region = 𝛼𝛼

𝑍𝑍0
P-value = 𝑃𝑃(𝑍𝑍 > 𝑍𝑍0 ) < 𝛼𝛼

∴ if 𝒁𝒁𝟎𝟎 lies in the rejection region, the P-value will be less than 𝜶𝜶.
Suppose 𝑍𝑍0 does NOT lie in the rejection region:

𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 rejection region = 𝛼𝛼

This holds true for all the


alternative hypotheses.

𝑍𝑍0
P-value = 𝑃𝑃(𝑍𝑍 > 𝑍𝑍0 ) > 𝛼𝛼

∴ if 𝒁𝒁𝟎𝟎 does NOT lie in the rejection region, the P-value will be greater than 𝜶𝜶.

Thus, the P-value rejection rule for ANY hypothesis test is:
 If P-value < 𝛼𝛼, reject 𝐻𝐻0 (this is referred to as a significant P-value)
 If P-value > 𝛼𝛼, do not reject 𝐻𝐻0
Chapter 1: P-values and Hypothesis Testing
(Section 1.3 and 1.4)
 Section 1.3: One-sample test for the population mean
o STAT130 recap on the three cases for the population mean test
o Finding P-values for the Normal distribution
o Finding P-values for the t-distribution
 Section 1.4: One-sample test for the population variance
o STAT130 recap on the population variance test
o Finding P-values for the Chi-square distribution
1.3 One sample test for the population mean, 𝝁𝝁
Recall from STAT130: There are 3 cases for a hypothesis test concerning the
population mean 𝜇𝜇:
 Case 1: Population variance 𝜎𝜎 2 is known
 Case 2: Population variance 𝜎𝜎 2 is unknown but 𝑛𝑛 ≥ 30 (large sample size)
 Case 3: Population variance 𝜎𝜎 2 is unknown but 𝑛𝑛 < 30 (small sample size)
The case above that is used determines the distribution of the test statistic,
and thus which statistical tables are used to obtain the P-value.
 If the test statistic follows a standard normal distribution (i.e. is 𝑍𝑍0 ), then
the standard normal tables are used to obtain the P-value.
 If the test statistic follows a 𝑡𝑡-distribution, (i.e. is 𝑡𝑡0 ), then the t-tables
are used to obtain the P-value.
Summary of cases for a sample test for the population mean, 𝝁𝝁

𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
(One sample)

𝜎𝜎 2 is known 𝜎𝜎 2 is unknown
𝑛𝑛 ≥ 30

𝑛𝑛 < 30

𝑥𝑥̅ − 𝜇𝜇 𝑥𝑥̅ − 𝜇𝜇0


𝑍𝑍0 = 𝜎𝜎 0 𝑡𝑡0 =
Replace 𝜎𝜎 by 𝑆𝑆 𝑆𝑆
𝑛𝑛 𝑛𝑛

𝑑𝑑. 𝑓𝑓. = 𝑛𝑛 − 1
P-values for one sample test for the population mean, 𝝁𝝁
Case 1: Population variance (𝝈𝝈𝟐𝟐 ) known

Null Hypothesis 𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0

Alternative 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0


Hypothesis (left-tailed test) (right-tailed test) (two-tailed test)
𝑥𝑥̅ − 𝜇𝜇0
Test statistic 𝑍𝑍0 = 𝜎𝜎
� 𝑛𝑛

P-value 𝑃𝑃(𝑍𝑍 ≤ 𝑍𝑍0 ) 𝑃𝑃(𝑍𝑍 ≥ 𝑍𝑍0 ) 2 × 𝑃𝑃(𝑍𝑍 ≥ |𝑍𝑍𝑜𝑜 |)


P-values for one sample test for the population mean, 𝝁𝝁
Case 2: Population variance (𝝈𝝈𝟐𝟐 ) unknown and 𝒏𝒏 ≥ 𝟑𝟑𝟑𝟑
𝜎𝜎 in Case 1 on the previous slide is replaced by 𝑠𝑠 (the sample standard deviation)

Null Hypothesis 𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0

Alternative 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0


Hypothesis (left-tailed test) (right-tailed test) (two-tailed test)
𝑥𝑥̅ − 𝜇𝜇0
Test statistic 𝑍𝑍0 =
𝑆𝑆�
𝑛𝑛

P-value 𝑃𝑃(𝑍𝑍 ≤ 𝑍𝑍0 ) 𝑃𝑃(𝑍𝑍 ≥ 𝑍𝑍0 ) 2 × 𝑃𝑃(𝑍𝑍 ≥ |𝑍𝑍𝑜𝑜 |)


P-values for one sample test for the population mean, 𝝁𝝁
Case 3: Population variance (𝝈𝝈𝟐𝟐 ) unknown but 𝒏𝒏 < 𝟑𝟑𝟑𝟑
The test statistic will now follow a 𝑡𝑡-distribution (with 𝑛𝑛 – 1 degrees of freedom) instead of
a standard normal distribution.

Null Hypothesis 𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0

Alternative 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0


Hypothesis (left-tailed test) (right-tailed test) (two-tailed test)
𝑥𝑥̅ − 𝜇𝜇0
𝑡𝑡0 = with 𝑛𝑛 − 1 degrees
Test statistic 𝑆𝑆� of freedom
𝑛𝑛

P-value 𝑃𝑃(𝑡𝑡 ≤ 𝑡𝑡0 ) 𝑃𝑃(𝑡𝑡 ≥ 𝑡𝑡0 ) 2 × 𝑃𝑃(𝑡𝑡 ≥ |𝑡𝑡𝑜𝑜 |)


Example 1:
A supermarket receives complaints that the mean content of “1 kilogram”
sugar bags that are sold by them is less than 1 kilogram. A random sample
of 40 sugar bags is selected from the shelves and the mean found to be
0.987 kilograms. From past experience the standard deviation of the
contents of these bags is known to be 0.025 kilograms. Test, at the 5% level
of significance, whether this complaint is justified.
𝑛𝑛 = 40, 𝑥𝑥̅ = 0.987, 𝜎𝜎 = 0.025, 𝛼𝛼 = 0.05

Solution:
𝐻𝐻0 : 𝜇𝜇 = 1
𝐻𝐻1 : 𝜇𝜇 < 1 (left-tailed test)
𝑛𝑛 = 40, 𝑥𝑥̅ = 0.987, 𝜎𝜎 = 0.025,

𝐻𝐻0 : 𝜇𝜇 = 1 𝜇𝜇0 = 1
𝐻𝐻1 : 𝜇𝜇 < 1

Since 𝜎𝜎 (and therefore 𝜎𝜎 2 ) is known, we use a Z test-statistic:


𝑥𝑥̅ − 𝜇𝜇0
𝑍𝑍0 = 𝜎𝜎
𝑛𝑛

0.987 − 1
Always round 𝑍𝑍0 =
0.025
off to two decimal 40
places.
= −3.29 Next, we can calculate the
P-value using 𝑍𝑍0 …
Finding the P-value using the Standard Normal tables:
Using the P-value approach:
To determine this P-value, use the
𝐻𝐻0 : 𝜇𝜇 = 1 𝑍𝑍0 = −3.29 𝛼𝛼 = 0.05 standard normal tables:
𝐻𝐻1 : 𝜇𝜇 < 1

For a left-tailed test:

P-value = 𝑃𝑃(𝑍𝑍 ≤ 𝑍𝑍0 )


= 𝑃𝑃(𝑍𝑍 ≤ −3.29)

= 0.0005

∴ Since P-value < α = 0.05, 𝐻𝐻0 is rejected at a 5% level of significance.


Conclusion: There is sufficient evidence to conclude 𝐻𝐻1 : 𝜇𝜇 < 1
Example 2:
During a quality control exercise the manager of a factory that fills cans of
frozen shrimp wants to check whether the mean weights of the cans
conform to specifications i.e. the mean of these cans should be 600 grams
as stated on the label of the can. He/she wants to guard against either
over or under filling the cans. A random sample of 50 of these cans is
selected and the mean found to be 595 grams. From past experience the
standard deviation of contents of these cans is known to be 20 grams. Test,
at the 10% level of significance, whether the weights conform to
specifications. 𝑛𝑛 = 50, 𝑥𝑥̅ = 595, 𝜎𝜎 = 20, 𝛼𝛼 = 0.10
Solution:
𝐻𝐻0 : 𝜇𝜇 = 600
𝐻𝐻1 : 𝜇𝜇 ≠ 600 (two-tailed test)
𝑛𝑛 = 50, 𝑥𝑥̅ = 595, 𝜎𝜎 = 20,
𝐻𝐻0 : 𝜇𝜇 = 600 𝜇𝜇0 = 600
𝐻𝐻1 : 𝜇𝜇 ≠ 600

Since 𝜎𝜎 (and therefore 𝜎𝜎 2 ) is known, we use a Z test-statistic:

𝑥𝑥̅ − 𝜇𝜇0
𝑍𝑍0 = 𝜎𝜎
𝑛𝑛

595 − 600
=
20
50

= −1.77
Finding the P-value: Round 𝑍𝑍0 to two
decimal places.
𝐻𝐻0 : 𝜇𝜇 = 600 𝑍𝑍0 = −1.77
𝐻𝐻1 : 𝜇𝜇 ≠ 600 𝛼𝛼 = 0.10

For a two-tailed test: P-value = 2 × 𝑃𝑃(𝑍𝑍 ≥ |𝑍𝑍0 |) To determine this,


use the standard
= 2 × 𝑃𝑃(𝑍𝑍 ≥ 1.77) normal tables.
= 2 × 1 − 𝑃𝑃(𝑍𝑍 < 1.77)
= 2 × 1 − 0.9616

= 0.0768
∴ Since P-value < α = 0.10, 𝐻𝐻0 is rejected at a 10% level of significance.

NOTE: If 𝛼𝛼 = 0.05, the decision would have changed to NOT reject (as P-value >
0.05). Thus, the decision is ALWAYS in terms of the level of significance used!
Example 3:
A supermarket manager suspects that the machine filling “500 gram”
containers of coffee is overfilling them. A random sample of 20 of these
containers is selected from the shelves and the mean found to be 501.8
grams with a variance of 30. Test at the 5% level of significance whether the
manager’s suspicion is justified.

𝑛𝑛 = 20, 𝑥𝑥̅ = 501.8, 𝑆𝑆 2 = 30 (sample variance), 𝛼𝛼 = 0.05

Referring to being calculated


Solution: from the sample of 20.
𝐻𝐻0 : 𝜇𝜇 = 500
𝐻𝐻1 : 𝜇𝜇 > 500 (right-tailed test)
𝑛𝑛 = 20, 𝑥𝑥̅ = 501.8, 𝑆𝑆 2 = 30, 𝑆𝑆 = 30
𝐻𝐻0 : 𝜇𝜇 = 500 𝜇𝜇0 = 500
𝐻𝐻1 : 𝜇𝜇 > 500

Since 𝜎𝜎 2 is unknown AND 𝑛𝑛 < 30, we use a 𝑡𝑡 test-statistic:


𝑥𝑥̅ − 𝜇𝜇0
𝑡𝑡0 =
𝑆𝑆
𝑛𝑛
501.8 − 500
=
Always round 𝑡𝑡0 off 30
to 3 decimal places 20 Since the test statistic
follows a 𝑡𝑡-distribution, the
= 1.470 t-tables must be used…
Finding the P-value using the t-tables:
 Recall the 𝑡𝑡-distribution has a degrees of freedom of 𝑣𝑣 = 𝑛𝑛 − 1 associated
with it.
 These degrees of freedom (𝑣𝑣) are represented in the 1st column of the t-
tables.
 The areas corresponding the t-values in the tables are found in the top
row.
 HOWEVER, unlike the standard normal tables, the STAT140 t-tables give
areas to the right of a 𝑡𝑡-value (no longer to the left)

𝛼𝛼 = area to the right of the 𝑡𝑡-value


These are the areas
given in the t-tables: 1 − 𝛼𝛼 i.e. the t-tables always
give us 𝑃𝑃(𝑡𝑡 ≥ 𝑡𝑡𝑣𝑣 )
𝑡𝑡𝑣𝑣;𝛼𝛼
Finding the P-value using the t-tables:
The t-tables can only be used to
find approximate P-values.
Statistical software is used to find
exact P-values.
E.g: Let’s use the tables to find
𝑃𝑃 𝑡𝑡 ≥ 2.45 for a 𝑑𝑑𝑑𝑑 = 7
1) Locate the 𝑑𝑑𝑑𝑑 = 𝑣𝑣 = 7 in the
1st column
2) Find the two values 2.45 lies
between.
3) Thus, the probability lies
between the two 𝛼𝛼 values
corresponding to those two
values.
∴ 0.01 < 𝑃𝑃 𝑡𝑡 ≥ 2.45 < 0.025
Back to Example 3: To find the P-value: Using the t-table:
𝐻𝐻0 : 𝜇𝜇 = 500 𝑡𝑡0 = 1.470
𝐻𝐻1 : 𝜇𝜇 > 500 𝑑𝑑𝑑𝑑 = 19
For a right-tailed test:
P-value = 𝑃𝑃(𝑡𝑡 ≥ 𝑡𝑡0 )
= 𝑃𝑃(𝑡𝑡 ≥ 1.470)

∴ 0.05 < P-value < 0.1


Even without finding the 1.328 < 𝑡𝑡0 = 1.470 < 1.729
exact P-value, we can
still obtain our decision:
Thus, P-value > 0.05
∴ Since P-value > α = 0.05, 𝐻𝐻0 is NOT rejected at a 5% level of significance.
Example 4:
A paint manufacturer claims that the average drying time for a new paint
is 2 hours. The drying times in minutes for 16 randomly selected cans of
paint were obtained. The results are shown below.
103 106 109 125 121 118 119 120
112 103 121 126 122 115 116 113
Test whether the mean drying time for all the paint is less than 2 hours
(i) at the 5% level of significance.
(ii) at the 1% level of significance.
𝑛𝑛 = 16, 𝑥𝑥̅ = 115.56 minutes, 𝑆𝑆 = 7.33 minutes
(Using STAT mode on calculator to find the mean and standard deviation of the
above data set)
Test whether the mean drying time for all the paint is less than 2 hours
(i) at the 5% level of significance. 𝛼𝛼 = 0.05
120 minutes
Solution:
𝐻𝐻0 : 𝜇𝜇 = 120
𝐻𝐻1 : 𝜇𝜇 < 120 (mean is less than 2 hours)

123 106 139 135 127 128 119 130 109 120
131 133 121 136 122 115 116 133 130 109

𝑛𝑛 = 16, 𝑥𝑥̅ = 115.56 minutes, 𝑆𝑆 = 7.33 minutes

This is all the information we have ∴ 𝜎𝜎 2 is unknown.


𝜎𝜎 2 is unknown AND 𝑛𝑛 = 16 < 30


𝑥𝑥 − 𝜇𝜇0 𝑥𝑥̅ = 115.56, 𝑆𝑆 = 7.33, 𝜇𝜇0 = 120
𝑡𝑡0 =
𝑆𝑆
� 𝑛𝑛
test There are no t-tables for
statistic 115.56 − 120 negative 𝑡𝑡-values. But
= = −2.423 due to symmetry:
7.33�
16 𝑃𝑃 𝑡𝑡 < −𝑡𝑡𝑣𝑣 = 𝑃𝑃(𝑡𝑡 > 𝑡𝑡𝑣𝑣 )

𝐻𝐻1 : 𝜇𝜇 < 120 (left-tailed test) This is now the


area/probability that the
∴ P-value = 𝑃𝑃(𝑡𝑡 ≤ 𝑡𝑡0 ) = 𝑃𝑃(𝑡𝑡 ≤ −2.423) t-tables directly gives us
(area to the right)
= 𝑃𝑃(𝑡𝑡 > 2.423)
To find the P-value: Using the t-table:
𝑑𝑑𝑑𝑑 = 𝑛𝑛 − 1 = 15
α = 0.05
(Note is the level of significance,
it has nothing to do with 𝛼𝛼 in the
tables)

P-value = 𝑃𝑃(𝑡𝑡 ≤ 𝑡𝑡0 )


2.131 < 2.423 < 2.602
= 𝑃𝑃(𝑡𝑡 ≤ −2.423)
= 𝑃𝑃(𝑡𝑡 > 2.423)
∴ 0.01 < P-value < 0.025

Thus, P-value < 0.05

∴ Since P-value < α = 0.05, 𝐻𝐻0 is rejected at a 5% level of significance.


(ii) at the 1% level of significance:

When the level of significance changes, it does not affect the P-value, only
the decision of the hypothesis test:

Now α = 0.01. Since 0.01 < P-value < 0.025 → P-value > 0.01

Hence the P-value is no longer less than the level of significance.

∴ Since P-value > α = 0.01, 𝐻𝐻0 is rejected NOT at a 1% level of significance.

Thus, a different outcome can occur for a different level of significance.

For a two-tailed t-test, since P-value = 2 × 𝑃𝑃(𝑡𝑡 ≥ 𝑡𝑡0 ), the lower and upper
bounds that 𝑃𝑃 𝑡𝑡 ≥ 𝑡𝑡0 would lie between would be doubled.
Recall from STAT130:

Null Hypothesis 𝐻𝐻0 : 𝜎𝜎 2 = 𝜎𝜎02

Alternative 𝐻𝐻1 : 𝜎𝜎 2 < 𝜎𝜎02 𝐻𝐻1 : 𝜎𝜎 2 > 𝜎𝜎02 𝐻𝐻1 : 𝜎𝜎 2 ≠ 𝜎𝜎02


Hypothesis (left-tailed test) (right-tailed test) (two-tailed test)

𝑛𝑛 − 1 𝑆𝑆 2
with 𝑛𝑛 − 1 degrees
Test statistic 𝜒𝜒02 =
𝜎𝜎02 of freedom

P-value 𝑃𝑃(𝜒𝜒 2 ≤ 𝜒𝜒02 ) 𝑃𝑃(𝜒𝜒 2 ≥ 𝜒𝜒02 ) 2 × 𝑃𝑃(𝜒𝜒 2 ≥ 𝜒𝜒02 )


o Calculating P-values concerning a 𝜒𝜒 2 -test statistic works in the same
manner as that for the 𝑡𝑡-test statistic as the tables are similar.
o Just like the STAT140 t-tables, the STAT140 𝜒𝜒 2 tables also give the area to
the right of a value.
o Recall: A 𝜒𝜒 2 -value has an associated degrees of freedom 𝑑𝑑𝑑𝑑 = 𝑛𝑛 − 1
which is represented in the 1st column of the tables.
o The areas to the right (𝛼𝛼 values) are found in the top row.

𝛼𝛼 = area to the right


These are the areas
i.e. the 𝜒𝜒 2 -tables always
given in the 𝜒𝜒 2 -tables: 1 − 𝛼𝛼 2
give us 𝑃𝑃(𝜒𝜒 2 ≥ 𝜒𝜒𝑛𝑛−1 )
2
𝜒𝜒𝑛𝑛−1;𝛼𝛼
Example 4 ctd: (consider example 4 on slide 18)
A paint manufacturer claims that the average drying time for a new paint
is 2 hours. The drying times in minutes for 20 randomly selected cans of
paint were obtained. The results are shown below.
103 106 109 125 121 118 119 120
112 103 121 126 122 115 116 113

Until recently it was believed that the variance in the drying time is 65.
Suppose it is suspected that this variance has increased. Test this assertion
at the 5% level of significance 𝛼𝛼 = 0.05
Solution:

𝐻𝐻0 : 𝜎𝜎 2 = 65 𝐻𝐻1 : 𝜎𝜎 2 > 65


Recall: 𝑛𝑛 = 16, 𝑆𝑆 = 7.33 minutes 𝛼𝛼 = 0.05

𝐻𝐻0 : 𝜎𝜎 2 = 65 𝜎𝜎02

𝐻𝐻1 : 𝜎𝜎 2 > 65 (right-tailed test)

𝑛𝑛 − 1 𝑆𝑆 2 16 − 1 (7.33)2
2
test statistic: 𝜒𝜒0 = 2 = = 12.399
𝜎𝜎0 65

Now P-value = 𝑃𝑃(𝜒𝜒 2 ≥ 𝜒𝜒02 )

= 𝑃𝑃(𝜒𝜒 2 ≥ 12.399) with 𝑑𝑑𝑑𝑑 = 𝑛𝑛 − 1 = 15

Similar to finding P-values using the t-tables, the 𝜒𝜒 2 -tables can only give us
an approximate for a P-value. Statistical software would have to be used to
find the exact P-value.
To find the P-value:
𝑑𝑑𝑑𝑑 = 15
α = 0.05

P-value = 𝑃𝑃(𝜒𝜒 2 ≥ 𝜒𝜒02 )


= 𝑃𝑃(𝜒𝜒 2 ≥ 12.399)

Using the 𝜒𝜒 2 -table:

∴ 0.1 < P-value < 0.9 8.547 < 12.399 < 22.307

Thus, P-value > 0.05

∴ Since P-value > α = 0.05, 𝐻𝐻0 is NOT rejected at a 5% level of significance.

You might also like