6: II 7: III
3.1 The k-Method
3.1.1 Lower Specification Limit 3.1.1.1 Standard Deviation Known
To define a variables sampling plan the number of samples (n) and an acceptance constant (k) must be determined. A lot would be accepted if (¯x−LSL)/σ > k, where ¯xis the sample average of the measurements from a sample and σ is the standard deviation of the measurements. The mean and standard deviation are assumed to be known from past experience. In terms of the statistical theory of hypothesis testing, accepting the lot would be equivalent to failing to reject the null hypothesisH0 :µ≥µAQLin favor of the alternativeHa:µ < µAQL.
When the measurements are assumed to be normally distributed with a lower specification limitLSL, the AQL and the RQL in terms of proportion of items below theLSLcan be visualized as areas under the normal curve to the left of the LSL as shown inFigure 3.1. In this figure it can be seen that when the mean isµAQLthe proportion of defective items is AQL, and when the mean of the distribution isµRQLthe proportion of defective items is RQL.
If the producer’s risk is αand the consumer’s risk isβ, then P
x¯−LSL
σ > k|µ=µAQL
= 1−α (3.1)
and
P
x¯−LSL
σ > k|µ=µRQL
=β. (3.2)
In terms statistical hypothesis testing, Equation 3.1 is equivalent to having a significance level of α for testing H0 : µ ≥ µAQL, and Equation 3.2 is equivalent to having power of 1−β whenµ=µRQL.
By multiplying both sides of the inequality inside the parenthesis in Equa- tion 3.1 by √
n, subtracting µσ/AQL√n from each side, and adding σ/LSL√n to each side, it can be seen that
¯ x−LSL
σ > k⇒x¯−µAQL σ/√
n > k√
n+LSL−µAQL σ/√
n . (3.3)
If the mean is given asµ=µAQL, thenx−µ¯σ/√AQLn follows the standard normal
FIGURE 3.1: AQL and RQL for Variable Plan
distribution with meanµ= 0 and standard deviationσ= 1. Therefore, P
Z > k√
n+LSL−µAQL σ/√
n
= 1−α,
and
P
Z < k√
n+LSL−µAQL
σ/√ n
=α.
(3.4)
Consequently,
k√
n+LSL−µAQL σ/√
n =Zα
or
k= Zα
√n−LSL−µAQL
σ = Zα
√n−ZAQL,
since LSL−µAQL
σ =ZAQL.
(3.5)
FIGURE 3.2: Standard Normal QuantileZα andZAQL
Performing the same manipulations with the inequality in Equation 3.2, it can be shown that
k= Z1−β
√n −ZRQL. (3.6)
Equating the solution for k in the next to last line in Equation 3.5 with the solution forkin Equation 3.6 and solving for n, it can be seen that
Zα
√n−ZAQL= Z1−β
√n −ZRQL⇒n=
Zα−Z1−β ZAQL−ZRQL
2
(3.7) Zα, ZAQL, and ZRQL are quantiles of the standard normal distribution, as shown in Figure 3.2. They can be calculated with the R functionqnorm. For the case where AQL=1% or 0.01, the RQL=4.6% or 0.046, α = 0.05 andβ = 0.10, the R Code below evaluates Equation 3.7 and the last line of Equation 3.5 to find the sample size n and the acceptance constantk for a custom variable sampling plan that has PRP=(.01,.95), and CRP=(.046,.10).
R>n<-((qnorm(.05)-qnorm(.90))/(qnorm(.01)-qnorm(.046)))^2 R>k<-(qnorm(.05) / sqrt(21))-qnorm(.01)
The first line of code calculates n = 20.8162. This is rounded up to the next integer (21) which is substituted into the next line for fornin calculating k= 1.967411.
Thus, conducting the sampling plan on a lot of material consists of the following steps:
1. Take a random sample ofnitems from the lot
2. Measure the critical characteristicxon each sampled item 3. Calculate the mean measurementx
4. Compare (x−LSL)/σto the acceptance constantk= 1.967411 5. If (x−LSL)/σ > k, accept the lot, otherwise reject the lot.
The R code below uses theOCvar()function in theAcceptanceSampling package to store the plan and make the OC curve shown inFigure 3.3.
R>library(AcceptanceSampling)
R>plnVkm<-OCvar(21,1.967411,pd=seq(0,.15,.001)) R>plot(plnVkm, type=’l’)
R>grid()
FIGURE 3.3: OC Curve for Variables Sampling Plan n= 21,k= 1.967411 This OC curve is very steep and close to the ideal with a very high prob- ability of accepting lots with 1% defective or less, and a very low probability of accepting lots with 4.6% defective or more.
The find.plan() function in the AcceptanceSampling package auto- mates the procedure of finding the sample size (n) and acceptance constant (k) for a custom derived variables sampling plan. The R code and output below shows how this is done.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(0.01, 0.95),CRP=c(0.046, 0.10), type="normal")
R> $n [1] 21
$k
[1] 1.967411
$s.type
[1] "known"
If the items in the sample could only be classified as nonconforming or con- forming, an attribute sampling plan would require many more samples to have a equivalent OC curve. The R code and output below uses thefind.plan() function in the AcceptanceSampling package to find an equivalent custom derived attribute sampling plan and plot the OC curve shown inFigure 3.4.
Thetype="binomial"option in thefind.plan()was used assuming that the lot size is large enough that the Binomial distribution is an accurate approx- imation to the Hypergeometric distribution for calculating the probability of acceptance with the attribute plan.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(0.01,0.95),CRP=c(0.046,0.10), type="binomial")
$n [1] 172
$c [1] 4
$r [1] 5
R>plnA<-OC2c(n=172,c=4, type="binomial",pd=seq(0,.15,.001)) R>plot(plnA,type=’l’, xlim=c(0,.15))
R>grid()
We can see that the OC curve for the attribute sampling plan inFigure 3.4is about the same as the OC curve for the variables sampling plan inFigure 3.3, but the sample size n = 172 required for the attribute plan is much higher than the sample sizen = 21 for the variable plan. The variable plan would be advantageous unless the effort and expense of making the measurements took more than 8 times the effort and expense of simply classifying the items as conforming to specifications or not.
Example 1Mitra[72] presents the following example of the use of a vari- ables sampling plan with a lower specification limit and the standard deviation known. In the the manufacture of heavy-duty utility bags for household use, the lower specification limit on the carrying weight is 100 kg. The AQL is 0.02 or 2%, the RQL is 0.12 or 12%. The producers risk α = 0.08, and the consumers riskβ = 0.10, and the standard deviation of the carrying weight is
FIGURE 3.4: OC Curve for Attribute Sampling Plann= 172, c= 4
σ= 8 kg. The R Code and output below shows the sample sizen= 10, and the acceptance constantk= 1.6009 for the custom derived sampling plan.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(.02,.92),CRP=c(.12,.10),type=’normal’)
$n [1] 10
$k
[1] 1.609426
$s.type [1] "known"
After selecting a sample of n= 10 bags, the average carrying weight was found to bex= 110. Then,
ZL= x−LSL
σ =110−100
8 = 1.25<1.609 =k Therefore, reject the lot.
3.1.1.2 Standard Deviation Unknown
If it could not be assumed that the standard deviationσwere known, theZα andZ1−βin Equation 3.7 would have to be replaced with the quantiles of the t-distribution with n−1 degrees of freedom (tα and t1−β ). Then Equation 3.7 could not directly be solved forn, because the right side of the equation
is also a functionn. Instead an iterative approach would have to be used to solve forn. The find.plan() function in theAcceptanceSamplingpackage does this as illustrated below.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(0.01,0.95),CRP=c(0.046,0.10), type="normal", s.type="unknown")
$n [1] 63
$k
[1] 1.974026
$s.type [1] "unknown"
The sample size n = 63 for this plan withσ unknown is still much less than then= 172 that would be required for the attribute sampling plan with an equivalent OC curve.
The R code below uses the OC2c(), and OCvar() functions in the AcceptanceSampling package to store the plans for the attribute sampling plan (whose OC curve is shown inFigure 3.4) and the variable sampling plans for the cases whereσ is unknown or known. The values operating character- istic OC can be retrieved from each plan by attaching the suffix@pacceptto the names for the stored plans. The OC curves for each plan are then plotted on the same graph inFigure 3.5using the Rplotfunction for comparison.
R>library(AcceptanceSampling) R>PD<-seq(0,.15,.001)
R>plnA<-OC2c(n=172,c=4,type="binomial",pd=PD)
R>plnVku<-OCvar(n=63,k=1.974026,pd=PD,s.type="unknown") R>plnVkm<-OCvar(n=21,k=1.96411,pd=PD,s.type="known") R>#Plot all three OC curves on the same graph
R>plot(PD,plnA@paccept,type=’l’,lty=1,col=1, xlab=’Probability of nonconforming’,ylab=’OC’) R>lines(PD,plnVku@paccept,type=’l’,lty=2,col=2) R>lines(PD,plnVkm@paccept,type=’l’,lty=4,col=4)
R>legend(.04,.95,c("Attribute","Variable, sigma unknown",
"Variable, sigma known"),lty=c(1,2,4),col=c(1,2,4)) R>grid()
FIGURE 3.5: Comparison of OC Curves for Attribute and Variable Sampling Plans
It can be seen inFigure 3.5that the OC curve for the two variable plans are essentially identical, although the sample size (n=21) is less whenσis known.
The OC curves for these variable plans are very similar to the OC curve for the attribute plan (that is also shown in Figure 3.4), but they do offer the customer slightly more protection for intermediate values of the proportion nonconforming, as can be seen inFigure 3.5.
When the standard deviation is unknown, conducting the sampling plan on a lot of material consists of the following steps:
1. Take a random sample ofnitems from the lot
2. Measure the critical characteristicxon each sampled item
3. Calculate the mean measurementx, and the sample standard deviations 4. Compare (x−LSL)/sto the acceptance constantk
5. If (x−LSL)/s > k, accept the lot, otherwise reject the lot.
Example 2 Montgomery[74] presents the following example of the use of a custom derived variables sampling plan with a lower specification limit and standard deviation unknown. A soft drink bottler buys nonreturnable bottles from a supplier. Their lower specification limit on the bursting strength is 225psi. The AQL is 0.01 or 1%, the RQL is 0.06 or 6%. The producers risk α = 0.05, and the consumers risk β = 0.10, and the standard deviation of the bursting strength is unknown. The R Code and output below show the sample sizen= 42, and the acceptance constantk= 1.905285.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(.01,.95), CRP=c(.06,.10), type=’normal’,s.type=’unknown’)
$n [1] 42
$k
[1] 1.905285
$s.type [1] "unknown"
After selecting a sample of n= 42 bottles, the average bursting strength was found to bex= 255, with a sample standard deviation ofs= 15. Then,
ZL =x−LSL
s = 255−225
15 = 2.0>1.905285 =k Therefore, accept the lot.
3.1.2 Upper Specification Limit 3.1.2.1 Standard Deviation Known
If a variables sampling plan was required for a situation where there was an upper specification limit (USL), instead of a lower specification limit (LSL), then the fourth and fifth steps in conducting the sampling plan on a lot of material would change from:
4. Compare (x−LSL)/σto the acceptance constantk 5. If (x−LSL)/σ > k, accept the lot, otherwise reject the lot.
to
4. Compare (U SL−x)/σ to the acceptance constantk 5. If (U SL−x)/σ > k, accept the lot, otherwise reject the lot.
3.1.2.2 Standard Deviation Unknown
If the standard deviation were unknown, steps 4 and 5 above would change to 4. Compare (U SL−x)/s to the acceptance constantk
5. If (U SL−x)/s > k, accept the lot, otherwise reject the lot.
and the sample size n and acceptance constant k would be found with the find.plan()function, as shown in the example code below.
R>library(AcceptanceSampling)
R>find.plan(PRP=c(0.01, 0.95), CRP=c(0.06, 0.10), type="normal", s.type="unknown")
3.1.3 Upper and Lower Specification Limits 3.1.3.1 Standard Deviation Known
When there is an upper (USL) and a lower specification limit (LSL), Schilling[84] proposed a simple procedure that may be used to determine if two separate single specification limit plans may be used. The procedure is as follows:
1. CalculateZp∗= (LSL−U SL)/2σ
2. Calculatep∗=pnorm(Zp∗) the area under the standard normal density to the left ofZp∗.
3. If 2p∗ ≥ RQL reject the lot, because even if the distribution is centered between the specification limits, the a proportion outside the specification limits will be too high.
4. If 2p∗ ≤AQLuse two single specification sampling plans (i.e., one for LSL and one for USL).
5. IfAQL≤2p∗ ≤RQLthen use the M-Method for upper and lower speci- fication limits that is described inSection 3.2
3.1.3.2 Standard Deviation Unknown
When there is an upper (USL) and a lower specification limit (LSL), and the standard deviation is unknown, use the M-Method described inSection 3.2.