R: Calculation of LTPD plan for sampling inspection by variables
planLTPD
R Documentation
Calculation of LTPD plan for sampling inspection by variables
Description
Calculation of LTPD plan (sample size n and critical value k) for sampling inspection by variables
Usage
planLTPD(N, pt, pbar, b = 0.1, cm = 1,method = c("exact", "napprox","ewma2","ewmaSK" ),
intdif = 20,lam=1)
Arguments
N
lot size (number of items in the lot)
pt
lot tolerance fraction defective
pbar
process average fraction defective
b
probability of accepting a lot of tolerance quality pt (consumer risk), default value 0.1
cm
parameter used in cost function of plans (see Ims) and defined as cost of inspection of one item by variables divided by cost of inspection of the item by attributes, default value 1
method
type of OC (operating characteristic) used, either "exact" (default) using non-central t-distribution, or "napprox" for approximate OC; if EWMA statistic is to be used, "ewmaSK" stands for the sigma known case, "ewma2" stands for the sigma unknown case
intdif
parameter used in finding n when method other than "napprox", controlling the width of interval to be searched in for sampling plan optimal w.r.t. cost, difference from interval centre (n resulting from planLTPD(..., method = "napprox") to lower or upper bound, default value 20
lam
smoothing parameter in case that EWMA statistic is used
Value
An instance of ACSPlan-class, with sample size in slot n and critical value in slot k.
References
Klufa, J.: Exact calculation of the Dodge-Romig LTPD single sampling plans for inspection by variables. Statistical Papers, Springer, Vol. 51(2), pages 297-305, 2010.
See Also
LTPDvar-package, OC, ACSPlan-class, Ims
Examples
# find LTPD plan
planLTPD(N=1000,pt=0.1,pbar=0.001);
planLTPD(1000, 0.01,0.001,cm=1.5,b=0.1,method="ewmaSK",lam=0.9,intdif=60);
planLTPD(1000, 0.01,0.001,cm=1.5,b=0.1,method="ewma2",lam=0.9);
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(LTPDvar)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LTPDvar/planLTPD.Rd_%03d_medium.png", width=480, height=480)
> ### Name: planLTPD
> ### Title: Calculation of LTPD plan for sampling inspection by variables
> ### Aliases: planLTPD
> ### Keywords: misc
>
> ### ** Examples
>
> # find LTPD plan
> planLTPD(N=1000,pt=0.1,pbar=0.001);
An object of class "ACSPlan"
Slot "n":
[1] 16
Slot "k":
[1] 1.841766
Warning message:
In pt(q = k * n^0.5, df = n - 1, ncp = qnorm(1 - p) * n^0.5) :
full precision may not have been achieved in 'pnt{final}'
> planLTPD(1000, 0.01,0.001,cm=1.5,b=0.1,method="ewmaSK",lam=0.9,intdif=60);
An object of class "ACSPlan"
Slot "n":
[1] 20
Slot "k":
[1] 2.585554
> planLTPD(1000, 0.01,0.001,cm=1.5,b=0.1,method="ewma2",lam=0.9);
An object of class "ACSPlan"
Slot "n":
[1] 75
Slot "k":
[1] 2.643843
>
>
>
>
>
> dev.off()
null device
1
>