Statistical Applications in Engineering Prepared by Dr.
Faramarz Khosravi
One and two sample test of hypothesis
1- Introduction and Definitions
An important part of inferential statistics is hypothesis testing. As with learning anything
related to mathematics, it is helpful to work through several examples.
Often, the problem confronting the scientist of engineer is producing a conclusion about
some scientific theories. For example, researcher may decide on the basis of experimental
evidence whether coffee drinking increases the risk of cancer in humans, or a sociologist
might wish to collect appropriate data to enable him or her to decide whether a person’s
blood type and eye color are independent variables. In addition, each must make use of
experimental data and make a decision based on a data. In each case, the conjecture can be
put in the form of a statistical hypothesis.
Definition: A statistical hypothesis is an assertion or conjecture concerning one or more
populations.
The true or falsity of a statistical hypothesis is never known with absolute certainty unless
we examine the entire population. This, of course, would be impractical in most situations.
Instead, we take a random sample from the population of interest and use the data
contained in this sample to provide evidence that either supports or does not support the
hypothesis. Evidence from the sample which is inconsistent with the stated hypothesis leads
to reject the hypothesis.
Null Hypothesis: Denoted by 𝐻𝐻0 , refers to any hypothesis we wish to test
Alternative Hypothesis: The rejection of 𝐻𝐻0 leads to the acceptance of an alternative
hypothesis, denoted by 𝐻𝐻1
Conclusions: Reject 𝐻𝐻0 in favor of 𝐻𝐻1 because of sufficient evidence in the data or fail to
reject 𝐻𝐻0 because of insufficient evidence in the data
Note that the conclusions do not involve a formal and literal “accept 𝐻𝐻1 ”.
Example: A certain type of cold vaccine is known to be only 25% effective after a period of 2
years. To determine if a new vaccine is superior in providing protection against the same
virus for a longer period of time, suppose that 20 people are chosen at random and
inoculated. If more than 8 of those receiving the new vaccine surpass 2-year period without
contracting the virus, the new vaccine will be considered superior to the one presently in
use.
𝐻𝐻0 : 𝑃𝑃 = 0.25
𝐻𝐻1 : 𝑃𝑃 > 0.25
61
2- The test statistic
The test statistic on which we base our decision is X, the number of individuals in our test
group who receive protection from the new vaccine for a period of at least 2 years. The
possible values possible values of X, from 0 to 20, are divided into two groups: those
numbers less than or equal to 8 and those greater than 8. All possible scores greater than 8,
constitute the critical region. The last number that we observe in passing into the critical
region is called the critical value. In our illustration, the critical value is the number 8.
Therefore, if 𝑥𝑥 > 8, we reject 𝐻𝐻0 in favor of the alternative hypothesis 𝐻𝐻1 . If 𝑥𝑥 ≤ 8, we fail to
reject 𝐻𝐻0 . This decision criterion is illustrated in the figure.
The decision procedure could lead to either of two wrong conclusions. For instance, the new
vaccine may be no better than the one now in use (𝐻𝐻0 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡) and yet, in this particular
randomly selected group of individuals, more than 8 surpass the 2-year period without
contracting the virus. We would be committing an error by rejecting 𝐻𝐻0 in favor of 𝐻𝐻1 when,
in fact, 𝐻𝐻0 is true. Such an error is called a type I error.
Definition: rejection of the null hypothesis when it is true is called a type I error.
A second kind of error is committed if 8 or fewer of the group surpass the 2-year period
successfully and we are unable to conclude that the vaccine is better when it actually is
better (𝐻𝐻1 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡). Thus, in this case, we fail to reject 𝐻𝐻0 when in fact 𝐻𝐻0 in fact. This is called
type II error.
Definition: Non-rejection of the null hypothesis when it is false is called a type II error.
𝐻𝐻0 𝑖𝑖𝑖𝑖 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝐻𝐻0 𝑖𝑖𝑖𝑖 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓
𝐷𝐷𝐷𝐷 𝑛𝑛𝑛𝑛𝑛𝑛 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0 Correct decision Type II error = 𝛽𝛽
𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 𝐻𝐻0 Type I error = 𝛼𝛼 Correct decision
The probability of type I error(𝜶𝜶):
20
𝛼𝛼 = 𝑝𝑝(𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝐼𝐼 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒) = 𝑝𝑝(𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 𝐻𝐻0 /𝐻𝐻0 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡) = 𝑝𝑝�𝑥𝑥 > 8 𝑤𝑤ℎ𝑒𝑒𝑒𝑒 𝑝𝑝 = 1�4� = � 𝑏𝑏(𝑥𝑥, 20, 1�4)
𝑥𝑥=9
8
= 1 − � 𝑏𝑏�𝑥𝑥, 20, 1�4�
𝑥𝑥=0
20 10 1 20−0 20 11 1 20−1 20 18 1 20−8
= 1 − �� � �1 − � + � � �1 − � + ⋯ + � � �1 − � �
0 4 4 1 4 4 8 4 4
= 1 − 0.9591 = 0.0409
62
The probability of a type II error(𝜷𝜷):
The probability of committing a type II error, denoted by 𝜷𝜷, is impossible to compute unless
we have a specific alternative hypothesis. If we test the null hypothesis that 𝑝𝑝 = 0.25
against the alternative hypothesis that 𝑝𝑝 = 0.5, them we are able to compute the
probability of not rejecting 𝐻𝐻0 when it is false, in this case
𝛽𝛽 = 𝑝𝑝(𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝐼𝐼𝐼𝐼 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒) = 𝑝𝑝(𝐹𝐹𝐹𝐹𝐹𝐹𝐹𝐹 𝑡𝑡𝑡𝑡 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0 / 𝐻𝐻0 𝑖𝑖𝑖𝑖 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓) = 𝑝𝑝�𝑥𝑥 ≤ 8 𝑤𝑤ℎ𝑒𝑒𝑒𝑒 𝑝𝑝 = 1�2�
8
= � 𝑏𝑏(𝑥𝑥, 20, 1�2)
𝑥𝑥=0
20 10 1 20−0 20 11 1 20−1 20 18 1 20−8
= �� � �1 − � + � � �1 − � + ⋯ + � � �1 − � �
0 2 2 1 2 2 8 2 2
= 0.2517
Definition: the power of a test is the probability of rejecting 𝐻𝐻0 given that a specific
alternative is true. The power of a test can be computed as 1 − 𝛽𝛽.
In the above example, power of the test is: 1 − 𝛽𝛽 = 1 − 0.2517 = 0.7483
How to Avoid Errors
Type I and type II errors are part of the process of hypothesis testing. Although the errors
cannot be completely eliminated, we can minimize one type of error.
Typically, if we try to decrease the probability one type of error, the probability for the other
type increases.
We could decrease the value of alpha from 0.05 to 0.01, corresponding to a 99% level of
confidence. However, if everything else remains the same, then the probability of a type II
error will nearly always increase.
Many times the real world application of our hypothesis test will determine if we are more
accepting of type I or type II errors. This will then be used when we design our statistical
experiment.
3- One and two tailed tests
A test of any statistical hypothesis is called a one-tailed test where the alternative is one
sided
, such as:
𝐻𝐻0 : 𝜃𝜃 = 𝜃𝜃0
�
𝐻𝐻1 : 𝜃𝜃 > 𝜃𝜃0 𝑜𝑜𝑜𝑜 𝜃𝜃 < 𝜃𝜃0
63
A test of any statistical hypothesis is called a two-tailed test where the alternative is two
sided, such as:
𝐻𝐻 : 𝜃𝜃 = 𝜃𝜃0
� 0
𝐻𝐻1 : 𝜃𝜃 ≠ 𝜃𝜃0
Example: a manufacturer of a certain brand of rice cereal claims that the average saturated
fat content does not exceed 1.5 grams per serving. State the null and alternative hypothesis.
𝐻𝐻 : 𝜇𝜇 = 1.5
� 0
𝐻𝐻1 : 𝜇𝜇 > 1.5
Example: A real estate agent claims that 60% of all private residences being built today are
3-bedroom homes. To test this claim, a large sample of new residences is inspected; the
proportion of these homes with 3-bedrooms is recorded and used as the test statistic. State
the null and alternative.
𝐻𝐻 : 𝑃𝑃 = 0.6
� 0
𝐻𝐻1 : 𝑃𝑃 ≠ 0.6
4- The Use of P-Value for Decision Making in Testing Hypothesis
For hypothesis testing, if we use statistical packages like SPSS or Minitab. Result of that
software only gives use P-Value.
According to definition, P-value is the smallest amount of probability that leads us to
reject 𝐻𝐻0 . It means that:
If 𝑝𝑝 − 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 < 𝛼𝛼 then 𝐻𝐻0 will be rejected
If 𝑝𝑝 − 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 > 𝛼𝛼 then 𝐻𝐻0 will not be rejected
Approach to Hypothesis Testing with Fixed Probability of Type I Error
- State the null and alternative hypothesis
- Choose a fixed significance level 𝛼𝛼
- Choose an appropriate test statistic and establish the critical region based on 𝛼𝛼
- Reject 𝐻𝐻0 if the computed test statistic is in the critical region. Otherwise, do not
reject
- Draw scientific or engineering conclusions
Significance Testing (P-Value Approach)
- State null and alternative hypothesis
- Choose an appropriate test statistic
- Compute the P-value based on the computed value of the test statistic
- Use judgment based on the P-value and knowledge of the scientific system
64
5- Single Sample: Tests Concerning a Single Mean (Variance Known)
In this section, we formally consider tests of hypothesis on a single population mean
𝑥𝑥̅ − 𝜇𝜇
𝑝𝑝 �−𝑧𝑧𝛼𝛼�2 < 𝜎𝜎 < 𝑧𝑧𝛼𝛼�2 � = 1 − 𝛼𝛼
� 𝑛𝑛
√
𝑥𝑥̅ −𝜇𝜇
𝑧𝑧 = 𝜎𝜎 If −𝑧𝑧𝛼𝛼�2 < 𝑧𝑧 < 𝑧𝑧𝛼𝛼�2 , do not reject 𝐻𝐻0 , rejection of 𝐻𝐻0 , implies acceptance of the
� 𝑛𝑛
√
alternative hypothesis 𝜇𝜇 ≠ 𝜇𝜇0
Tests of one-sided hypothesis:
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0 𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0
𝐼𝐼𝐼𝐼 𝑧𝑧 > 𝑧𝑧𝛼𝛼 𝐼𝐼𝐼𝐼 𝑧𝑧 < 𝑧𝑧𝛼𝛼
𝐼𝐼𝐼𝐼 𝛼𝛼 > 𝑃𝑃 − 𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉, 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0 𝐼𝐼𝐼𝐼 𝛼𝛼 > 𝑃𝑃 − 𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉, 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
Example: A random sample of 100 recorded deaths in the United States during the past
year showed an average life span of 71.8 years. Assuming a population standard deviation of
8.9 years, does this seem to indicate that the mean life span today is greater than 70 years?
Use a 0.05 level of significance. 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
𝐻𝐻0 : 𝜇𝜇 = 70 𝑥𝑥̅ −𝜇𝜇 71.8−70
1- � 2 − 𝛼𝛼 = 0.05 3 − 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟: 𝑧𝑧 > 1.645, 𝑧𝑧 = 𝜎𝜎 = = 2.02
𝐻𝐻1 : 𝜇𝜇 > 70 � 𝑛𝑛
√
8.9/√100
Fail to reject 𝐻𝐻0
Critical region, reject 𝐻𝐻0
Critical point=1.645
4 − 𝑜𝑜𝑜𝑜𝑜𝑜 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑖𝑖𝑖𝑖 𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟, 𝑠𝑠𝑠𝑠 𝑤𝑤𝑤𝑤 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
5 − 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐: 𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 𝑖𝑖𝑖𝑖 𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔𝑔 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 70 𝑦𝑦𝑦𝑦𝑦𝑦𝑦𝑦𝑦𝑦
𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑝𝑝(𝑧𝑧 > 2.02) = 1 − 𝑝𝑝(𝑧𝑧 < 2.02) = 1 − 0.9778 = 0.0222
Example: A manufacturer of sports equipment has developed a new synthetic fishing line
that the company claims has a mean breaking strength of 8 kilograms with a standard
deviation of 0.5 kilogram. Test the hypothesis that 𝜇𝜇 = 8 kilograms against the alternative
that 𝜇𝜇 ≠ 8 kilograms if a random sample of 50 lines is tested and found to have a mean
breaking strength of 7.8 kilograms. Use a 0.01 level of significance. 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
65
𝐻𝐻0 : 𝜇𝜇 = 8
1− � 2: 𝛼𝛼 = 0.01 3: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟: 𝑧𝑧 < −2.575, 𝑧𝑧 > 2.575
𝐻𝐻1 : 𝜇𝜇 ≠ 8
𝑥𝑥̅ −𝜇𝜇 7.8−8
𝑧𝑧 = 𝜎𝜎 = 0.5 = −2.83
� 𝑛𝑛
√ √50
Fail to reject 𝐻𝐻0
Critical regions reject 𝐻𝐻0
Critical point=-2.575
4: 𝑜𝑜𝑜𝑜𝑜𝑜 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑖𝑖𝑖𝑖 𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟, 𝑠𝑠𝑠𝑠 𝑤𝑤𝑤𝑤 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
5: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐: 𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑖𝑖𝑖𝑖 𝑛𝑛𝑛𝑛𝑛𝑛 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑡𝑡𝑡𝑡 8 𝑎𝑎𝑎𝑎𝑎𝑎 𝑖𝑖𝑖𝑖 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 8 𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘
𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑝𝑝(𝑧𝑧 < −2.83) + 𝑝𝑝(𝑧𝑧 > 2.83) = 2𝑝𝑝(𝑧𝑧 < −2.83) = 2(0.0023) = 0.0046
66
6- The t statistic for a test on a single mean (Variance Unknown)
For the two sided hypothesis
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0
𝑥𝑥̅ −𝜇𝜇.
We reject 𝐻𝐻0 at significance level of 𝛼𝛼 when the computed t-statistic 𝑡𝑡 = 𝑠𝑠 exceeds
� 𝑛𝑛
√
𝑡𝑡𝛼𝛼�2,𝑛𝑛−1 or is less than −𝑡𝑡𝛼𝛼�2,𝑛𝑛−1
Example: The Edison Electric Institute has published figures on the number of kilowatt hours
used annually by various home appliances. It is claimed that a vacuum cleaner uses an
average of 46 kilowatt hours per year. If a random sample of 12 homes included in a planned
study indicates that vacuum cleaners use an average of 42 kilowatt hours per year with a
standard deviation of 11.9 kilowatt hours, does this suggest at the 0.05 level of significance
that vacuum cleaners use, less than 46 kilowatt hours annually? Assume the population of
kilowatt hours to be normal. 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
𝐻𝐻0 : 𝜇𝜇 = 46 𝑥𝑥̅ −𝜇𝜇 42−46
1− � 2: 𝛼𝛼 = 0.05 3: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟: 𝑧𝑧 < −1.796, 𝑡𝑡 = 𝑠𝑠 = 11.9 = −1.16
𝐻𝐻1 : 𝜇𝜇 < 46 � 𝑛𝑛
√ √12
t
Fail to reject 𝐻𝐻0
Critical region, reject 𝐻𝐻0
Critical point=-1.796
4: 𝑜𝑜𝑜𝑜𝑜𝑜 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑖𝑖𝑖𝑖 𝑛𝑛𝑛𝑛𝑛𝑛 𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟, 𝑠𝑠𝑠𝑠 𝑤𝑤𝑤𝑤 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑡𝑡𝑡𝑡 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
5: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐: vacuum cleaners use an average of 46 kilowatt hours per year
𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑝𝑝(𝑡𝑡 < −1.16) = 0.0046
𝑡𝑡 𝑝𝑝𝑡𝑡
1.088 ∆𝑡𝑡𝑠𝑠 0.15
∆𝑡𝑡𝐵𝐵 1.16 ∆𝑝𝑝𝑠𝑠 𝑝𝑝1.16 ∆𝑝𝑝𝐵𝐵
1.363 0.10
∆𝑡𝑡𝐵𝐵 ∆𝑝𝑝𝐵𝐵 1.088 − 1.363 0.15 − 0.10 0.275 0.05
� �=� �→� �=� �→ =
∆𝑡𝑡𝑆𝑆 ∆𝑝𝑝𝑆𝑆 1.088 − 1.16 0.15 − 𝑝𝑝1.16 0.072 0.15 − 𝑝𝑝1.16
(0.072)(0.05)
0.15 − 𝑝𝑝1.16 = = 0.013 → 𝑝𝑝1.16 = 0.15 − 0.013 = 0.137
0.275
67
7- Two samples: tests on two Means with known variances
Two independent random samples of sizes 𝑛𝑛1 and 𝑛𝑛2 , respectively, are drown from two populations
with means 𝜇𝜇1 and 𝜇𝜇2 and variances 𝜎𝜎12 and 𝜎𝜎22 .
(𝑥𝑥̅1 − 𝑥𝑥̅2 ) − (𝜇𝜇1 − 𝜇𝜇2 )
𝑧𝑧 =
𝜎𝜎12 𝜎𝜎22
� +
𝑛𝑛1 𝑛𝑛2
𝐻𝐻0 : 𝜇𝜇1 − 𝜇𝜇2 = 𝑑𝑑0
𝐻𝐻1 : 𝜇𝜇1 − 𝜇𝜇2 ≠ 𝑑𝑑0
Example: The mean lasting time of two competing floor waxes is to be compared. Twenty floors are
randomly assigned to test each wax. Both populations have a normal distributions. The data are
recorded in the table.
Wax Sample Mean Number of Population Standard
Months Floor Wax Lasts Deviation
1 3 0.33
2 2.9 0.36
Does the data indicate that wax 1 is more effective than wax 2? Test at a 0.05 level of significance.
𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
𝐻𝐻0 : 𝜇𝜇1 − 𝜇𝜇2 = 0
1− � 2: 𝛼𝛼 = 0.05
𝐻𝐻1 : 𝜇𝜇1 − 𝜇𝜇2 > 0
(𝑥𝑥̅1 −𝑥𝑥̅ 2 )−(𝜇𝜇1 −𝜇𝜇2 ) (3−2.9)−0
3: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟: 𝑧𝑧 > 1.645, 𝑧𝑧 = = 2 2
= 0.92
𝜎𝜎2 𝜎𝜎2 �0.33 +0.36
� 1+ 2 20 20
𝑛𝑛1 𝑛𝑛2
Fail to reject 𝐻𝐻0
Critical region, reject 𝐻𝐻0
Critical point=1.645
4: 𝑜𝑜𝑜𝑜𝑜𝑜 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑖𝑖𝑖𝑖 𝑛𝑛𝑛𝑛𝑛𝑛 𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟, 𝑠𝑠𝑠𝑠 𝑤𝑤𝑤𝑤 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
5: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐: 𝑊𝑊𝑊𝑊𝑊𝑊 1 𝑖𝑖𝑖𝑖 𝑛𝑛𝑛𝑛𝑛𝑛 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑤𝑤𝑤𝑤𝑤𝑤 2
𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑝𝑝(𝑧𝑧 > 0.92) = 1 − 𝑝𝑝(𝑧𝑧 < 0.92) = 1 − 0.8212 = 0.1788
68
8- Two samples: tests on two Means with unknown but equal variances
Two independent random samples of sizes 𝑛𝑛1 and 𝑛𝑛2 , respectively, are drown from two populations
with means 𝜇𝜇1 and 𝜇𝜇2 and sample variances 𝑠𝑠12 and 𝑠𝑠22 .
𝐻𝐻0 : 𝜇𝜇1 − 𝜇𝜇2 = 𝑑𝑑0
𝐻𝐻1 : 𝜇𝜇1 − 𝜇𝜇2 ≠ 𝑑𝑑0
(𝑥𝑥̅1 − 𝑥𝑥̅2 ) − 𝑑𝑑0 (𝑛𝑛1 − 1)𝑠𝑠12 + (𝑛𝑛2 − 1)𝑠𝑠22
𝑡𝑡 = 𝑠𝑠𝑝𝑝2 =
1 1 𝑛𝑛1 + 𝑛𝑛2 − 2
𝑠𝑠𝑝𝑝 � +
𝑛𝑛1 𝑛𝑛2
69
Example: An experiment was performed to compare the abrasive wear of two different laminated
materials. 12 pieces of material 1 were tested by exposing each peace to a machine measuring wear.
10 pieces of material 2 were similarly tested. In each case, the depth of wear was observed. The
samples of material 1 gave an average wear of 85 units with a sample standard deviation of 4, while
the samples of material 2 gave an average of 81 with a sample standard deviation of 5. Can we
conclude at the 0.05 level of significance that the abrasive wear of material 1 exceeds that of
material 2 by more than 2 units? Assume that the populations to be approximately normal with
equal variances.
𝐻𝐻0 : 𝜇𝜇1 − 𝜇𝜇2 = 2 (𝑛𝑛1 −1)𝑠𝑠12 +(𝑛𝑛2 −1)𝑠𝑠22 (12−1)42 +(10−1)52
1− � 2: 𝛼𝛼 = 0.05 𝑠𝑠𝑝𝑝2 = = = 20.05
𝐻𝐻1 : 𝜇𝜇1 − 𝜇𝜇2 > 2 𝑛𝑛1 +𝑛𝑛2 −2 12+10−2
(𝑥𝑥̅1 −𝑥𝑥̅ 2 )−𝑑𝑑0 (85−81)−2
3: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟: 𝑡𝑡 > 1.725, 𝑡𝑡 = 1 1
= 1 1
= 1.04
𝑠𝑠𝑝𝑝 � + 4.478� +
𝑛𝑛1 𝑛𝑛2 12 10
Fail to reject 𝐻𝐻0
Critical region, reject 𝐻𝐻0
Critical point=1.725
4: 𝑜𝑜𝑜𝑜𝑜𝑜 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑖𝑖𝑖𝑖 𝑛𝑛𝑛𝑛𝑛𝑛 𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟, 𝑠𝑠𝑠𝑠 𝑤𝑤𝑤𝑤 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑡𝑡𝑡𝑡 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝐻𝐻0
5: 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐: 𝑊𝑊𝑊𝑊 𝑎𝑎𝑎𝑎𝑎𝑎 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢 𝑡𝑡𝑡𝑡 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑡𝑡ℎ𝑒𝑒 𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎𝑎 𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑜𝑜𝑜𝑜 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 1 𝑒𝑒𝑒𝑒𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑡𝑡ℎ𝑎𝑎𝑎𝑎
𝑜𝑜𝑜𝑜 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 2 𝑏𝑏𝑏𝑏 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 2 𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢𝑢.
𝑝𝑝_𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 = 𝑝𝑝(𝑡𝑡 < −1.04) = 0.17
𝑡𝑡 𝑝𝑝𝑡𝑡
0.86 ∆𝑡𝑡𝑠𝑠 0.20
∆𝑡𝑡𝐵𝐵 ∆𝑝𝑝𝑠𝑠 𝑝𝑝1.04 ∆𝑝𝑝𝐵𝐵
1.04
1.064 0.15
∆𝑡𝑡𝐵𝐵 ∆𝑝𝑝𝐵𝐵 1.064 − 0.86 0.20 − 0.15 0.204 0.05
� �=� �→� �=� �→ =
∆𝑡𝑡𝑆𝑆 ∆𝑝𝑝𝑆𝑆 1.04 − 0.86 0.20 − 𝑝𝑝1.04 0.13 0.20 − 𝑝𝑝1.04
(0.13)(0.05)
0.20 − 𝑝𝑝1.04 = = 0.03 → 𝑝𝑝1.16 = 0.20 − 0.03 = 0.17
0.204
70
9- Two samples: tests on two Means with unknown but unequal variances
Two independent random samples of sizes 𝑛𝑛1 and 𝑛𝑛2 , respectively, are drown from two populations
with means 𝜇𝜇1 and 𝜇𝜇2 and sample variances 𝑠𝑠12 and 𝑠𝑠22 .
𝐻𝐻0 : 𝜇𝜇1 − 𝜇𝜇2 = 𝑑𝑑0
𝐻𝐻1 : 𝜇𝜇1 − 𝜇𝜇2 ≠ 𝑑𝑑0
𝑠𝑠 2 𝑠𝑠 2
(𝑥𝑥̅1 − 𝑥𝑥̅2 ) − 𝑑𝑑0 ( 1 + 2 )2
𝑛𝑛 𝑛𝑛2
𝑡𝑡 = 𝑣𝑣 = 2 1
𝑠𝑠 𝑠𝑠 2
𝑠𝑠12 𝑠𝑠22 ( 1 )2 ( 2 )2
� + 𝑛𝑛1 𝑛𝑛
𝑛𝑛1 𝑛𝑛2 + 2
𝑛𝑛1 − 1 𝑛𝑛2 − 1
The test procedure is to not reject 𝐻𝐻0 when −𝑡𝑡𝛼𝛼� < 𝑡𝑡 < 𝑡𝑡𝛼𝛼�2,𝑛𝑛−1
2,𝑛𝑛−1
71