You are on page 1of 46

IEM 4103 Quality Control & Reliability Analysis

IEM 5103 Breakthrough Quality & Reliability

Inference about Quality

Instructor: Dr. Chenang Liu


Email: Chenang.Liu@okstate.edu
Outline

 Random Sample and Statistics


 Parameters Estimation
 Hypothesis Testing
 Testing for single sample
 Testing for two samples
 Hypothesis test errors
 Textbook: Chapter 4

1/25/2021

2
What is “Statistical Inference”

 The objective of statistical inference is to draw conclusions or make decisions


about a population based on a sample selected from the population.
 Two aspects: (1) Parameters estimation and (2) Hypothesis testing.

Relationship between a population and a sample


1/25/2021

3
Why we need “Statistical Inference”

 In statistical quality control, the probability distribution is used to model some


quality characteristic (which is related to process parameters).
 In the previous examples, we usually assume the parameters of the probability
distribution or process are known.
 However, this assumption is very unrealistic.
 In general, the parameters of a process are unknown (parameter estimation);
furthermore, they will usually change (hypothesis test) over time.
 Therefore, we need to develop procedures to estimate the parameters of
probability distribution and solve other inference or decision-oriented problems
relative to them.
1/25/2021

4
3.1 Random Sample and Statistics

 In statistical inference, frequently, we will assume that random samples are


used in the analysis.
 Random sample (size 𝑛𝑛):
 Sampling from an infinite population or finite population with replacement: a
sample is selected so that the observations are independently and identically
distributed.
 Sampling from a finite population of 𝑁𝑁 items without replacement: a sample of 𝑛𝑛
𝑁𝑁
items is a random sample if each of the possible samples has an equal
𝑛𝑛
probability of being chosen.

1/25/2021

5
Statistics

 A statistic is defined as any function of the sample data that does not contain
unknown parameters.
 For example, let {𝑥𝑥1 , 𝑥𝑥2 , ⋯ , 𝑥𝑥𝑛𝑛 } represent the observations in a sample. The
sample average or sample mean,
∑𝑛𝑛𝑖𝑖=1 𝑥𝑥𝑖𝑖
𝑥𝑥̅ =
𝑛𝑛
 the sample variance,
∑𝑛𝑛 2
𝑖𝑖=1 (𝑥𝑥𝑖𝑖 − 𝑥𝑥)
̅
𝑠𝑠 2 =
𝑛𝑛 − 1
 are statistics. The statistics 𝑥𝑥̅ and 𝑠𝑠 2 describe the central tendency and variability,
respectively, of the sample.
1/25/2021

6
Sampling distribution

 The probability distribution of a statistic is called a sample distribution.


 Important sampling distribution from a normal distribution:
 chi-square (𝜒𝜒 2 ) distribution
 𝑡𝑡 distribution
 F distribution

 Sampling from a Bernoulli distribution (parameter 𝑝𝑝)


 Sample sum: binomial distribution with parameter (𝑛𝑛, 𝑝𝑝)

 Sampling from a Poisson distribution (parameter 𝜆𝜆)


 Sample sum: Poisson distribution with parameter 𝑛𝑛𝜆𝜆
1/25/2021

7
3.2 Parameters Estimation

 In statistical quality control, the probability distribution is used to describe or


model some critical-to-quality characteristic, such as a dimension of a product.
 Therefore, we are interested in making inferences about the parameters of
probability distributions, i.e., estimate them from sample data.
 Two type of parameters estimation
 Point estimation
 Interval estimation

1/25/2021

8
3.2.1 Point Estimation

 Point estimator: a statistic that produces a single numerical value as the


estimate of the unknown parameter.
 Example: suppose that the mean 𝜇𝜇 and variance 𝜎𝜎 2 of a normal distribution
are both unknown. If a random sample of 𝑛𝑛 observations is taken, then the
sample mean 𝑥𝑥̅ and sample variance 𝑠𝑠 2 are point estimators of the
population mean 𝜇𝜇 and population variance 𝜎𝜎 2 .
 Note: The mean and variance of a distribution are not necessarily the
parameters of the distribution. For example,
 Poisson distribution
 Binomial distribution

1/25/2021

9
Good point estimators

 A number of important properties are required of good estimators. Two of the


most important properties are:
 Unbiased: The expected value of the point estimator should be the parameter being
estimated. For example, under normal distribution, 𝐸𝐸 𝑥𝑥̅ = 𝜇𝜇, 𝐸𝐸 𝑠𝑠 2 = 𝜎𝜎 2
 Minimal variance: Any point estimator is a random variable. Thus, a minimum
