Title: | Functions for Calculating Dodge Romig, MIL STD 105E and MIL STD 414 Acceptance Sampling Plan |
---|---|
Description: | Calculates an acceptance sampling plan, (sample size and acceptance number) based in MIL STD 105E, Dodge Romig and MIL STD 414 tables and procedures. The arguments for each function are related to lot size, inspection level and quality level. The specific plan operating curve (OC), is calculated by the binomial distribution. |
Authors: | Erick Marroquin |
Maintainer: | Erick Marroquin <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1 |
Built: | 2025-02-12 03:39:35 UTC |
Source: | https://github.com/cran/Planesmuestra |
Use a funcion for each plan and a special one for graphic an OC curve. The plan functions are bassed in the Dodge Romig, MIL STD 105E and MIL STD 414. However, the OC curve is calculated using the binomial trials, after calculating acceptance sampling plan.
Package: | Planesmuestra |
Type: | Package |
Version: | 1.0 |
Date: | 2015-02-17 |
License: | GPL |
Erick Marroquin
Maintainer: Erick Marroquin <[email protected]>
Contains the different maximum non conforming fractions of AQL and LTPD plan, according Dodge Romig plans. A data frame with six maximum levels of the nonconforming fraction for each AOQL and LPTD plan.
data("ap_DR")
data("ap_DR")
A data frame with 6 observations on the following 2 plans.
AOQL
a numeric vector containing the nonconforming fraction level for AOQL plan
LPTD
a numeric vector containing the nonconforming fraction level for LPTD plan
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(ap_DR)
data(ap_DR)
Contains the unique code letter for a specific size lot, interpolated through the f_milstd105E function, and specificl normal or special inspection level.
data("code_letter")
data("code_letter")
A data frame with 0 observations on the following 2 variables.
S.1
a character vector with the code letters, for the S.1 special inspection level
S.2
a character vector with the code letters, for the S.2 special inspection level
S.3
a character vector with the code letters, for the S.3 special inspection level
S.4
a character vector with the code letters, for the S.4 special inspection level
I
a character vector with the code letters, for the I normal inspection level
II
a character vector with the code letters, for the II normal inspection level
III
a character vector with the code letters, for the III normal inspection level
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(code_letter)
data(code_letter)
Contains the unique code letter for a specific size lot, interpolated through the f_milstd105E function, and specificl normal or special inspection level.
data("code_letter.milstd414")
data("code_letter.milstd414")
A data frame with 0 observations on the following 2 variables.
I
a character vector with the code letters, for the I inspection level
II
a character vector with the code letters, for the II inspection level
III
a character vector with the code letters, for the III inspection level
IV
a character vector with the code letters, for the IV inspection level
V
a character vector with the code letters, for the V inspection level
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(code_letter.milstd414)
data(code_letter.milstd414)
Given an AOQL, LPTD, sample size and acceptance number, return the plot the OC curve and producer and consumer risk.The calculation uses the binomial trials. Applies for attribute plans.
f_CO.NCA.NCL(NCA,NCL,n,c)
f_CO.NCA.NCL(NCA,NCL,n,c)
NCA |
Specific AOQL value |
NCL |
Specific LPTD value |
n |
sample size |
c |
acceptance number |
Functionn stops if any value is missing
NCA |
Specific AOQL value |
NCL |
Specific LPTD value |
n |
sample size |
c |
acceptance number |
beta |
consumer risk |
alpha |
producer risk |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_dodge.romig.simple, f_milstd414
, f_milstd105e
,
f_CO.plan
, f_DR.CO
f_CO.NCA.NCL(NCA=0.02,NCL=0.1,n=69,c=3)
f_CO.NCA.NCL(NCA=0.02,NCL=0.1,n=69,c=3)
Plot the OC Curve for a specific acceptance plan. The function need the plan defined in a previous function. The calculation uses the binomial trials. Applies for attribute plans.
f_CO.plan(plan)
f_CO.plan(plan)
plan |
A vector with acceptance number c , the sample size n, and the fraction of the non conforming items p. |
c |
An integer number grater than zero, for the acceptance number. |
n |
An integer number grater than the acceptance number for the sample size. |
p |
Fraction average of the nonconforming items. |
beta |
Acceptance probability. |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_dodge.romig.simple, f_milstd414
, f_milstd105e
, f_DR.CO
r1<-f_dodge.romig.simple(N=2500,"AOQL", p=0.01) f_CO.plan(r1$plan)
r1<-f_dodge.romig.simple(N=2500,"AOQL", p=0.01) f_CO.plan(r1$plan)
Starting with a known lot N, and a specific AOQL or LPTD plan, and an average of proportion of defectives or nonconforming items, the plan is calculated, giving the sample size, the acceptance number and the rejection number. The function is for simple acceptance sample plans only.
f_dodge.romig.simple(N,plan,p)
f_dodge.romig.simple(N,plan,p)
N |
Is the lot size, an integer number, must be grater than 2 |
plan |
A character string for specify the AOQL or LPTD plan |
p |
Fraction average of the nonconforming items |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_DR.CO
f_milstd414
f_milstd105e
f_dodge.romig.simple(N=5000,plan="AOQL",p=0.017)
f_dodge.romig.simple(N=5000,plan="AOQL",p=0.017)
Plot the OC Curve for a specific acceptance plan. Needs the acceptance number c , the sample size n, and the fraction of the non conforming items p. The calculation uses the binomial trials. Applies for attribute plans.
f_DR.CO(c,n,p)
f_DR.CO(c,n,p)
c |
An integer number grater than zero, for the acceptance number. |
n |
An integer number grater than the acceptance number for the sample size. |
p |
Fraction average of the nonconforming items. |
c |
An integer number grater than zero, for the acceptance number. |
n |
An integer number grater than the acceptance number for the sample size. |
p |
Fraction average of the nonconforming items. |
beta |
Acceptance probability. |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_dodge.romig.simple, f_milstd414
, f_milstd105e
,
f_CO.plan
# n = 125 items, c=2, p = 0.01 f_DR.CO(2,125,0.1)
# n = 125 items, c=2, p = 0.01 f_DR.CO(2,125,0.1)
Given lot size, a type of inspection (Normal, Reduced, Tightened), type of sampling (Simple, double or multiple), and the AQL, show the calculated acceptance plan based in the MIL STD 105e tables. The function is for simple acceptance sample plans only.
f_milstd105e(N,L,NCA,type)
f_milstd105e(N,L,NCA,type)
N |
Is the lot size, an integer number, must be grater than 2 |
L |
A character string for inspection level (S-1,S-2,S-3,S-4,I, II, III) |
NCA |
A numeric value for the AQL |
type |
A character string whith the type of inspection, - n - normal, - r - reduced, in other case is tightened |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_DR.CO
f_dodge.romig.simple
f_milstd414
## L = 1200 , an AQL = 1, level III, tightened inspection f_milstd105e(N=11000,L="II",type="n",NCA=15)
## L = 1200 , an AQL = 1, level III, tightened inspection f_milstd105e(N=11000,L="II",type="n",NCA=15)
Given lot size, an inspection level, a type of inspection and the NCA, show the calculated acceptance plan based in the MIL STD 414 tables.
f_milstd414(N,L,NCA,type)
f_milstd414(N,L,NCA,type)
N |
Is the lot size, an integer number, must be grater than 2 |
L |
A character string for inspection level (I,II,III,IV,V) |
NCA |
A numeric value for the NCA |
type |
Type of inspection, - n - normal, - t - tightened |
The master table of MIL STD 414 for plans based in variables, contains the values for both type of inspection.
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
f_DR.CO
, f_dodge.romig.simple
, f_milstd105e
, f_milstd414.test
## L = 1200, NCA = 1, level III, tightened inspection ## f_milstd414(N=1200,NCA=1,L="III",type="t")
## L = 1200, NCA = 1, level III, tightened inspection ## f_milstd414(N=1200,NCA=1,L="III",type="t")
Accept or reject a variable sample considering a shift factor, the data comes from an especific variable plan.
f_milstd414.test(x,k,S,Limite,L)
f_milstd414.test(x,k,S,Limite,L)
x |
Vector or data frame containing the taken sample values, the function evaluates only the first column or variable |
k |
A vector of length one, equal shift factor |
S |
Know standard deviation, if value not exists, function gives the sample standard deviation |
Limite |
A character vector of length one, "S" for upper control limit and "I" for lower control limit |
L |
A vector of length one, equal to a specific Control Limit value |
Erick Marroquin
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
x<-c(4.7,5.1,4.9,4.9,4.8,4.9,4.9,4.8,4.8,4.7,4.7,4.9,4.8,4.9,4.6,4.8,4.9,5.1,4.8,5,5,4.7,5,5,4.8) f_milstd414.test(as.data.frame(x),k=1.98,Limite="S", L=5.1) f_milstd414.test(as.data.frame(x),k=1.98,Limite="I", L=4.7)
x<-c(4.7,5.1,4.9,4.9,4.8,4.9,4.9,4.8,4.8,4.7,4.7,4.9,4.8,4.9,4.6,4.8,4.9,5.1,4.8,5,5,4.7,5,5,4.8) f_milstd414.test(as.data.frame(x),k=1.98,Limite="S", L=5.1) f_milstd414.test(as.data.frame(x),k=1.98,Limite="I", L=4.7)
Data for indexing sample size and k value, given the code lette, AQL value and inspection type code.
data("k_plans.milstd414")
data("k_plans.milstd414")
A data frame with 432 observations on the following 5 variables.
code_letter
a factor for code letters, levels are B, C, D, E, F, G, H, J, K, L, M, N, P, Q
sample
a numeric vector for sample size
k
a numeric vector containing the k value
NCA
a factor containing the different AQL levels
T
a character vector for normal inspection
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(k_plans.milstd414)
data(k_plans.milstd414)
Interpolate the table lot size level starting from a real lot size
data("lot_size")
data("lot_size")
A data frame with 15 minimum levels for size lot.
N
A numeric vector containing the minimun level. For lots greater than 1x10^10, the function fixes the lot size as the last one of the "lot_size" data frame.
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(lot_size)
data(lot_size)
Shows the results for a given lot size, AOQL or LPTD plan and a fraction of non conforming items. The results are: the acceptance number - n -, the rejection number - c -, and the corresponding AOQL - LPTD percentage.
data("lot_size_DR")
data("lot_size_DR")
A data frame with 222 observations on the following 6 variables.
N
a numeric vector whith the interpolated lot
plan
a factor with two levels, the AOQL and the LPTD plan.
p
a character vector whith six levels, for each AOQL and the LPTD plan.
n
a numeric vector for the sample size for a specific acceptance plan.
c
a numeric vector for the acceptance number for a specific acceptance plan.
LPTD._AOQL
a numeric vector for the LPTD or AOQL index.
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(lot_size_DR) ## maybe str(lot_size_DR) ; plot(lot_size_DR) ...
data(lot_size_DR) ## maybe str(lot_size_DR) ; plot(lot_size_DR) ...
Interpolate the table lot size level starting from a real lot size.
data("lot_size.milstd414")
data("lot_size.milstd414")
A data frame with 17 minimun levels for size lot.
N
A numeric vector containing the minimun level. For lots greater than 550001, the function fixes the lot size as the last one of the "lot_size" data frame.
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(lot_size.milstd414)
data(lot_size.milstd414)
Data for indexing sample size and acceptance number, given the code lette, AQL value and inspection type code.
data(milstd105eplans)
data(milstd105eplans)
A data frame with 1274 entries on the following 5 variables.
code_letter
a factor for code letters, levels are A, B, C, D, E, F, G, H, J, K, L, M, N, P, Q, R, S
n
a numeric vector for sample size
T
a factor for type of inspection, among tightened, reduced or normal, "t", "r", "n" respectively
NCA
a factor containing the different AQL levels, 26 in total
c
a numeric vector for acceptance number
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(milstd105eplans)
data(milstd105eplans)
Contains the AQL level values for sample size and acceptance number. The row order is the sames as the code letter, previously determined.
data("NCA_values")
data("NCA_values")
NCA_values
a numeric vector containing 26 AQL levels
Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3
data(NCA_values) ## NCA values is the same for AQL values
data(NCA_values) ## NCA values is the same for AQL values