You are on page 1of 72

IE-472 Design of Experiments

Fall-21

Course Instructor: Prof. Dr. Misbah Ullah

Assistant Teacher: Engr. Muhammad Nauman


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
Hypothesis Testing

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
• Hypothesis testing or significance testing is a method for testing a
claim or hypothesis about a parameter in a population, using data
measured in a sample.
In this method, we test some hypothesis by determining the likelihood
that a sample statistic could have been selected, if the hypothesis
regarding the population parameter were true.

Definition:
• The null hypothesis, denoted by H0, is the claim that is initially
assumed to be true (the “prior belief” claim).
• The alternative hypothesis, denoted by Ha or H1, is the assertion that
is contradictory to H0.
• The null hypothesis will be rejected in favor of the alternative
hypothesis only if sample evidence suggests that H0 is false. If the
sample does not strongly contradict H0, we will continue to believe in
the plausibility of the null hypothesis.
• The two possible conclusions from a hypothesis testing analysis are
then reject H0 or fail to reject H0.
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
• The alternative to the null hypothesis H0: θ = θ0 will look like one of
the following three assertions

• A test procedure is specified by the following


1. A test statistic, a function of the sample data on which the
decision (reject H0 or do not reject H0) is to be based.
2. A rejection region, the set of all statistic values for which H0 will
be rejected.

• The null hypothesis will then be rejected if and only if the observed or
computed test statistic value falls in the rejection region.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Errors in Hypothesis Testing

Type I Error: consists of rejecting the null hypothesis H0 when it is


true.

Type II Error: involves not rejecting H0 when H0 is false.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Methods used in Hypothesis Testing

1. Traditional Method

2. P-value Method

3. Confidence Interval Method

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Traditional Method

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Steps to follow:
1. State the null and alternative hypotheses.
2. Choose a fixed significance level α.
3. Choose an appropriate test statistic and establish the critical
region based on α.
4. Reject H0 if the computed test statistic is in the critical
region. Otherwise, do not reject.
5. Draw scientific or engineering conclusions.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
P-value Method

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
• A P-value is the probability of obtaining a sample outcome,
given that the value stated in the null hypothesis is true.

• The P- value for obtaining a sample outcome is compared to the


level of significance.

1. P-value ≤ α → reject H0 at level α

2. P-value > α → Do not reject H0 at level α

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Steps to follow:
1. State null and alternative hypotheses.

2. Choose an appropriate test statistic.

3. Compute the P-value based ono the computed value of the


test statistic.

4. Use judgement based on the P-value and knowledge of the


scientific system.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Mean Hypothesis Testing

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
P-Value = TDIST(t0, dof, tails) = Tdist(2.43, 19, 2) = 2.5%
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
One-Side Hypothesis Testing

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Variance Hypothesis Testing

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Two Sample t-Test

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
• Assume that the variances of both populations are identical.
𝜎12 = 𝜎22 = 𝜎 2
• The appropriate test statistic for comparing two treatment means in the
completely randomized design is
𝑦1 − 𝑦2
𝑡0 =
1 1
𝑆𝑝 +
𝑛1 𝑛2
• where 𝑦1 and 𝑦2 are the sample means, 𝑛1 and 𝑛2 are the sample sizes,
𝑆𝑝2 is an estimate of the common variance 𝜎12 = 𝜎22 = 𝜎 2 computed
from
2 2
𝑛 1 − 1 𝑆1 + 𝑛 2 − 1 𝑆2
𝑆𝑝2 =
𝑛1 + 𝑛2 − 2
• and 𝑆12 and 𝑆22 are the two individual sample variance,
1 1
• The quality 𝑆𝑝 + is often called the standard error of the
𝑛1 𝑛2
difference in deviation.
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
• Degree of Freedom = 𝑛1 + 𝑛2 − 2