variance point estimator should have a variance that is smaller than the variance of
any other (unbiased) point estimator of that parameter.

1/25/2021

10
Useful point estimators

1/25/2021

11
3.2.2 Interval Estimation

 Interval estimator: a random interval (or called confidence interval) in which


the true value of the parameter falls with some level of probability.
 Objective: estimate the interval between two statistics that include the true
value of the parameter with some probability
 Example: 𝑃𝑃 𝐿𝐿 ≤ 𝜇𝜇 ≤ 𝑈𝑈 = 1 − 𝛼𝛼 (0 ≤ 𝛼𝛼 ≤ 1)
 The interval 𝐿𝐿 ≤ 𝜇𝜇 ≤ 𝑈𝑈 is called a 100 1 − 𝛼𝛼 % confidence interval (C.I.) for the
unknown parameter 𝜇𝜇
 Two side C.I.: 𝐿𝐿 is the lower confidence limit, 𝑈𝑈 is the upper confidence limit
 Single side C.I.:
 Lower 100 1 − 𝛼𝛼 % C.I.: 𝜇𝜇 ≥ 𝐿𝐿, 𝑃𝑃 𝜇𝜇 ≥ 𝐿𝐿 = 1 − 𝛼𝛼
 Upper 100 1 − 𝛼𝛼 % C.I.: 𝜇𝜇 ≤ 𝑈𝑈, 𝑃𝑃 𝜇𝜇 ≤ 𝑈𝑈 = 1 − 𝛼𝛼
1/25/2021

12
Example (Demo)

Question?
The relationship between 𝛼𝛼 and width of C.I.?

1/25/2021

13
Example (Application)

 If 𝑥𝑥 is a random variable with unknown mean 𝜇𝜇 and known variance 𝜎𝜎 2 , what


is the estimation interval for mean 𝜇𝜇?
 Select a statistic 𝑥𝑥̅
 The approximate distribution of 𝑥𝑥̅ is 𝑁𝑁(𝜇𝜇, 𝜎𝜎 2 /𝑛𝑛) when 𝑛𝑛 is large regardless of
the distribution of 𝑥𝑥 due to the central limit theorem.
 Given confidence level 𝛼𝛼, then
𝜎𝜎 𝜎𝜎
 100 1 − 𝛼𝛼 % two side C.I on 𝜇𝜇 is: 𝑥𝑥̅ − 𝑧𝑧𝛼𝛼/2 ≤ 𝜇𝜇 ≤ 𝑥𝑥̅ + 𝑧𝑧𝛼𝛼/2
𝑛𝑛 𝑛𝑛
𝜎𝜎
 100 1 − 𝛼𝛼 % upper C.I on 𝜇𝜇 is: 𝜇𝜇 ≤ 𝑥𝑥̅ + 𝑧𝑧𝛼𝛼 𝑛𝑛
Find 𝑧𝑧𝛼𝛼 in textbook
𝜎𝜎
 100 1 − 𝛼𝛼 % lower C.I on 𝜇𝜇 is: 𝜇𝜇 ≥ 𝑥𝑥̅ − 𝑧𝑧𝛼𝛼 𝑛𝑛 appendix II (page 711)

1/25/2021

14
Exercises

 The strength of a disposable plastic beverage container is being investigated.


The strengths are normally distributed, with a known standard deviation of 15
psi. A sample of 20 plastic containers has a mean strength of 246 psi.
Compute a 95% confidence interval for the process mean.

 A chemical process converts lead to gold. However, the production varies due
to the powers of the alchemist. It is known that the process is normally
distributed, with a standard deviation of 2.5g. How many samples must be
taken to be 90% certain that an estimate of the mean process is within 1.5g of
the true but unknown mean yield?

1/25/2021

15
3.3 Hypothesis Testing

 Statistical hypothesis: a statement about the values of the parameters of a


probability distribution.
 Hypothesis testing: Making a hypothesis concerning what we believe to be
true and then use sampled data to test it.
 Two hypotheses (Two competing propositions) Example
 Null Hypothesis 𝐻𝐻0 : will be rejected if the sample data do not support it
 Alternative Hypothesis 𝐻𝐻1 : a hypothesis different from the null hypothesis

 Conclusion:
 By Comparing the Test Statistic with Critical Value (i.e., a threshold value),
determine whether reject or NOT reject the null hypothesis
1/25/2021

