DoE 2
DoE 2
The first step in hypothesis testing that stating the hypotheses in statistical terms.
Actual Situation
Decision
𝐻𝑜 is true 𝐻𝑜 Is False
ത 𝑜
𝑑−𝜇 𝑑ത
• Test Statistic when the sample size less than 30 is 𝑡𝑐𝑎𝑙 = =
𝑆𝑑 2 𝑆𝑑 Τ√𝑛
• However, when the sample size is greater than or equal to 30, then we can approximate the t-distribution by Z-
distribution(using Central Limit Theorem).
ത 𝑜
𝑑−𝜇 𝑑ത
• Thus, the test statistic will be: 𝑍𝑐𝑎𝑙 = =
𝑆𝑑 2 𝑆𝑑 Τ√𝑛
• When the sample size is large enough, we can substitute t α/2 by Z α/2 . That is,
Example 1: As an aid for improving students study habits, nine students were randomly selected to attend a seminar
on the importance of education in life. The table below shows the number of hours each student studied per week
before and after the seminar.
student 1 2 3 4 5 6 7 8 9
before 9 12 6 15 3 18 10 13 7
After 9 17 9 20 2 21 15 22 6
At α = 0:1, did attending the seminar increase the number of hours the students
studied? And Construct a 90% confidence interval for µ d
Solution:
Student 1 2 3 4 5 6 7 8 9
Before 9 12 6 15 3 18 10 13 7
After 9 17 9 20 2 21 15 22 6
Difference(dj) 0 -5 -3 -5 1 -3 -5 -9 1
Step4.Make Decision, Reject the null hypothesis if t < -tα(n - 1) Since -2.52 is less than -1.397,
we reject the null hypothesis at 5% level of significance
Step5. Conclusion: With 90% confidence, we conclude that attending the seminar increase
the number of hours the students studied.
The 90% confidence interval is 𝑑ҧ ± 𝑡 ∝/2 𝑆𝑑 Τ 𝑛 =(-3.11 – 1.73, -3.11 + 1.73)
Independent Sample t-Test
a. Test where the mean number of tapeworms in the stomach of the treated lambs is less than
the mean for untreated lambs at 5% level of significance.
b. Construct 95% CI for the difference in mean to assess the size of the d/c in the two means.
Solution:- The given data is summarized for the two groups as follows.
σ 𝒙𝟏𝒋 𝟏𝟖+𝟒𝟑+⋯𝟕 𝟑𝟏𝟗
ഥ
𝑿𝟏 = = = = 𝟐𝟔. 𝟓𝟖 ഥ 𝟐 = σ 𝒙𝟐𝒊 =𝟒𝟎+𝟓𝟒+⋯+𝟑𝟗=𝟒𝟕𝟕 = 𝟑𝟗. 𝟕𝟓
𝑿
𝒏𝟏 𝟏𝟐 𝟏𝟐 𝒏𝟐 𝟏𝟐 𝟏𝟐
𝒙𝟏𝒋 )𝟐
σ(𝒙𝟏𝒋 −ഥ (𝟏𝟖−𝟐𝟔.𝟓𝟖)𝟐 + ⋯+(𝟕−𝟐𝟔.𝟓𝟖)𝟐 𝒙𝟐𝒋 )𝟐
σ(𝒙𝟐𝒋 −ഥ
𝑺𝟐𝟏 = = = 14.36,𝑺𝟐𝟐 = =
𝒏𝟏 −𝟏 𝟏𝟐−𝟏 𝒏𝟐 −𝟏
(𝟒𝟎−𝟑𝟗.𝟕𝟓)𝟐 + ⋯+(𝟑𝟗−𝟑𝟗.𝟕𝟓)𝟐
=13.86 Check it
𝟏𝟏∗𝟏𝟒.𝟑𝟔+𝟏𝟏∗𝟏𝟑.𝟖𝟔
𝑺𝟐𝒑𝒐𝒐𝒍𝒆𝒅 = =310.42/22=14.11 𝑆𝑝𝑜𝑜𝑙𝑒𝑑 = 14.11 = 3.76
𝟐𝟒−𝟐
𝑥1−𝑥2 26.58−39.75
𝑡𝑐𝑎𝑙 = = =-2.272
1 1 1 1
𝑠𝑝 𝑛1+𝑛2 3.76 +
12 12
Rejection rule:
A 100(1 α)% confidence interval for the difference in means is:
Case 1:𝝈𝟐𝟏 = 𝝈𝟐𝟐
Example 2: A researcher claims that the mean salary of elementary school teachers is greater than the mean
salary of secondary school teachers in a large school district. The mean salaries of a sample of 26 elementary
school teachers is $48,956 and the sample standard deviation is $3,912.40. The mean salaries of a sample of 24
secondary school teachers is $45,633 and the standard deviation is $5,533. Assume that the two populations are
normally distributed with equal standard deviation.
a) At α = 0:05, can it be concluded that the mean salaries of the elementary school teachers is greater than the
mean salaries of the secondary school teachers? b) Construct a 95% confidence interval for µ1 - µ2
Solution:- The same procedure with example two.
• Example 4: The mean age of a sample of 25 people who were playing the slot machines is 48.7 years, and the
standard deviation is 6.8 years. The mean age of a sample of 35 people who were playing roulette is 55.3 with
a standard deviation of 3.2 years.
Assume that the two populations are normally distributed with unequal standard deviation.
a) Can it be concluded at α = 0:05 that the mean age of those playing the slot machines is less than those
playing roulette?
b) Construct a 95% confidence interval for the difference between the mean age of all those playing the slot
• Solution(Class work)
Inference about the Variance of Normal Distribution
• Since variance cannot be negative, we use the chi-square distribution to infer about a population variance.
Rejection rule:
A 100(1 - α)% confidence interval for population variance is:
Example 5: A random sample of 25 customers taken from a certain bank gave the variance of the waiting times
for service is equal to 12.96 square minutes. Assume that the population is normal.
a) Can it be concluded at α = 0:05 that the variance of the waiting times for service of all customers is different
from 7.29 square minutes?
Solution:
a) Given n = 25, σ2 = 12:96, α = 0:05
i. H0 : σ2 = 7:29 Vs H1 : σ2 ≠ 7:29
ii. Since variance cannot be negative, we use the χ2 distribution
24∗12.96 24∗12.96
The 95% confidence interval for σ2 is: , = (7.65, 23.71)
40.65 13.12
• Therefore, the confidence interval support the hypothesis test that the population
variance is different from 7.29.
Hypothesis testing about the ratio of two population variance:
• Use the F-distribution to infer about the ratio of two population variance.
•
Rejection rule:
A 100(1 - α)% confidence interval for the ratio of two population variance can be:
Example 4: Suppose two independent random samples of size 21 and 13 selected from two normally
distributed population. If the first sample produced a standard deviation of 48.1 and the second sample gave a
standard deviation of 89.2 then:
a) Test at 5% significance level if the variances of the two population are equal
b) Construct the 95% confidence interval for the ratio of the two population variances.
Solution:- step 1 State the Hypothesis test
𝑆12 (48.1)2
Step 3 The test statistic F = = = 0.29
𝑆22 (89.2)2
Step4.Decision rule: Reject H0 if F < F1- α /2 (n1 - 1; n2 - 1) or F > Fα/2 (n1 - 1; n2 - 1)
The confidence interval doesn’t contain one, this reveals that the two population variances
are not equal.