• The weighted average of the sample variances, called pooled (i.e.


combined estimator of 𝜎 2 . Pooled variance is denoted by 𝑆𝑝2 .

• To determine whether to reject 𝐻0 : 𝜇1 = 𝜇2 , we would compare 𝑡𝑜 to


the t distribution with 𝑛1 + 𝑛2 − 2 degrees of freedom.

• If 𝑡0 > 𝑡𝛼Τ2,𝑛1+𝑛2 −2 , we would reject 𝐻0 and conclude that the


mean strengths of the samples differ. This test procedure is usually
called two-sample t-test.

Note:
• For two-tailed test (non-directional), the alpha is split in half and placed
in each tail of a standard normal distribution.
• A critical value marks the cutoff for the rejection region.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Example:
Modified Mortar Unmodified Mortar
𝑦1 = 16.76 kgf/cm2 𝑦2 = 17.04 kgf/cm2
𝑆12 = 0.100 𝑆22 = 0.061
𝑆1 = 0.316 𝑆2 = 0.248
𝑛1 = 10 𝑛2 = 10

H0 : μ 1 = μ 2

H1: μ1 ≠ μ2

α = 0.05

Degree of Freedom = n1 + n2 – 2 = 18
2 2
2
𝑛 1 − 1 𝑆1 + (𝑛 2 − 1)𝑆2 9 0.100 + 9(0.061)
𝑆𝑝 = = = 𝟎. 𝟎𝟖𝟏
𝑛 1 + 𝑛2 − 2 10 + 10 − 2

𝑆𝑝 = 𝟎. 𝟐𝟖𝟒
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
tα/2, v = t0.025, 18 = 2.101 and –t0.025, 18 = t0.0975, 18 = -2.101

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Computer Solution
Minitab> Stat> Basic Statistics> 2-Sample t…> samples in different
columns (select First column data and then second column data> Check
“Assume equal variance” > OK

Note: (“≠” in the Minitab output implies H1 : µ1 ≠ µ2).


Higher P-value supports null hypothesis. Here P-value is very small. We
reject null hypothesis.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Checking Assumptions in t-Test:
1. Both samples are random samples that are drawn from independent
populations that can be described by a normal distribution.
2. The standard deviation or variances of both populations are equal.

Note: The equal variance and normality assumptions are easy to check
using a normal probability plot.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Note: P-value = TDIST(t0, dof, tails)

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Let

α= 5% = 0.05

t0 = 2.7354

tα= t0.05= 1.746

If t0 > tα we would reject null hypothesis

As 2.7354 > 1.746 we reject null hypothesis and conclude that the
two means are not equal.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
One Sample t-Test

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
If population variance is unknown and we want to test

H0: µ1 = µ0

The sample variance S2 is used to estimate population variance ϭ2. The


test statistic is

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Example: The following sample consists of n=20 observations on
dielectric breakdown voltage of a piece of epoxy resin.
a. We would like to demonstrate that the mean of dielectric breakdown is
equal to 27 days. Set up appropriate hypotheses for investigating this
claim.
b. Test these hypotheses using α= 0.01. What are your conclusions?

Solution: As population variance is unknown and sample size is less than


40, deploy the one sample t-test.

P-value = TDIST(t0, dof, tails) = Tdist(2.43, 19, 2) = 2.5%


Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Two Sample Z-Test

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
One Sample Z-Test

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
• Sometimes it is required to compare sample mean to a pre-defined
(specified) value.
1. Customers DO NOT want to get less than 250 ml of coke liquid in a 250
ml can.
2. If they have been getting less than 250 ml and if they know. What would
be their reactions?

3. Do you mind, if you get more than 250 ml of coke liquid in


a 250 ml can?

• Department of Industrial Engineering


• University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
𝑍𝛼 = 𝑍0.05 = 1.645
Conclusions:
• As |𝑍0 | > 𝑍𝛼
2.800 > 1.645
• Thus 𝐻0 is rejected, and we concluded that the lot average breaking
strengths exceeds 200 psi.

• Department of Industrial Engineering


• University of Engineering & Technology, Peshawar
t-Test & Z-Test

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Two Sample t-Test /Two Sample Z-Test

• If population variance is unknown, use t-test.

• If population variance is known, use z-test.

• If the sample size is large enough that central limit theorem applies.

• Rule of thumb n > 30

• Z₀ is obtained by standardizing 𝑋 − 𝑌, so it has standard normal


distribution.

𝛼12 𝛼22
• 𝛼𝑋−𝑌 = + is standard deviation of 𝑋 − 𝑌.
𝑚 𝑛

• Department of Industrial Engineering


• University of Engineering & Technology, Peshawar
Both tests are identical, if sample size (degree of freedom) approaches
infinity.

• Use z-test, if 𝑛 > 30 and population variance known or unknown.

• Use z-test, if 𝑛 < 30 and population variance known.

• Use t-test, if population variance is unknown and 𝑛 < 30.

• The larger the 𝑑𝑓 is, the more closely the t distribution approximates a
normal distribution.
• Department of Industrial Engineering
• University of Engineering & Technology, Peshawar
Use of t-Test vs Z-Test

Z-Test
• 𝜇 is known:
• 𝑀𝑥 is computed
• 𝜎𝑀 is known (is known)

t-Test
• 𝜇 is hypothesized or predicted (not computed and generally not
known): 𝑀𝑥 is computed
• 𝜎𝑀 is unknown (𝜎 is unknown) : 𝑆𝑀 is computed
• Degrees of freedom (dof) is computed as the one less than the
sample size (the denominator of the standard deviation): 𝑑𝑓 = 𝑛 − 1

• Department of Industrial Engineering


• University of Engineering & Technology, Peshawar
Confidence Interval Method
(CI)

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Confidence Interval
• The interval limits within which the value of the parameter or
parameters in question would be expected to lie are called Confidence
Intervals.
• To define the confidence interval, suppose that θ is an unknown
parameter. To obtain an interval estimate of θ, we need to find two
statistics L and U such that the probability statement
𝑷 𝑳≤𝜽≤𝑼 =𝟏−𝜶

is true. The interval


𝑳≤𝜽≤𝑼

is called a 𝟏𝟎𝟎(𝟏 − 𝜶) percent confidence interval for the parameter


θ.
• The statistics L is called the Lower Confidence Limit and U is called
the Upper Confidence Limit.
• 𝟏 − 𝜶 is called the Confidence Coefficient.
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
• Confidence intervals consist of a range of values (interval) that act as
good estimates of the unknown population parameter.
• A larger sample size normally will lead to a better estimate of the
population parameter.
• A correct interpretation of “95% confidence” relies on the long-run
relative frequency interpretation of probability:
• To say that an event A has probability .95 is to say that if the experiment
on which A is defined is performed over and over again, in the long run A
will occur 95% of the time.
• Suppose we obtain another sample from population and compute
another 95% interval. Then we consider repeating this for a third
sample, a fourth sample, a fifth sample, and so on. Let A be the event
that . Since , in the long run 95% of our computed CIs will contain µ.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
• This is illustrated in figure, where the vertical line cuts the
measurement axis at the true (but unknown) value of µ.
• Note: µ is a constant and sample mean is a random variable.

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Mean Confidence Intervals

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Variance Confidence Intervals

Department of Industrial Engineering


University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar
Department of Industrial Engineering
University of Engineering & Technology, Peshawar

You might also like