16
Procedures

 1) State the null and alternative hypothesis, and define the test statistic.
 2) Specify the significance level 𝛼𝛼.
 3) Find the distribution of the test statistic and the rejection region of 𝐻𝐻0 .
 4) Collect data and calculate the test statistic.
 5) Compare the test statistic with the rejection region.
 6) Assess the risk.

1/25/2021

17
3.3.1 Testing for Single Sample

 Inference on mean
 Variance is known
 Variance in unknown
 Inference on variance

1/25/2021

18
Test population mean if variance is known

 Suppose that 𝑥𝑥 is a random variable with unknown mean 𝜇𝜇 and known variance
𝜎𝜎 2 . Test the hypothesis that the mean is equal to a standard value 𝜇𝜇0 .
 The hypothesis may be formally stated as
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0
𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0
 Test statistic:
𝑥𝑥̅ − 𝜇𝜇0
𝑍𝑍0 =
𝜎𝜎/ 𝑛𝑛
 Reject 𝐻𝐻0 if |𝑍𝑍0 | > 𝑍𝑍𝛼𝛼/2 where 𝑍𝑍𝛼𝛼/2 is the upper 𝛼𝛼/2 percentage point of the
standard normal distribution. It is sometimes called one-sample Z-test.
 Think: How to perform the test if 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 or 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0 ?
1/25/2021

19
Example

 The response time of a distributed computer system is an important quality characteristic.


The system manager wants to know whether the mean response time to a specific type of
command exceeds 75 millisec. From previous experience, he knows that the standard
deviation of response time is 8 millisec. Use 𝛼𝛼 = 0.05. (Textbook example)

1/25/2021

20
Test population mean if variance is unknown

 How to perform the test with same hypothesis if variance is unknown?


 Strategy: As 𝜎𝜎 2 is unknown, it may be estimated by 𝑠𝑠 2 .
 If we replace 𝜎𝜎 by 𝑠𝑠, the test statistic will be
𝑥𝑥̅ − 𝜇𝜇0
𝑡𝑡0 =
𝑠𝑠/ 𝑛𝑛
 The reference distribution for this test statistic is the t distribution with degrees of
freedom.
 𝐻𝐻0 will be rejected if 𝑡𝑡0 > 𝑡𝑡𝛼𝛼,𝑛𝑛−1 , where 𝑡𝑡𝛼𝛼,𝑛𝑛−1 denotes the upper 𝛼𝛼/2 percentage
2 2
point of the 𝑡𝑡 distribution with 𝑛𝑛 − 1 degrees of freedom.

1/25/2021
 Think: How to perform the test if 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0 or 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0 ?
21
Example

 Rubber can be added to asphalt to reduce road noise when the material is used
as pavement. The table shows the stabilized viscosity (cP) of 15 specimens of
asphalt paving material. To be suitable for the intended pavement application,
the mean stabilized viscosity should be equal to 32,00. Test this hypothesis
using 𝛼𝛼 = 0.05. Based on experience we are willing to initially assume that
stabilized viscosity is normally distributed. (Example in textbook)

1/25/2021

22
Example (cont’d)

1/25/2021

23
The use of P-value in hypothesis testing

 Traditional hypothesis testing


 Given 𝛼𝛼 to determine whether the null hypothesis was rejected
 Disadvantage: (1) No information on how close to/far away from the rejection
region in a probability sense ; and (2) predefined 𝛼𝛼 may not reflect different
decision maker’s risk assessments

 P-value approach
 P-value: the smallest level of significance that would lead to rejection of 𝐻𝐻0
 If the predefined 𝛼𝛼 > 𝑃𝑃 = 𝛼𝛼min , reject 𝐻𝐻0
 Underlying idea: “if 𝑯𝑯𝟎𝟎 is really true, is it possible for test statistic to be
such big/small?”

1/25/2021

24
Example: Normal distribution

 If 𝑍𝑍0 is the computed value of the test statistic, then the 𝑃𝑃-value is

 Consider the computer response time problem in the example.


 The computed value of the test statistic is 2.66 and since the alternative
hypothesis is one-tailed, the P-value is 1 − Φ 2.66 = 0.0039.
 Thus, 𝐻𝐻0 : 𝜇𝜇 = 75 would be rejected at any level of significance 𝛼𝛼 ≥ 𝑃𝑃 =
0.0039. For example, 𝐻𝐻0 would be rejected if 𝛼𝛼 = 0.01, but it would not be
rejected if 𝛼𝛼 = 0.001.
1/25/2021

