0% found this document useful (0 votes)
44 views63 pages

H-311 Statistical Quality Control With R

The document discusses statistical quality control using R. It contains 20 problems demonstrating the construction of various control charts like X-bar & R charts, P charts, C charts, U charts, and acceptance sampling plans. Each problem contains sample data, instructions to create the control charts manually and using R packages, and interpretation of the results. The overall document serves as a teaching guide for applying statistical process control methods in R.

Uploaded by

Nat Boltu
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)
44 views63 pages

H-311 Statistical Quality Control With R

The document discusses statistical quality control using R. It contains 20 problems demonstrating the construction of various control charts like X-bar & R charts, P charts, C charts, U charts, and acceptance sampling plans. Each problem contains sample data, instructions to create the control charts manually and using R packages, and interpretation of the results. The overall document serves as a teaching guide for applying statistical process control methods in R.

Uploaded by

Nat Boltu
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/ 63

STATISTICAL QUALITY CONTROL WITH R

Md. Mostakim

Session: 2018-19

Department Of Statistics

University Of Dhaka

Published Date:

1st Published: June, 2022

Acknowledgements:

I would like to acknowledge our course teacher Ahsan Rahman Jamee Sir for teaching us
industrial statistics so beautifully. This is just a tiny reflection of Sir's guidance.

N.B. You may share this pdf book as much as you like but don’t use it for any unethical purpose.

For any kind of feedback please contact to [email protected]. Your feedback will be very inspiring for me.
Table of Contents
Introduction: ................................................................................................................................................. 4

Problem 01: X-bar & R Chart ................................................................................................................... 6

Problem 02: X-bar & R Chart ................................................................................................................ 10

Problem 03: X-bar & R Chart ................................................................................................................ 14

Problem 04: X-bar & R Chart ................................................................................................................ 18

Problem 05: X-bar & R Chart ................................................................................................................ 22

Problem 06: X-bar, S & R Chart ........................................................................................................... 27

Problem 07: X-bar & R Chart ................................................................................................................ 31

Problem 08: P-Chart ................................................................................................................................ 35

Problem 09: P-Chart ................................................................................................................................ 37

Problem 10: P-Chart ................................................................................................................................ 41

Problem 11: C-Chart ................................................................................................................................ 43

Problem 12: U-Chart................................................................................................................................ 45

Problem 13: Specification Limits ....................................................................................................... 47

Problem 14: Single Sampling Plan ..................................................................................................... 50

Problem 15: Single Sampling Plan ..................................................................................................... 55

Problem 16: Single Sampling Plan ..................................................................................................... 55

Problem 17: Double Sampling Plan ................................................................................................... 56

Problem 18: Double Sampling Plan ................................................................................................... 62

Problem 19: Double Sampling Plan ................................................................................................... 62

Problem 20: In-course Question 2022 ............................................................................................. 62

References: .................................................................................................................................................. 63
Introduction:

Statistical quality control (SQC) is the application of statistical techniques and tools for
measuring and improving the quality of processes. Various statistical tools and method
were used to maintain the quality in a continuous flow of manufactured products.

Process Control Control Chart


Statistical Quality
Control
Sampling Inspection
Product Control
Plan
Problem 01: X-bar & R Chart

Considering the data on thickness of disks sample of size 4 are drawn every hour and their
thickness in units are recorded as,

Construct a control chart for mean and range without and with package. Also, interpret the
result.

Answer:

i.

Constructing control chart for mean and range without package(manually):

Reading the data:

> s1<-c(14,8,12,12)
s2<-c(11,10,13,8)
s3<-c(11,12,16,13)
s4<-c(15,12,14,11)
s5<-c(10,10,8,8)
data<-rbind(s1,s2,s3,s4,s5)

Constructing X-bar chart manually:


> xbar<-rowMeans(data) #Calculating x-bar for each sample
xdblbar<-mean(xbar) #Calculating x double bar
r<-apply(data,1,function(data)max(data)-min(data)) #Calculating range for each sample
rbar<-mean(r) #calculating r-bar
A2<-0.729 #Selecting A2 for sample size 4 from QCC table

UCL<-xdblbar+A2*rbar #Calculating UCL for mean


CL<-xdblbar #Calculating CL for mean
LCL<-xdblbar-A2*rbar #Calculating LCL for mean
c(UCL,CL,LCL) #Result of UCL,CL,LCL for mean
> ## [1] 14.6076 11.4000 8.1924

Therefore upper, center, lower control limit for mean is 14.6076, 11.4000, 8.1924
respectively.

Drawing X-bar chart manually:

