Package 'Planesmuestra'

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

Help Index


Acceptance sampling plan according the Dodge Romig, MIL STD105E and MIL STD414 plans.

Description

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.

Details

Package: Planesmuestra
Type: Package
Version: 1.0
Date: 2015-02-17
License: GPL

Author(s)

Erick Marroquin
Maintainer: Erick Marroquin <[email protected]>


Data: Dodge Romig table of Nonconforming fraction levels for AOQL and LPTD plans

Description

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.

Usage

data("ap_DR")

Format

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

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(ap_DR)

Data: Inspection level and the code letter for a MIL STD 105E acceptance sampling plan.

Description

Contains the unique code letter for a specific size lot, interpolated through the f_milstd105E function, and specificl normal or special inspection level.

Usage

data("code_letter")

Format

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

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(code_letter)

Data: Inspection level and the code letter for a MIL STD 414 acceptance sampling plan and normal inspection.

Description

Contains the unique code letter for a specific size lot, interpolated through the f_milstd105E function, and specificl normal or special inspection level.

Usage

data("code_letter.milstd414")

Format

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

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(code_letter.milstd414)

OC Curve for AOQL and LPTD relation

Description

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.

Usage

f_CO.NCA.NCL(NCA,NCL,n,c)

Arguments

NCA

Specific AOQL value

NCL

Specific LPTD value

n

sample size

c

acceptance number

Details

Functionn stops if any value is missing

Value

NCA

Specific AOQL value

NCL

Specific LPTD value

n

sample size

c

acceptance number

beta

consumer risk

alpha

producer risk

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_dodge.romig.simple, f_milstd414, f_milstd105e, f_CO.plan, f_DR.CO

Examples

f_CO.NCA.NCL(NCA=0.02,NCL=0.1,n=69,c=3)

Plot the OC Curve for a specific Dodge Romig acceptance sampling plan results

Description

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.

Usage

f_CO.plan(plan)

Arguments

plan

A vector with acceptance number c , the sample size n, and the fraction of the non conforming items p.

Value

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.

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_dodge.romig.simple, f_milstd414, f_milstd105e, f_DR.CO

Examples

r1<-f_dodge.romig.simple(N=2500,"AOQL", p=0.01)
f_CO.plan(r1$plan)

Calculate the acceptance sampling for Dodge Romig method

Description

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.

Usage

f_dodge.romig.simple(N,plan,p)

Arguments

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

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_DR.CO f_milstd414 f_milstd105e

Examples

f_dodge.romig.simple(N=5000,plan="AOQL",p=0.017)

Plot the OC Curve for a specific acceptance sampling plan

Description

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.

Usage

f_DR.CO(c,n,p)

Arguments

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.

Value

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.

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_dodge.romig.simple, f_milstd414, f_milstd105e, f_CO.plan

Examples

# n = 125 items, c=2, p =  0.01
f_DR.CO(2,125,0.1)

Calculate the acceptance sampling for MIL STD 105E / ANSI ASQ C Z 1.4 / ISO 2589 plan

Description

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.

Usage

f_milstd105e(N,L,NCA,type)

Arguments

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

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_DR.CO f_dodge.romig.simple f_milstd414

Examples

## L = 1200 , an AQL = 1, level III, tightened inspection
f_milstd105e(N=11000,L="II",type="n",NCA=15)

Calculate the acceptance sampling for MIL STD 414 / ANSI ASQ C Z 1.9 / ISO 3951 plan

Description

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.

Usage

f_milstd414(N,L,NCA,type)

Arguments

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

Details

The master table of MIL STD 414 for plans based in variables, contains the values for both type of inspection.

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_DR.CO, f_dodge.romig.simple, f_milstd105e , f_milstd414.test

Examples

## 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

Description

Accept or reject a variable sample considering a shift factor, the data comes from an especific variable plan.

Usage

f_milstd414.test(x,k,S,Limite,L)

Arguments

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

Author(s)

Erick Marroquin

References

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

See Also

f_milstd414

Examples

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: Extract the sample size and k value for MIL STD 414 variable acceptance sampling plans and normal type.

Description

Data for indexing sample size and k value, given the code lette, AQL value and inspection type code.

Usage

data("k_plans.milstd414")

Format

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

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(k_plans.milstd414)

Data: Lot size levels for MIL STD 105 E acceptance sampling plans

Description

Interpolate the table lot size level starting from a real lot size

Usage

data("lot_size")

Format

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.

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(lot_size)

Data: Lot size for Dodge Romig acceptance sampling plan

Description

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.

Usage

data("lot_size_DR")

Format

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.

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(lot_size_DR)
## maybe str(lot_size_DR) ; plot(lot_size_DR) ...

Data: Lot size levels for MIL STD 414 variable acceptance sampling plans

Description

Interpolate the table lot size level starting from a real lot size.

Usage

data("lot_size.milstd414")

Format

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.

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(lot_size.milstd414)

Data: Extract the sample size and the acceptance number for MIL STD 105E acceptance sampling plans.

Description

Data for indexing sample size and acceptance number, given the code lette, AQL value and inspection type code.

Usage

data(milstd105eplans)

Format

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

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(milstd105eplans)

Data: AQL levels for MIL STD 105E acceptance sampling plans.

Description

Contains the AQL level values for sample size and acceptance number. The row order is the sames as the code letter, previously determined.

Usage

data("NCA_values")

Format

NCA_values

a numeric vector containing 26 AQL levels

Source

Montgomery, D.C. (2005) Introduction to Statistical Quality Control, 5th ed. New York: John Wiley & Sons, ISBN 0-471-65631-3

Examples

data(NCA_values)
## NCA values is the same for AQL values