25
Confidence interval & hypothesis testing

 If the value of the parameter specified by the null hypothesis is contained in


the 100(1- 𝛼𝛼)% interval, then the null hypothesis cannot be rejected at the 𝛼𝛼
level.
 If the value specified by the null hypothesis is not in the interval, then the null
hypothesis will be rejected at the 𝛼𝛼 level

1/25/2021

26
Understand the hypothesis testing results

 When we reject the null hypothesis, it is a strong conclusion: there is a strong


evidence that the null hypothesis is false.
 When we fail to reject the null hypothesis, it is a weak conclusion: It does not
mean that the null hypothesis is correct. It only means we do not have strong
evidence to reject it.

1/25/2021

27
Test population variance

 Suppose we wish to test the hypothesis that the variance of a normal


distribution equals a constant—say, 𝜎𝜎02 . The hypotheses are
𝐻𝐻0 : 𝜎𝜎 2 = 𝜎𝜎02
𝐻𝐻1 : 𝜎𝜎 2 ≠ 𝜎𝜎02
What is the
 The test statistic for this hypothesis is distribution of the test
statistic if 𝐻𝐻0 is true?
2
(𝑛𝑛 − 1)𝑠𝑠 2
𝜒𝜒0 =
𝜎𝜎02
 where 𝑠𝑠 2 is the sample variance computed from a random sample of 𝑛𝑛
observations.
the upper 𝛼𝛼/2 and lower 1 − (𝛼𝛼/2)
2 2 percentage points of the chi-square
 Reject 𝐻𝐻0 if 𝜒𝜒02 > 𝜒𝜒𝛼𝛼/2,𝑛𝑛−1 or 𝜒𝜒02 < 𝜒𝜒1−(𝛼𝛼/2),𝑛𝑛−1
distribution with 𝑛𝑛 − 1 degrees of
1/25/2021 freedom
28
Example

 To illustrate this procedure, consider the stabilized viscosity example.


 Objective: Test hypotheses about the variance of viscosity—specifically,
𝐻𝐻0 : 𝜎𝜎 2 = 1002
𝐻𝐻1 : 𝜎𝜎 2 > 1002
 The value of the test statistic is
(𝑛𝑛 − 1)𝑠𝑠 2 (15 − 1)(117.61)2
𝜒𝜒02 = = = 19.38
𝜎𝜎02 1002
 From Appendix Table, the upper 5% value of the chi-square distribution with
2
14 degrees of freedom is 𝜒𝜒0.05,14 = 23.68
 Since the test statistic does not exceed 23.68, we cannot reject 𝐻𝐻0
1/25/2021

29
3.3.2 Testing for Two Samples

 Extend the single sample case of two-sample case (from two


independent populations).
 Inference on means
 Variances are known
 Variances are unknown
 Inference on variances

1/25/2021

30
Difference in means of two samples

 Case 1: If the variances 𝜎𝜎12 and 𝜎𝜎22 are known (table from textbook)

1/25/2021

31
Example

 A product developer is interested in reducing the drying time of a primer paint.


Two formulations of the paint are tested; formulation 1 is the standard
chemistry, and formulation 2 has a new drying ingredient that should reduce
the drying time. From experience, it is known that the standard deviation of
drying time is eight minutes, and this inherent variability should be unaffected
by the addition of the new ingredient. Ten specimens are painted with
formulation 1, and another ten specimens are painted with formulation 2; the
20 specimens are painted in random order. The two sample average drying
times are 𝑥𝑥̅1 = 121 min and 𝑥𝑥̅1 = 112 min, respectively. What conclusions can
the product developer draw about the effectiveness of the new ingredient,
using 𝛼𝛼 = 0.05 (Example in textbook)

1/25/2021

32
Example (cont’d)

1/25/2021

33
Example

 A bakery has a line making Binkies, a big-selling junk food. Another line has
just been installed, and the plant manager wants to know if the output of the
new line is greater than that of the old line, as promised by the bakery
equipment firm. 12 days of data are selected at random from line 1 and 10
days of data are selected at random from line 2, with 𝑥𝑥̅1 = 1124.3 and 𝑥𝑥1̅ =
1138.7. It is known that 𝜎𝜎12 = 52 and 𝜎𝜎22 = 60. Test the appropriate hypotheses
at 𝛼𝛼 = 0.05, given that the outputs are normally distributed.

1/25/2021