> plot(1,type="n",main="X-bar chart for thickness",sub="Figure 1.1: X-bar chart for thickness", xlab="
Sample Number",ylab="Sample Mean",xlim=c(1,5),ylim=c(LCL-3,UCL+3)) #Creating an empty plot
points(1:5,xbar) #Plotting the points of xbar in the graph
lines(1:5,xbar) #Drawing line through the points
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red")) #Drawing horizontal line of UCL,CL,LCL in the gr
aph
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line
Calculating UCL, CL, LCL for range manually:

> ###Constructing R chart manually:


D3<-0 #Selecting D3 for sample size 4 from QCC table
D4<-2.282 #Selecting D4 for sample size 4 from QCC table
UCL<-D4*rbar #Calculating UCL for range
CL<-rbar #Calculating CL for range
LCL<-D3*rbar #Calculating LCL for range
c(UCL,CL,LCL) #Result of UCL,CL,LCL for range
> ## [1] 10.0408 4.4000 0.0000

Therefore, UCL, CL, LCL for range is 10.0408, 4.4000, 0.0000 respectively.

Constructing R-chart manually:

> plot(1:5,r,main="R chart for thickness",sub="Figure 1.2: R chart for thickness", xlab="Sample Numb
er",ylab="Sample Range",xlim=c(1,5),ylim=c(LCL-3,UCL+3))
lines(1:5,r) #Drawing line through the points
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red")) #Drawing horizontal line of UCL,CL,LCL in the gr
aph
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line
Constructing control chart for mean and range with package:

> library(qcc) #Reading the library


> qcc(data,type = "xbar")

> qcc(data,type = "R")

Interpretation:

From the above X-bar chart and R-chart we can see that the sample means and ranges
corresponding to all the subgroups fall inside the control limit. So, the process is in
statistical control.
Problem 02: X-bar & R Chart

The given data represents 10 subgroups of five measurements on the critical dimension of
a part produced by a machining process.

Data set download link: Data set

Construct control chart for mean and range with and without package(manually). Also,
interpret the result.

Answer:

Constructing control chart for mean and range without package:

Reading Data set:

> data<-read.table("D:/Mostakim/Data set/Industrial/Problem 2.txt",header=T)


data<-data[,c(-1,-7,-8)] #Removing 1st,7th,8th column

Finding UCL,CL,LCL for xbar chart manually:


> xbar<-rowMeans(data)
xdblbar<-mean(xbar)
r<-apply(data,1,function(data) max(data)-min(data))
rbar<-mean(r)

A2<-0.577 #Selecting value of A2 for n=5 from table


CL<-xdblbar
UCL<-CL+A2*rbar
LCL<-CL-A2*rbar
c(UCL,CL,LCL) #Result of Xbar chart
> ## [1] 150.64393 119.43400 88.22407

Therefore, UCL, CL, LCL for mean is 150.64393, 119.43400, 88.22407 respectively.

Constructing X-bar chart manually:

> plot(1:10,xbar,type="b",main="X-bar chart for critical dimension",sub="Figure 2.1: X-bar chart for c
ritical dimension",xlab="Sample Number",ylab="Sample Mean",xlim=c(1,10),ylim=c(LCL-2,UCL+2)) #
Creating plot with both points and lines
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))
Finding UCL,CL,LCL for range:

> D3<-0 #Selecting D3 for n=5


D4<-2.114 #Selecting D4 for n=5

UCL<-D4*rbar
CL<-rbar
LCL<-D3*rbar
c(UCL,CL,LCL) #Result of R-bar chart
> ## [1] 114.3463 54.0900 0.0000

Therefore, UCL, CL, LCL for range is 114.3463, 54.0900, 0.0000 respectively.

Constructing R-chart manually:

> plot(1:10,r,type ="o",main="R chart for critical dimension",sub="Figure 2.2: R chart for critical dime
nsion", xlab="Sample Number",ylab="Sample Range",xlim=c(1,10),ylim=c(LCL-2,UCL+2)) #Creating pl
ot with overplotted points and lines

abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))

Constructing control chart for mean and range with package:

> qcc(data,type="xbar",sizes = 5)
> qcc(data,type="R",sizes=5)

Interpretation:

From the above charts we can see that all the points fall inside the control limits however
points on the X-bar and R chart tend to cluster around the center line, warranting further
investigation. This may be an indication of assignable causes of variation which can be
traced and eliminated.
Problem 03: X-bar & R Chart

A hospital emergency department is monitoring the time required to admit a patient using
X-bar and 𝑅 charts. The given table presents the summary data for 20 subgroups of two
patients each (time is in minutes).

a) Use these data to determine the control limits for the X-bar and 𝑅 control charts for
this patient admitting process.
b) Plot the preliminary data from first 20 samples on the control charts that were set
up in (a). Is the process in statistical control?

Answer:

Constructing control chart for mean and range without package(manually):

Reading the data:

> xbar<-c(8.3,8.1,7.9,6.3,8.5,7.5,8.0,7.4,6.4,7.5,8.8,9.1,5.9,9,6.4,7.3,5.3,7.6,8.1,8)
r<-c(2,3,1,5,3,4,3,2,2,4,3,5,3,6,3,3,2,4,3,2)
subgroup<-1:20
data<-data.frame(subgroup,xbar,r)
Calculating UCL,CL,LCL for mean:

> xdblbar<-mean(xbar) #Calculating x double bar


rbar<-mean(r) #calculating r-bar
A2<-1.880 #Selecting A2 for sample size 2 from QCC table

UCL<-xdblbar+A2*rbar
CL<-xdblbar
LCL<-xdblbar-A2*rbar
c(UCL,CL,LCL) #Result of UCL,CL,LCL for mean
> ## [1] 13.492 7.570 1.648

Therefore, the UCL, CL, LCL for mean is 13.492, 7.570, 1.648 respectively.

Constructing X-bar chart manually:

> plot(1:20,xbar,type="b",main="X-bar chart for patient time",sub="Figure 3.1: X-bar chart for patient
time", xlab="Sample Number",ylab="Sample Mean",xlim=c(1,20),ylim=c(LCL-3,UCL+3))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))
Calculating UCL,CL,LCL for range:

> D3<-0 #Selecting D3 for sample size 2 from QCC table


D4<-3.267 #Selecting D4 for sample size 2 from QCC table

UCL<-D4*rbar #Calculating UCL for range


CL<-rbar #Calculating CL for range
LCL<-D3*rbar #Calculating LCL for range
c(UCL,CL,LCL) #Result of UCL,CL,LCL for range
> ## [1] 10.29105 3.15000 0.00000

And the UCL, CL, LCL for range is 10.29105, 3.15000, 0.00000 respectively.

Constructing R chart manually:

> plot(1:20,r,type="b",main="R chart for patient time",sub="Figure 3.2: R chart for patient time", xlab
="Sample Number",ylab="Sample Range",xlim=c(1,20),ylim=c(LCL-3,UCL+3))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))

.
Constructing control chart for mean and range with package:

> q<-qcc(xbar,type = "xbar.one",std.dev = "SD")

> qcc(r,type = "xbar.one")

Therefore, the UCL, CL, LCL for mean is 10.746, 7.570, 4.394 respectively.

And the UCL, CL, LCL for range is 7.349, 3.15000, -1.049 respectively.
[N.B. The result of package doesn’t match with manual calculation!! Why! Think yourself!]

Interpretation: There is no indication of an out-of-control condition on the X-bar and R-


chart, indicating that the process variability is in statistical control. However point on the
X-bar chart tend to cluster around the center line, warranting further investigation. This
may be a sign that the limits were calculated incorrectly, or that the within sample
variability poorly estimates the process variability perhaps due to mixed underlying
distributions.

Problem 04: X-bar & R Chart

The data given below are x-bar and R values for 24 samples of size n = 5 taken from a
process producing bearings. The measurements are made on the inside diameter of the
bearing, with only the last three decimals recorded (i.e., 34.5 should be 0.50345).

Data set link: Problem 4

a. Set up and R charts on this process. Does the process seem to be in statistical
control? If necessary, revise the trial control limits.

