home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Explore the World of Soft…e: Engineering & Science
/
Explore_the_World_of_Software_Engineering_and_Science_HRS_Software_1998.iso
/
programs
/
statistc
/
ochy9309.exe
/
OCHYPG.DOC
< prev
next >
Wrap
Text File
|
1993-09-15
|
13KB
|
263 lines
┌───────────────────────────────────────────────────────────────┐
│ Calculation of the Operating Characteristic Curve │
│ for Single-Stage Sampling from Finite Populations │
│ │
│ OCHYPG.EXE....Version 9309 │
├───────────────────────────────────────────────────────────────┤
│ A Quality Assurance Training Tool: │
│ Statistics Committee of the QA Section of the PMA │
│ │
│ PMA = Pharmaceutical Manufacturing Association │
│ │
│ Bob Obenchain, CompuServe User [72007,467] │
│ │
└───────────────────────────────────────────────────────────────┘
Given a "Sample Size" and an "Accept Number" for nonconformances in
single-stage random sampling without replacement from a Lot (batch,
population) of specified, finite size, OCHypg.EXE computes points on
the "Operating Characteristic" (OC) curve. The OC curve gives the
Probability of Lot Acceptance as a function of the Fraction Defective
in the Lot. This is a straight-forward application for the so-called
"hypergeometric" distribution, Johnson and Kotz(1969), Chapter 6.
OC curves for standard sampling plans, such as those in MIL-STD-105E
(1989) and ANSI/ASQC Z1.4 (1981), are frequently evaluated using
"binomial" distribution methods, as if the lot size were infinite.
[Monte-Carlo methods are typically combined with a binomial model to
simulate the effect on the OC curve of switching rules between
Reduced, Normal, and Tightened inspection levels.] On the other hand,
the single-stage, Zero Acceptance Number (c=0) sampling plans of
Squeglia(1986) are based upon exact hypergeometric calculations for
finite lot sizes.
By convention, OC curves for a sampling plan always give the
probability that a lot will be found to be acceptable as a function of
the true (unknown) nonconformance rate, p, incoming for inspection.
But, when sampling from a finite population of size N, the only
possible values for p are integer multiples of 1/N. In other words,
the OC curve for finite population sampling is defined only at p =
k/N, where k is an integer in the range 0 <= k <= N.
The probability of lot acceptance will be monotone, strictly
decreasing as k increases as long as the Accept Number = c is less
than the Sample Size = n. (The implicit Reject Number in single-stage
sampling is r = c + 1.) The OC curve starts out at 1 for p=0
(left-hand extreme) and ends at 0 for p=1 (right-hand extreme) in
these c < n cases.
The Acceptable Quality Level (AQL) fraction is then the right-most
p=k/N value such that the OC curve lies above the desired Yield
fraction (usually 0.95 or .99) everywhere to its left. And the Lot
Tolerance Percent Defective (LTPD) fraction is the left-most p=k/N
OCHypg.EXE, version 9309 ............................. Page 2 of 5
value such that the OC curve lies below the desired 1-Yield fraction
(usually 0.10 or 0.05) everywhere to its right.
OCHypg Prompts and Parameter Limits... MIN MAX
======================================
What is the Population Size ? [N] : 2 2,000,000
What is the Sample Size ? [n] : 1 N-1
What is the Accept Number ? [c] : 0 n-1
Implied Reject Number: r = c + 1 1 n
True Fraction Nonconforming ? 0.0 1.0
However, calculations need only be performed when
the implied number of nonconforming items is... 1 N-1
Example Batch Input Files...
============================
OCHYPG21.INP ...Batch Input Files for either 21 or 51 equally spaced
OCHYPG51.INP values (every 5% or every 2%) of Fraction Defective
Incoming for Inspection.
NOTE: Batch input files must have a filename extension of ".INP" and
must be formatted EXACTLY as shown below...
-------------------------------------------------------------------
filename <-- DOS filename for the OCHypg output .OUT file
10000 <-- first N = population size
20 <-- first n = sample size
0 <-- first c = accept number
0.05 <-- first fraction defective \ note that
y <-- the character "y" or else a blank line / these lines
0.10 <-- second fraction defective \ always come
y <-- the character "y" or else a blank line / in pairs...
0.15 <-- third fraction defective \
y <-- the character "y" or else a blank line /
...etc
0.95 <-- last fraction defective \
n <-- the character "n" /
y <-- the character "y" or else a blank line ...NEXT N,n,c
10000 <-- second N = population size
125 <-- second n = sample size
10 <-- second c = accept number
0.05 <-- first fraction defective \ note that
y <-- the character "y" or else a blank line / these lines
0.10 <-- second fraction defective \ always come
y <-- the character "y" or else a blank line / in pairs...
0.15 <-- third fraction defective \
OCHypg.EXE, version 9309 ............................. Page 3 of 5
y <-- the character "y" or else a blank line /
...etc
0.95 <-- last fraction defective \
n <-- the character "n" /
n <-- the character "n" ...No more N,n,c values
Invoking OCHypg...
====================
Enter the following command at your DOS prompt...
DOSprompt> ochypg
OCHypg will then prompt you to choose between K = keyboard and B =
batch-data-file entry. Press the K key to use your keyboard console to
respond to OCHypg's remaining prompts for input. Each prompt displays
a [default] value that you may accept simply by pressing the ENTER (or
RETURN) key. Otherwise, type in the numerical value or character string
you wish, and then press ENTER.
If you choose batch input by pressing the B key, OCHypg will prompt
you to type in a filename (of at most 8 characters) for an .INP file you
have previously created with your favorite ASCII/text editor. Don't
type the period (.) or the filename extenstion (INP); press ENTER to
start OCHypg calculations. This batch input option allows you to
queue up, say, an entire series of calculations to be performed while
you are off doing something else!
The OCHypg Output File: filename.CSV
======================================
The OCHypg output file saves the information that is displayed on your
computer screen in a Comma Separated Values (.CSV) format file. Thus
you usually do not need to take any handwitten notes as OCHypg
executes. These files are ideal for data import into Microsoft Excel
so that you may plot/print the Operating Characteristic Curve.
You can also review the OCHypg output file on your computer screen by
entering the command:
DOSprompt> type filename.csv | more
or you can get a paper copy of the OCHypg output file by entering the
command:
DOSprompt> print filename.csv
The output file will echo all Parameter Settings specified by the user
(or the batch input file) as well as give a complete listion of OCHypg
calculation results...
Population Size,N = 3200,,
Sample Size,n = 18,,
Acceptance Number,c = 0,,
OCHypg.EXE, version 9309 ............................. Page 4 of 5
Fraction Nonconforming, Probability of Acceptance, Nonconforms,Population
0.10000,0.14930,320,3200
0.12000,0.09951,384,3200
0.11000,0.12202,352,3200
0.00094,0.98321,3,3200
0.00063,0.98878,2,3200
0.00031,0.99438,1,3200
Population Size,N = 3200,,
Sample Size,n = 125,,
Acceptance Number,c = 10,,
Fraction Nonconforming, Probability of Acceptance,Nonconforms,Population
0.10000,0.27966,320,3200
0.12000,0.09882,384,3200
0.11000,0.17224,352,3200
0.05000,0.95423,160,3200
0.04000,0.98967,128,3200
0.03000,0.99892,96,3200
When the lot size is 3200, the above calculations illustrate Figure
1.2, page 6, of Squeglia(1986). Namely, the two plans (n=125, c=10)
and (n=18,c=0) have comparable 10% LTPD's of approximately p=0.12. On
the other hand, (n=125, c=10) has a 99% AQL of approximately p=0.04
while that of (n=18,c=0) is only p=0.00031 (1 in 3200.)
Execution The time required to perform OCHypg.EXE calculations
Time: depends upon the speed of your Personal Computer and
========= upon whether your PC has a numeric math co-processor chip.
On a slow machine, a numeric math co-processor can speed
calculations by a factor of 10.
Source Code...
==============
The C-language source code for OCHypg is provided in the file named
OCHypg.C.
Validation of Numerical Results...
==================================
OCHypg computations were cross-validated against those from the SAS/PC
PROBHYPR( N, X, n, x ) function.
REFERENCES
American Society for Quality Control Standards Committee (1981).
American National Standard: Sampling Procedures and Tables for
Inspection by Attributes, ANSI/ASQC Z1.4. American Society for
Quality Control, Milwaukee, WI 53203.
OCHypg.EXE, version 9309 ............................. Page 5 of 5
Department of Defense MIL-STD-105E (1989). Military Standard: Sampling
Procedures and Tables for Inspection by Attributes. Washington,
D.C. 20301. Comments: Commander, U.S. Army Armament Research,
Development and Engineering, ATTN: SMCAR-BAC-S/Bldg6, Picatinny
Arsenal, NJ 07806-5000.
Johnson, N.L. and Kotz, S. (1969). Distributions in Statistics:
Discrete Distributions. (Chapter 6: Hypergeometric
Distribution.) New York: John Wiley and Sons.
Lieberman, G.J. and Owen, D.B. (1961). Tables of the Hypergeometric
Probability Distribution. Stanford: Stanford University Press.
Obenchain, R.L. (1990). "AQL-LTPD.EXE: a C-language software
system for calculation of Acceptable Quality Levels (AQLs)
and Lot Tolerance Percent Defectives (LTPDs) for single-
stage sampling plans." A Quality Assurance Training Tool from
the Statistics Committee of the QC Section of the
Pharmaceutical Manufacturing Association.
SAS/PC (Release 6.04) Function: PROBHYPR( N, X, n, x ). SAS Institute
Inc.; SAS Circle; Cary, North Carolina 27512-8000.
Squeglia, N.L. (1965). "Sampling Plans for Zero Defects."
Quality Assurance 4, 28.
Squeglia, N.L. (1986). Zero Acceptance Number C=0 Sampling
Plans, 3rd Edition. American Society for Quality Control.
Milwaukee, Wisconsin.
OCHypg Software Update History:
===============================
Version 9308 ...Beta Test Version
Version 9309 ...Convert output file to .CSV format; port to Macintosh