34
Difference in means of two samples

 Case 2: If variances are unknown, but assume 𝜎𝜎 2 = 𝜎𝜎12 = 𝜎𝜎22 (equal variances)
 Construct test statistic:
 Combine the two sample variances 𝑠𝑠12 and 𝑠𝑠22 to form an estimator of 𝜎𝜎 2 . The pooled
estimator of 𝜎𝜎 2 is defined as
2 2
𝑛𝑛1 − 1 𝑠𝑠1 + (𝑛𝑛2 − 1)𝑠𝑠2
𝑠𝑠𝑝𝑝2 =
𝑛𝑛1 + 𝑛𝑛2 − 2
 If 𝐻𝐻0 is true, the quantity
𝑥𝑥̅1 − 𝑥𝑥̅2 − (𝜇𝜇1 − 𝜇𝜇2 ) Reject 𝐻𝐻0 if?
𝑡𝑡 =
1 1
𝑠𝑠𝑝𝑝
+
𝑛𝑛1 𝑛𝑛2
 has a 𝑡𝑡 distribution with 𝑛𝑛1 + 𝑛𝑛2 − 2 degrees of freedom.

1/25/2021

35
Two-sample pooled t-test

 Table from textbook

Think:
Do we need the
normal assumption
here?

1/25/2021

36
Example

 Example in textbook
 Two catalysts are being analyzed to
determine how they affect the mean
yield of a chemical process. Specifically,
catalyst 1 is currently in use, but catalyst
2 is acceptable. Since catalyst 2 is
cheaper, it should be adopted, providing
it does not change the process yield. An
experiment is run in the pilot plant and
results in the data shown in the Table. Is
there any difference between the mean
yields? Use 𝛼𝛼 = 0.05 and assume equal
variances.
1/25/2021

37
Example

1/25/2021

38
Example

 Two quality-control technicians measured the surface finish of a metal part,


obtaining the data shown below. Assume that the measurements are normally
distributed.
 Technician 1: 1.45, 1.37, 1.21, 1.54, 1.48, 1.29, 1.34
 Technician 2: 1.54, 1.41, 1.56, 1.37, 1.20, 1.31, 1.27, 1.35

 Assuming that the variances are equal, construct a 95% confidence interval on
the mean difference in surface-finish measurements. Test the hypothesis that
the mean surface finish measurements made by the two technicians are equal.
Use 𝛼𝛼 = 0.05.

1/25/2021

39
Difference in variances of two samples

 Consider testing the hypothesis that the variances of two independent normal
distributions are equal.
 If random samples of sizes 𝑛𝑛1 and 𝑛𝑛2 are taken from populations 1 and 2,
respectively, then the test statistic for
𝐻𝐻0 : 𝜎𝜎12 = 𝜎𝜎22
𝐻𝐻1 : 𝜎𝜎12 ≠ 𝜎𝜎22
 Is simply the ratio of the sample variances,
𝑠𝑠12
𝐹𝐹0 = 2
𝑠𝑠2
 What is the distribution of this test statistic if 𝐻𝐻0 is true?
1/25/2021

40
Cont’d

1/25/2021

41
3.3.3 Hypothesis Test Errors

 Type I error (producer’s risk):


 𝛼𝛼 = 𝑃𝑃 type I error = 𝑃𝑃 reject 𝐻𝐻0 𝐻𝐻0 is true
= 𝑃𝑃 conclude bad although actually good

 Type II error (consumer’s risk):


 𝛽𝛽 = 𝑃𝑃 type II error = 𝑃𝑃 fail to reject 𝐻𝐻0 𝐻𝐻0 is false
= 𝑃𝑃 conclude good although actually bad

 Power of the test:


 Power = 1 − 𝛽𝛽 = P{reject 𝐻𝐻0 |𝐻𝐻0 is false}

1/25/2021

42
Properties of Type I & Type II Errors

 Both types of errors can be reduced by increasing the sample size at the
price of increased inspection costs.
 For a given sample size, one risk can only be reduced at the expense of
increasing the other risk. That is, if 𝛼𝛼 is reduced, then 𝛽𝛽 must be increased.

An example for Type II error

1/25/2021

43
Operating-Characteristic (OC) Curves

 Operating-characteristic (OC) curves are useful in determining how large a


sample is required to detect a specified difference with a particular probability.

Type II error

1/25/2021

44 𝑑𝑑 = |𝛿𝛿|/𝜎𝜎
OC Curves (cont’d)

 The larger the mean shift, the smaller the type II error
 The larger the sample size, the smaller the type II error

1/25/2021

45
Thank you!

Any Questions?

1/25/2021

46

You might also like