Answer:

Reading the data:

> data<-read.table("D:/Mostakim/Data set/Industrial/Problem 4.txt",header=T)

Calculating UCL,CL,LCL for mean:


> xdblbar<-mean(data$xbar) #Calculating x double bar
rbar<-mean(data$R) #calculating r-bar
A2<-0.577 #Selecting A2 for sample size 5 from QCC table

UCL<-xdblbar+A2*rbar
CL<-xdblbar
LCL<-xdblbar-A2*rbar
c(UCL,CL,LCL) #Result of UCL,CL,LCL for mean
> ## [1] 36.72088 34.00417 31.28746

Therefore, the UCL, CL, LCL for mean is 36.72088, 34.00417, 31.28746 respectively.

Constructing X-bar chart manually:

> plot(1:24,data$xbar,type="b",main="X-bar chart for bearings",sub="Figure 4.1: X-bar chart for beari
ngs", xlab="Sample Number",ylab="Sample Mean",xlim=c(1,24),ylim=c(LCL-3,UCL+3))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))
Calculating UCL,CL,LCL for range:

> D3<-0 #Selecting D3 for sample size 5 from QCC table


D4<-2.114 #Selecting D4 for sample size 5 from QCC table

UCL<-D4*rbar #Calculating UCL for range


CL<-rbar #Calculating CL for range
LCL<-D3*rbar #Calculating LCL for range
c(UCL,CL,LCL) #Result of UCL,CL,LCL for range
> ## [1] 9.953417 4.708333 0.000000

And the UCL, CL, LCL for range is 9.953417, 4.708333, 0.000000 respectively.

Constructing R chart manually:

> plot(1:24,data$R,type="b",main="R chart for bearings",sub="Figure 4.2: R chart for bearings", xlab="
Sample Number",ylab="Sample Range",xlim=c(1,24),ylim=c(LCL-3,UCL+3))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))
From the X-bar chart we can see that x-bar is beyond the upper control limit for both
Sample No. 12 and Sample No. 15. Assuming an assignable cause is found for these two out-
of-control points, the two samples can be excluded from the control limit calculations.

Revised trial control limits:

> datanew<-data[c(-12,-15),]
xdblbar<-mean(datanew$xbar) #Calculating x double bar
rbar<-mean(datanew$R) #calculating r-bar
A2<-0.577 #Selecting A2 for sample size 5 from QCC table

UCL<-xdblbar+A2*rbar
CL<-xdblbar
LCL<-xdblbar-A2*rbar
c(UCL,CL,LCL) #Result of UCL,CL,LCL for mean
> ## [1] 36.25105 33.65455 31.05805

The new process UCL,CL,LCL for mean is 36.25105, 33.65455, 31.05805.

> D3<-0 #Selecting D3 for sample size 5 from QCC table


D4<-2.114 #Selecting D4 for sample size 5 from QCC table

UCL<-D4*rbar #Calculating UCL for range


CL<-rbar #Calculating CL for range
LCL<-D3*rbar #Calculating LCL for range
c(UCL,CL,LCL) #Result of UCL,CL,LCL for range
> ## [1] 9.513 4.500 0.000

The new process UCL,CL,LCL for range is 9.513, 4.500, 0.000.


Problem 05: X-bar & R Chart

The thickness of a printed circuit board is an important quality parameter. Data on board
thickness (in inches) are given in below for 25 samples of three board each.

Data set link: Problem 5

(a) Set up x-bar and 𝑅 control charts without and with package. Is the process in
statistical control?
(b) Estimate the process standard deviation.
(c) What are the limits that you would expect to contain nearly all the process
measurements?

Answer:

Constructing X-bar without package:

> #Reading Data Set


data<-read.table("D:/Mostakim/Data set/Industrial/Problem 5.txt",header = TRUE)
head(data,3)
> ## SampleNumber x1 x2 x3
## 1 1 0.0629 0.0636 0.0640
## 2 2 0.0630 0.0631 0.0622
## 3 3 0.0628 0.0631 0.0633
> data<-data[,-1]
#Constructing X-bar chart manually:
xbar<-apply(data,1,mean)
r<-apply(data,1,function(data)max(data)-min(data))
xdblbar<-mean(xbar)
rbar<-mean(r)
CL<-xdblbar
A2<-1.023
UCL<-CL+A2*rbar
LCL<-CL-A2*rbar
c(UCL,CL,LCL) #Result of UCL,CL,LCL for Xbar-chart
> ## [1] 0.06389316 0.06295200 0.06201084
Therefore UCL,CL,LCL for X-bar is 0.06389316, 0.06295200, 0.06201084

Constructing X-bar chart manually:

> plot(1,type="n",main="X-bar chart for thickness",sub="Figure 5.1: X-bar chart for thickness",xlab="
Sample Number",ylab="Sample mean",xlim=c(1,25),ylim=c(LCL,UCL))
points(1:25,xbar)
lines(1:25,xbar)
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels=c("UCL","CL","LCL"))

Calcualting UCL,CL,LCL for range:

> #Constructing R-chart manually:


D4<-2.574
D3<-0
CL<-rbar
UCL<-D4*rbar
LCL<-D3*rbar
c(UCL,CL,LCL) #Result of UCL,CL,LCL for R-chart
> ## [1] 0.00236808 0.00092000 0.00000000

Therefore UCL,CL,LCL for range is 0.00236808, 0.00092000, 0.00000000


Constructing R-chart manually:

> plot(1:25,r,type="b",main="R chart for thickness",sub="Figure 5.2: R chart for thickness",xlab="Sam


ple number",ylab="Sample Range",xlim=c(1,25),ylim=c(LCL,UCL))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),label=c("UCL","CL","LCL"))

Constructing X bar and R chart with package:

> qcc(data,type="xbar",sizes=3)
> qcc(data,type="R",sizes=3)

Interpretation:

From the above charts we can see that sample 15 and 22 is out of control limit. Therefore
the process is out-of-control, failing tests on both the x-bar and the R charts which indicates
there is assignable causes which can be traced and eliminated.

> datanew<-data[c(-15,-22),] #Removing sample 22 and 15 from the data set.


qcc(datanew,type = "xbar",sizes = 3)

With the revised limits, sample 14 is also out-of-control on the x chart.


> datanew<-data[c(-14,-15,-22),] #Removing all three samples from the data.
qcc(datanew,type="R",sizes = 3)

> qcc(datanew,type="xbar",sizes=3)

> d2<-1.693 #Selecting d2 for sample size 3 from QCC table


> (sd<-0.000823/d2) #Estimate of the process standard deviation
> ## [1] 0.0004861193

Therefore the process standard deviation is 0.0004859582


c.

Natural tolerance limits are: xdoublebar±3*sd.

> 0.06295+3*sd #Upper limit of natural tolerance limit


> ## [1] 0.06440836
> 0.06295-3*sd #Lower limit of natural tolerance limit
> ## [1] 0.06149164

Therefore natural tolerance limits are: [0.061492,0.064408]. So [0.061492,0.064408] is the


limits that I would expect to contain nearly all the process measurements.

Problem 06: X-bar, S & R Chart

The fill volume of soft-drink beverage bottles is an important quality characteristic. The
volume is measured (approximately) by placing a gauge over the crown and comparing the
height of the liquid in the neck of the bottle against a coded scale. On this scale, a reading of
zero corresponds to the correct fill height. Fifteen samples of size n = 10 have been
analyzed, and the fill heights are given in “Fill_height.txt” file.

File link: Fill_height.txt

a) Set up x-bar and S control charts without and with package. Is the process in
statistical control? If necessary, construct revised control limits.
b) Set up an R chart, and compare it with the S chart in part (a)
Answer:

> data<-read.table("D:/Mostakim/Data set/Industrial/Fill_height.txt",header = TRUE)


head(data,3)
data<-data[,-1] #Removing 1st column from the data

Calculating UCL,CL,LCL for x-bar chart with standard deviation manually:

> xbar<-rowMeans(data)
xdblbar<-mean(xbar)
std<-apply(data,1,sd)
sdbar<-mean(std)
A3<-0.975 #Selecting value of A2 for n=10 from table
CL<-xdblbar
UCL<-CL+A3*sdbar
LCL<-CL-A3*sdbar
c(UCL,CL,LCL) #Result of Xbar chart
> ## [1] 1.036221259 -0.003333333 -1.042887925

Therefore UCL,CL,LCL for x-bar is 1.036221259, -0.003333333, -1.042887925

X- bar Chart: Try yourself!

Calculating UCL,CL,LCL for S chart manually:

> B4<-1.716 #selecting B4 for n=10 from table.


B3<-0.284 #selecting B3 for n=10 from table.
UCL<-B4*sdbar
CL<-sdbar
LCL<-B3*sdbar
c(UCL,CL,LCL)
> ## [1] 1.8296161 1.0662098 0.3028036

Therefore UCL,CL,LCL for S chart is 1.8296161, 1.0662098, 0.3028036.

S-chart: Try yourself!

Constructing x-bar chart and s-chart with package:

> qcc(data,type="xbar",std.dev = "UWAVE-SD",sizes=10) #X-bar chart wth standard deviation method


> qcc(data,type = "S",sizes=10) #S-chart

The process is in statistical control, with no out-of-control signals, runs, trends, or cycles.

Constructing X-bar and R-chart with package:

> qcc(data,type="xbar",sizes=10)
> qcc(data,type="R",sizes=10)

The process is in statistical control, with no out-of-control signals, runs, trends, or cycles.
There is no difference in interpretation from the x − s chart.
Problem 07: X-bar & R Chart

Use ‘boiler’ data from ‘qcc’ package to answer the following questions:

(a) Obtain x-bar and R chart without and with package.

(b) Comment if the process in statistical control or not.

Answer:

Constructing X-bar and R chart without package:

Calculating UCL,CL,LCL for x-bar chart manually:

> data("boiler")
data<-boiler
dim(data)
> ## [1] 25 8
> head(data,3) #Showing some of the data
> ## t1 t2 t3 t4 t5 t6 t7 t8
## 1 507 516 527 516 499 512 472 477
## 2 512 513 533 518 502 510 476 475
## 3 520 512 537 518 503 512 480 477
> xbar<-rowMeans(data) #Calculating x-bar for each sample
xdblbar<-mean(xbar) #Calculating x double bar
r<-apply(data,1,function(data)max(data)-min(data)) #Calculating range for each sample
rbar<-mean(r) #calculating r-bar
A2<-0.373 #Selecting A2 for sample size 8 from QCC table

UCL<-xdblbar+A2*rbar #Calculating UCL for mean


CL<-xdblbar #Calculating CL for mean
LCL<-xdblbar-A2*rbar #Calculating LCL for mean
c(UCL,CL,LCL) #Result of UCL,CL,LCL for mean
> ## [1] 532.4041 508.9200 485.4359

UCL,CL,LCL for x-bar is 532.4041, 508.9200, 485.4359


Constructing X-bar without package:

> plot(1:25,xbar,type="b",main="X-bar chart for temperature",sub="Figure 7.1: X-bar chart for tempe
rature", xlab="Sample Number",ylab="Sample Mean",xlim=c(1,25),ylim=c(LCL,UCL)) #Creating an e
mpty plot
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red")) #Drawing horizontal line of UCL,CL,LCL in the gr
aph
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line

Calculating UCL,CL,LCL for range manually:

> D3<-0.136 #Selecting D3 for sample size 8 from QCC table


D4<-1.864 #Selecting D4 for sample size 8 from QCC table

UCL<-D4*rbar #Calculating UCL for range


CL<-rbar #Calculating CL for range
LCL<-D3*rbar #Calculating LCL for range
c(UCL,CL,LCL) #Result of UCL,CL,LCL for range
> ## [1] 117.35744 62.96000 8.56256

UCL,CL,LCL for range is 117.35744, 62.96000, 8.56256


Constructing R chart:

> plot(1:25,r,type="b",main="R chart for temperature",sub="Figure 7.2: R chart for temperature", xla
b="Sample Number",ylab="Sample Range",xlim=c(1,25),ylim=c(LCL,UCL)) #Creating an empty plot
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red")) #Drawing horizontal line of UCL,CL,LCL in the gr
aph
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line

Constructing X-bar and R chart with package:

> qcc(data,type = "xbar")


> qcc(data,type = "R")

From the above charts we can see that points tend to cluster around the center line,
warranting further investigation. In R-chart there is also 7 consecutive points above the
center line. This may be an indication of assignable causes of variation which can be traced
and eliminated. Therefore, the process is not in statistical control.
Problem 08: P-Chart

A process produces rubber belts in lots of size 2500. Inspection records on the last 20 lots
reveal the data in the given table.

(a) Compute trial control limits for a fraction nonconforming control chart with and
without package.
(b) If you wanted to set up a control chart for controlling future production, how would
you use these data to obtain the center line and control limits for the chart?

Answer:

Since the data set represents number of defective items we have to construct P-chart.

Calculating control limits for a fraction nonconforming control chart without package:

> ###Reading the dataset:


sample<- 1:20
D<-c(230, 435, 221, 346, 230, 327, 285, 311, 342, 308, 456, 394, 285, 331, 198, 414, 131, 269, 221, 407)
size <- rep(2500, times=20)
data<-data.frame(sample,D,size)
Calculation of UCL,CL,LCL:

> n<-2500 #Defining lots of size,n


p<-D/2500 #Calculating Pi for each sample
pbar<-sum(p)/20 #Calculating p-bar
CL<-pbar #Calculating CL for p-chart
UCL<-pbar+3*sqrt((pbar*(1-pbar)/n)) #Calculating UCL for p-chart
LCL<-pbar-3*sqrt((pbar*(1-pbar)/n)) #Calculating LCL for p-chart
c(UCL,CL,LCL) #Result of UCL,CL,LCL
> ## [1] 0.1425138 0.1228200 0.1031262

UCL,CL,LCL for P-chart is 0.1425138, 0.1228200, 0.1031262.

Constructing P-chart

> plot(1:20,p,type="b",main="P chart for Nonconforming Belts",sub="Figure 8: P chart for Nonconfor


ming Belts", xlab="Sample Number",ylab="Fraction defective ",xlim=c(1,20),ylim=c(LCL-.05,UCL+.05)
) #Creating an empty plot
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red")) #Drawing horizontal line of UCL,CL,LCL in the gr
aph
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line
Calculating control limits for a fraction nonconforming control chart with package:

> qcc(D,type = "p", sizes = 2500)

Interpretation:

From the above chart we can see that 11 out of 20 subgroups are out of control, so the
process is not in control. These points must be investigated to see whether an assignable
cause can be determined.

Data should not be used since many subgroups are out of control.

Problem 09: P-Chart

The data set given in “prc5.txt” stored in Data set folder in D drive represent the results of
inspecting all units of a personal computer produced for the past ten days. Does the process
appear to be in statistical control? Data set download link: prc5.txt
Answer:

Since the data set represents number of defective items with variable sample size we have
to construct P-chart.

Constructing P-chart without package:

> ###Reading the data set:


data<-read.table("D:/Mostakim/Data set/Industrial/prc5.txt",header = TRUE)
sample<-1:10
p<-data$d/data$n #Calculating Pi for each sample
pbar<-sum(data$d)/sum(data$n) #Calculating P-bar

CL<-pbar
CL #Result of CL
> ## [1] 0.06
> UCL<-pbar+3*sqrt((pbar*(1-pbar)/data$n)) #Calculating UCL for each Sample
LCL<-pbar-3*sqrt((pbar*(1-pbar)/data$n)) #Calculating LCL for each sample
cdata<-data.frame(data,p,UCL,LCL) #Creating data set with value of P, UCL, LCL
cdata #Showing complete data set for P-chart
> ## Sample n d p UCL LCL
## 1 1 80 4 0.05000000 0.1396555 -0.019655508
## 2 2 110 7 0.06363636 0.1279304 -0.007930446
## 3 3 90 5 0.05555556 0.1350999 -0.015099933
## 4 4 75 8 0.10666667 0.1422679 -0.022267855
## 5 5 130 6 0.04615385 0.1224869 -0.002486922
## 6 6 120 6 0.05000000 0.1250385 -0.005038450
## 7 7 70 4 0.05714286 0.1451553 -0.025155320
## 8 8 125 5 0.04000000 0.1237244 -0.003724407
## 9 9 105 8 0.07619048 0.1295290 -0.009529028
## 10 10 95 7 0.07368421 0.1330969 -0.013096908
Constructing P-Chart for the above data set:

> plot(1:10,p,type="b",main="P-chart for non-conforming units",sub="Figure 9: P-chart for non-confo


rming units", xlab="Sample Number",ylab="Conforming Units",xlim=c(1,10),ylim=c(min(LCL)-.05,ma
x(UCL)+.05)) #Creating an empty plot
segments(x0=0:9,x1=1:10,y0=UCL,y1=UCL,col = "Red") #Drawing UCL for each sample
segments(x0=1:9,x1=1:9,y0=UCL[1:9],y1=UCL[2:10],col="Red")
segments(x0=0:9,x1=1:10,y0=LCL,y1=LCL,col = "Red") #Drawing LCL for each sample
segments(x0=1:9,x1=1:9,y0=LCL[1:9],y1=LCL[2:10],col="Red")
abline(h=CL,col="Green") #Drawing CL
axis(4,at=c(max(UCL),CL,min(LCL)),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line

Alternative easy procedure of constructing P-Chart for the above data set:

> plot(1:10,p,type="b",main="P-chart for non-conforming units",sub="Figure 9: P-chart for non-confo


rming units", xlab="Sample Number",ylab="Conforming Units",xlim=c(1,10),ylim=c(min(LCL)-.05,ma
x(UCL)+.05)) #Creating an empty plot
lines(UCL,type="s",col="red") #Drawing individual UCL for p-chart
abline(h=CL,col="Green") #Drawing CL
abline(h=0,col="red")
axis(4,at=c(max(UCL),CL,0),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line
Interpretation:

Since every point falls into the control limit, we can say that the process appears to be in
statistical control.

Constructing P-chart with package:

> p_chart <- with(data, qcc(data$d, data$n, type = "p", data.name = "data"))
Problem 10: P-Chart

A maintenance group improves the effectiveness of its repair work by monitoring the
number of maintenance requests that require a second call to complete the repair. Twenty
weeks of data are shown in the below table. Data set link: Problem 10

a. Find trial control limits for this process.

b. Design a control chart for controlling future production.

Answer:

Since the data set represents number of defective items we have to construct P-chart.

Constructing p-chart with variable sample size manually:

> data<-read.csv("D:/Mostakim/Data set/Industrial/Problem 10.csv")


head(data,3)
> ## Week Total_Requests Second_Visit_Required
## 1 1 200 6
## 2 2 250 8
## 3 3 250 9
> colnames(data)<-c("sample","n","d")
Pi<-data$d/data$n
pbar<-sum(data$d)/sum(data$n) #Calculating p-bar or CL
CL<-pbar
UCL<-pbar+3*sqrt((pbar*(1-pbar))/data$n)
LCL<-pbar-3*sqrt((pbar*(1-pbar))/data$n)
cdata<-data.frame(data,Pi,UCL,LCL)
head(cdata) #Showing some data with UCL, LCL
> ## sample n d Pi UCL LCL
## 1 1 200 6 0.030000000 0.05334159 -0.009074922
## 2 2 250 8 0.032000000 0.05004685 -0.005780179
## 3 3 250 9 0.036000000 0.05004685 -0.005780179
## 4 4 250 7 0.028000000 0.05004685 -0.005780179
## 5 5 200 3 0.015000000 0.05334159 -0.009074922
## 6 6 200 4 0.020000000 0.05334159 -0.009074922
Constructing p-chart:

> plot(1:20,Pi,type="b",main="P-chart for second visits",sub="Figure 10: P-chart for second visits", xla
b="Sample Number",ylab="Second visits",xlim=c(1,20),ylim=c(min(LCL),max(UCL))) #Creating an e
mpty plot
lines(UCL,type="s",col="red") #Drawing individual UCL for p-chart
abline(h=CL,col="Green") #Drawing CL
abline(h=0,col="red")
axis(4,at=c(max(UCL),CL,0),labels = c("UCL","CL","LCL")) #Labeling the UCL,CL,LCL line

Constructing p-chart with package:

> qcc(data$d,type = "p",sizes = data$n)


Problem 11: C-Chart

Surface defects have been counted on 25 rectangular steel plates, and the data are shown
below. Data set link: Problem 11

Set up a control chart for nonconformities using these data. Does the process producing the
plates appear to be in statistical control?

Answer:

Since the data set represents number of defects per unit with constant sample size, we have
to construct C-chart.

Constructing C-chart without package:

> data<-read.table("D:/Mostakim/Data set/Industrial/Problem 11.txt",header=TRUE)

> cbar<-sum(data$Number_of_Nonconformities)/25
CL<-cbar
UCL<-CL+3*sqrt(CL)
LCL<-CL-3*sqrt(CL)
c(UCL,CL,LCL)
> ## [1] 6.968687 2.360000 -2.248687
> LCL<-0 #Since LCL<0, it can be taken as 0

Therefore UCL,CL,LCL for c-chart is 6.968687, 2.360000, 0


Constructing C-chart:

> plot(1:25,data$Number_of_Nonconformities,type="b",main="C-chart for non-conformities on Plate",s


ub="Figure 11: P-chart for non-conformities on Plate", xlab="Sample Number",ylab="Conformities"
,xlim=c(1,25),ylim=c(min(LCL)-3,max(UCL)+3))
abline(h=c(UCL,CL,LCL),col=c("Red","Green","Red"))
axis(4,at=c(UCL,CL,LCL),labels = c("UCL","CL","LCL"))

Constructing C-chart with package:

> qcc(data$Number_of_Nonconformities,type="c")

No, the process is not in statistical control.


Problem 12: U-Chart

A paper mill uses a control chart to monitor the imperfection in finished rolls of paper.
Production output is inspected for 20 days, and the resulting data are shown below. Use
these data to set up a control chart for nonconformities per roll of paper. Does the process
appear to be in statistical control?

Answer:

Since the data set represents number of defects per unit with variable sample size, we have
to construct U-chart. Constructing U-chart without package:

> data<-read.table("D:/Mostakim/Data set/Industrial/Problem 12.txt",header = T)


head(data,3)
> ## Day Number_of_Rolls_Produced Total_Number_of_Imperfections
## 1 1 18 12
## 2 2 18 14
## 3 3 24 20
> Ui<-data$Total_Number_of_Imperfections/data$Number_of_Rolls_Produced
ubar<-sum(data$Total_Number_of_Imperfections)/sum(data$Number_of_Rolls_Produced)
CL<-ubar
UCL<-ubar+3*sqrt(ubar/data$Number_of_Rolls_Produced)
LCL<-ubar-3*sqrt(ubar/data$Number_of_Rolls_Produced)

Constructing U-chart:
> cdata<-data.frame(data,Ui,UCL,LCL) #Complete data set with Ui,UCL,LCL
> plot(1:20,Ui,type="b",main="U-chart for paper imperfections",sub="Figure 12: U-chart for paper imperf
ections", xlab="Sample Number",ylab="paper imperfections",xlim=c(1,20),ylim=c(min(LCL),max(UCL)))
lines(UCL,type = "s",col="red")
lines(LCL,type = "s",col="red")
abline(h=CL,col="Green")
axis(4,at=c(max(UCL),CL,min(LCL)),labels = c("UCL","CL","LCL"))

Constructing U-chart with qcc package:

> qcc(data$Total_Number_of_Imperfections,type = "u",sizes = data$Number_of_Rolls_Produced)

The process appears to be in statistical control.


Problem 13: Specification Limits

Refers to problem 03, if the specification limits are (7.50 ± 1.50) what can you say about
the process?

Answer:

The limits that are desired and fixed by the customer are known as specification limits.

Calculating specification limits:

> 7.50 + 1.50 #Maximum of specification limits


> ## [1] 9
> 7.50 - 1.50 #Minimum of specification limits
> ## [1] 6

That means specification limits are (6,9)

Now calculating natural tolerance limits for comparing:

> xbar<-c(8.3,8.1,7.9,6.3,8.5,7.5,8.0,7.4,6.4,7.5,8.8,9.1,5.9,9,6.4,7.3,5.3,7.6,8.1,8)
r<-c(2,3,1,5,3,4,3,2,2,4,3,5,3,6,3,3,2,4,3,2)
subgroup<-1:20
data<-data.frame(subgroup,xbar,r)
6*sd(data$xbar)
> ## [1] 6.269022

Here specified tolerance (9-6)=3 which is less than natural tolerance 6.269.

So, we can say about the process that the production of an appreciable quantity of goods
not conforming to specifications is unavoidable. A slight shift of process average will
increase the percent defective. Thus, a re-adjustment of the process is advisable with
respect to either the process average or process dispersion or both.

Let’s plot the x-bar with specification limits:

> plot(1:20,xbar,type="b")
abline(h=c(6,9))
With specification limits we can see that the process is out of control. Therefore, a
readjustment of the process is advisable with respect to process average.
Formulas for single sampling plan and double sampling plan:

Single Sampling Plan: Double Sampling Plan


Problem 14: Single Sampling Plan

From a lot consisting of 2200 items, a sample of size 225 is taken. If it contains 14 or less
defectives, the lot is accepted otherwise rejected.

a. Plot the OC, ATI and AOQ curves. Hence, find AOQL and interpret it.

b. Plotting different OC curves discuss how OC curve changes as the acceptance number(c)
changes.

Answer:

a.

Here, we have a single sampling plan characterized by 𝑁 = 2200, 𝑛 = 225 and 𝑐 = 14. Using
Poisson approximation to hyper-geometric distribution, the operating characteristics (OC)
curve i.e., the probability of acceptance 𝑃𝑎 is given as,

Constructing OC curve with poisson:

> N<-2200
n<-225
p<-seq(0.01,0.99,by=0.01) #p=probability of finding a defective. Setting various fraction defective (fracti
on defective means the number of units per 100 pieces which are defective in a lot; expressed as a decima
l)
lambda<-n*p #Mean of the poisson distribution
pa<-ppois(14,lambda) #Probability of acceptance of the lot
OC<-plot(p,pa, type="l", lwd=2,xlim=c(0,0.12), main="Operating Characteristics Curve", xlab="Fractio
n Defective", ylab="Acceptance Probability")
Another method of constructing OC curve with binomial:

> p<-seq(0.01,0.99,by=0.01)
pa<-pbinom(14,n,p)
OC<-plot(p,pa, type="l", lwd=2,xlim=c(0,0.12), main="Operating Characteristics Curve", xlab="Fractio
n Defective", ylab="Acceptance Probability")
legend("topright",c("n=225","c=14"))
The OC curve shows the discriminatory power of the sampling plan i.e when fraction
defective is low acceptance probability is high which means that sampling plan is good. For
example, in the sampling plan n = 225, c = 14

> pbinom(14,225,0.1)
> ## [1] 0.03165764

which means that if the lots are 10% defective (fraction defective), the probability of
acceptance is approximately 0.03. This means that if 100 lots from a process that
manufactures 10% defective product are submitted to this sampling plan, we will expect to
accept 3 of the lots and reject 97 of them.

Average total inspection (ATI) is defined as,

The average amount of inspection required for the rectifying inspection plans(=the
inspection of the rejected lots and replacing the defective items found in the rejected lots
by the good ones eliminates the no. of defective in the lot to a great extent and improves the
quality of the lot.), called average total inspection (ATI).

Plotting ATI:

> ati<-n+(N-n)*(1-pa)
ATI_curve<-plot(p,ati, type="l", lwd=2,xlim=c(0,0.12), main="ATI Curve", xlab="Fraction Defective", yl
ab="ATI")
ATI is average number of units inspected over many lots with fraction defective, p.

Average outgoing quality (AOQ) is defined as,

The average outgoing quality is the quality in the lot that results from the application of
rectifying inspection. It is the average value of lot quality that would be obtained over a
long sequence of lots from a process with fraction defective p.

Plotting AOQ:

> aoq<-(p*pa*(N-n))/N
AOQ_curve<-plot(p,aoq, type="l", lwd=2,xlim=c(0,0.12), main="AOQ Curve", xlab="Fraction Defective",
ylab="AOQ")
max(aoq) #Find ing AOQL
> ## [1] 0.03773897
> abline(h=max(aoq),lwd=2) #Drawing AOQL
axis(4,at=max(aoq),labels = "AOQL")

AOQL: The maximum ordinate on the AOQ curve represents the worst possible average
quality that would result from the rectifying inspection program, and this point is called the
average outgoing quality limit (AOQL).
In the above graph, AOQL is seen to be approximately 0.037 which means that no matter
how bad the fraction defective is in the incoming lots, the outgoing lots will never have a
worse quality level on the average than 3.7% defective.

b.

Plotting OC curves for different acceptance numbers:

> n<-225
p<-seq(0.01,0.99,by=0.01)
pa1<-ppois(1,n*p)
pa2<-ppois(2,n*p)
pa3<-ppois(3,n*p)
plot(p,pa1,type="l",xlim=c(0,0.05),main="Operating Characteristics Curve for different c", xlab="Fra
ction Defective", ylab="Acceptance Probability")
lines(p,pa2,lty=2,lwd=2,col="orange")
lines(p,pa3,lty=3,lwd=2,col="navy blue")
legend("topright",lty=c(1,2,3),c("OC1: n=225, c=1","OC2: n=225, c=2","OC3: n=225, c=3"),col=c("bla
ck","orange","navy blue"))
Interpretation: From the above graph we can see that changing the acceptance number
does not dramatically change the slope of the OC curve. As the acceptance number is
decreased, the OC curve is shifted to the left. Plans with smaller values of c provide
discrimination at lower levels of lot fraction defective than do plans with larger values of c.

Similarly try for AOQ, ATI with different sample size and different acceptance number.

Problem 15: Single Sampling Plan

Plot the operating characteristic curves for Single Sampling Plan where N=5000; n=100;
c=1,2,3. Also plot the average outgoing quality (AOQ) curve and ATI curve for the above
data.

Answer:

Try yourself!!

Problem 16: Single Sampling Plan

Suppose that a single-sampling plan with n = 150 and c = 2 is being used for receiving
inspection where the supplier ships the product in lots of size N = 3,000.

a. Draw the OC curve for this plan.

b. Draw the AOQ curve and find the AOQL.

c. Draw the ATI curve for this plan.

Answer:

Try yourself!! AOQL ≅ 0.0087


Problem 17: Double Sampling Plan

A double sampling plan is given by 𝑁 = 5000, 𝑛1 = 120, 𝑛2 = 300, 𝑐1 = 2 𝑎𝑛𝑑 𝑐2 = 6

a. Draw the O.C. curve for this plan.

b. Draw the ATI curve for the same plan.

c. Draw ASN curve for the same plan.

d. Draw AOQ curve for the same plan.

Answer:

𝑃𝑎 for Double Sampling Plan:


In case of double sampling plan, a lot will be accepted under the following
mutually exclusive ways:
i. 0 ≤ 𝑑1 ≤ 𝑐1 # 𝑓𝑟𝑜𝑚 𝑡ℎ𝑖𝑠 𝑐𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛 𝑤𝑒 𝑤𝑖𝑙𝑙 𝑔𝑒𝑡 𝑃𝑎𝐼
ii. 𝑑1 = 𝑐1 + 1, 𝑑2 ≤ 𝑐2 – (𝑐1 + 1) 𝑖. 𝑒. 𝑑1 + 𝑑2 ≤ 𝑐2
iii. 𝑑1 = 𝑐1 + 2, 𝑑2 ≤ 𝑐2 – (𝑐1 + 2)

⋮ #𝑓𝑜𝑟 𝑡ℎ𝑒𝑠𝑒 𝑐𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛𝑠 𝑤𝑒 𝑤𝑖𝑙𝑙 𝑔𝑒𝑡, 𝑃𝑎𝐼𝐼

❖ 𝑑1 = 𝑐2, 𝑑2 = 0
The acceptance probability is defined as:
𝑃𝑎 = 𝑃𝑎𝐼 + 𝑃𝑎𝐼𝐼
𝑐 𝑐 −𝑑 𝑐
= ∑𝑑11 =0 𝑃(𝑑1 ) + ∑𝑑22=01 ∑𝑑21 =𝑐1+1 𝑃(𝑑1 )𝑃(𝑑2 |𝑑1 )

In our sampling plan the ways will be:


i. 0 ≤ 𝑑1 ≤ 2 For this case we will get Pa1
ii. 𝑑1 = 𝑐1 + 1 = 3, 𝑑2 ≤ 6 − (2 + 1) = 3
iii. 𝑑1 = 4, 𝑑2 ≤ 2 For these cases we will get Pa2
iv. 𝑑1 = 5, 𝑑2 ≤ 1
v. 𝑑1 = 6, 𝑑2 = 0
> N<-5000
n1<-120
n2<-300
c1<-2
c2<-6

p<-seq(0.01,0.99,by=0.01) #Defining fraction defective


np1<-p*n1 #Mean of poisson for 1st sample
np2<-p*n2 #Mean of poisson for 2nd sample

Acceptance Probability in the first sample (finding Pa1):

> pa1<-ppois(2,np1) #[Pr[d1=0]+Pr[d1=1]+Pr[d1=2]]

Acceptance Probability using both First and Second sample. For finding Pa2 first we have to
calculate the probability of case I,II,III,IV:

> #(Case I) d1=3 and d2 <=3


fsp1<-dpois(3,np1) #Finding d1=3
ssp1<-ppois(3,np2) #Finding d2<=3
paC1<-fsp1*ssp1

#(Case II) d1=4 and d2 <=2


fsp2<-dpois(4,np1)
ssp2<-ppois(2,np2)
paC2<-fsp2*ssp2

#(Case III) d1=5 and d2 <=1


fsp3<-dpois(5,np1)
ssp3<-ppois(1,np2)
paC3<-fsp3*ssp3

#(Case IV) d1=6 and d2=0


fsp4<-dpois(6,np1)
ssp4<-ppois(0,np2)
paC4<-fsp4*ssp4
Finding Pa2:

> pa2<-paC1+paC2+paC3+paC4

Finally finding Pa:

> pa<-pa1+pa2 #Probability of acceptance probability for double sampling

a.

Drawing OC curve:

> OC<-plot(p,pa, type="l", lwd=2,xlim=c(0,0.07), main="Operating Characteristics Curve", xlab="Fractio


n Defective", ylab="Acceptance Probability")

b.

Drawing ATI curve:

ATI for double sampling is defined as:


> ati<-n1*pa1+(n1+n2)*pa2+N*(1-pa)
ATI_curve<-plot(p,ati, type="l", lwd=2,xlim=c(0,0.07), main="ATI Curve", xlab="Fraction Defective", yl
ab="ATI")

or,

> ati<-n1+n2*(1-pa1)+(N-n1-n2)*(1-pa) #Calculating ATI


ATI_curve<-plot(p,ati, type="l", lwd=2,xlim=c(0,0.07), main="ATI Curve", xlab="Fraction Defective", yl
ab="ATI")
c.

Drawing ASN curve:

ASN for double sampling is defined as:

where PI is the probability of making a lot-dispositioning decision on the first sample. This
is PI = P{lot is accepted on the first sample} + P{lot is rejected on the first sample and take
2nd sample}

> pi<-ppois(2,np1)+(1-ppois(6,np1)) #Pi is the probability of making a decision on the first sample
asn<-n1+n2*(1-pi)

ASN_curve<-plot(p,asn, type="l", lwd=2,xlim=c(0,0.12), main="ASN Curve", xlab="Fraction Defective",


ylab="ASN")
d.

Drawing AOQ curve:

For double sampling AOQ is defined as:

> aoq<-((pa1*(N-n1)+pa2*(N-n1-n2))*p)/N
AOQ_Curve<-plot(p,aoq, type="l", lwd=2,xlim=c(0,0.12), main="AOQ Curve", xlab="Fraction Defective"
, ylab="AOQ")
Problem 18: Double Sampling Plan

Consider a double-sampling plan 𝑛1 = 50, 𝑐1 = 2, 𝑛2 = 100, 𝑐2 = 6, where 𝑛1 is the sample


size for plan 1, with acceptance number 𝑐1, and 𝑛2, 𝑐2 are the sample size and acceptance
number, respectively, for plan 2. Draw the ASN curve for the same plan.

Answer:

Try yourself!!!

Problem 19: Double Sampling Plan

A double sampling plan is given by 𝑁 = 2000, 𝑛1 = 100, 𝑛2 = 150, 𝑐1 = 1 𝑎𝑛𝑑 𝑐2 = 4

a. Draw the O.C. curve for this plan.

b. Draw the ATI and ASN curves for the same plan.

Answer:

Try yourself!!!

Problem 20: In-course Question 2022

Answer:

Try yourself.
References:

1. Theory and Practical Lecture of Ahsan Rahman Jamee Sir

2. Montgomery, D.C., (2009), Introduction to Statistical Quality


Control, 7th edi, Wiley. (Page: 234-339, 649-685)

For the above problems kindly see the relevant chapters in the
lectures and books.

You might also like