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 >
Text File  |  1993-09-15  |  13KB  |  263 lines

  1.  
  2.  
  3.  
  4.          ┌───────────────────────────────────────────────────────────────┐
  5.          │       Calculation of the Operating Characteristic Curve       │
  6.          │       for Single-Stage Sampling from Finite Populations       │
  7.          │                                                               │
  8.          │                 OCHYPG.EXE....Version 9309                    │
  9.          ├───────────────────────────────────────────────────────────────┤
  10.          │              A Quality Assurance Training Tool:               │
  11.          │       Statistics Committee of the QA Section of the PMA       │
  12.          │                                                               │
  13.          │         PMA = Pharmaceutical Manufacturing Association        │
  14.          │                                                               │
  15.          │           Bob Obenchain, CompuServe User [72007,467]          │
  16.          │                                                               │
  17.          └───────────────────────────────────────────────────────────────┘
  18.  
  19.        Given a "Sample Size" and an "Accept Number" for nonconformances in
  20.        single-stage random sampling without replacement from a Lot (batch,
  21.        population) of specified, finite size, OCHypg.EXE computes points on
  22.        the "Operating Characteristic" (OC) curve.  The OC curve gives the
  23.        Probability of Lot Acceptance as a function of the Fraction Defective
  24.        in the Lot.  This is a straight-forward application for the so-called
  25.        "hypergeometric" distribution, Johnson and Kotz(1969), Chapter 6.
  26.  
  27.        OC curves for standard sampling plans, such as those in MIL-STD-105E
  28.        (1989) and ANSI/ASQC Z1.4 (1981), are frequently evaluated using
  29.        "binomial" distribution methods, as if the lot size were infinite.
  30.        [Monte-Carlo methods are typically combined with a binomial model to
  31.        simulate the effect on the OC curve of switching rules between
  32.        Reduced, Normal, and Tightened inspection levels.]  On the other hand,
  33.        the single-stage, Zero Acceptance Number (c=0) sampling plans of
  34.        Squeglia(1986) are based upon exact hypergeometric calculations for
  35.        finite lot sizes.
  36.  
  37.        By convention, OC curves for a sampling plan always give the
  38.        probability that a lot will be found to be acceptable as a function of
  39.        the true (unknown) nonconformance rate, p, incoming for inspection.
  40.        But, when sampling from a finite population of size N, the only
  41.        possible values for p are integer multiples of 1/N.  In other words,
  42.        the OC curve for finite population sampling is defined only at p =
  43.        k/N, where k is an integer in the range 0 <= k <= N.
  44.  
  45.        The probability of lot acceptance will be monotone, strictly
  46.        decreasing as k increases as long as the Accept Number = c is less
  47.        than the Sample Size = n.  (The implicit Reject Number in single-stage
  48.        sampling is r = c + 1.)  The OC curve starts out at 1 for p=0
  49.        (left-hand extreme) and ends at 0 for p=1 (right-hand extreme) in
  50.        these c < n cases.
  51.  
  52.        The Acceptable Quality Level (AQL) fraction is then the right-most
  53.        p=k/N value such that the OC curve lies above the desired Yield
  54.        fraction (usually 0.95 or .99) everywhere to its left.  And the Lot
  55.        Tolerance Percent Defective (LTPD) fraction is the left-most p=k/N
  56.          OCHypg.EXE, version 9309 ............................. Page 2 of 5
  57.  
  58.  
  59.  
  60.        value such that the OC curve lies below the desired 1-Yield fraction
  61.        (usually 0.10 or 0.05) everywhere to its right.
  62.  
  63.  
  64.        OCHypg Prompts and Parameter Limits...            MIN              MAX
  65.        ======================================
  66.  
  67.        What is the Population Size ? [N] :                 2        2,000,000
  68.  
  69.        What is the Sample Size ? [n] :                     1              N-1
  70.  
  71.        What is the Accept Number ? [c] :                   0              n-1
  72.        Implied Reject Number: r = c + 1                    1                n
  73.  
  74.        True Fraction Nonconforming ?                     0.0              1.0
  75.  
  76.        However, calculations need only be performed when
  77.        the implied number of nonconforming items is...     1              N-1
  78.  
  79.  
  80.        Example Batch Input Files...
  81.        ============================
  82.  
  83.        OCHYPG21.INP ...Batch Input Files for either 21 or 51 equally spaced
  84.        OCHYPG51.INP    values (every 5% or every 2%) of Fraction Defective
  85.                        Incoming for Inspection.
  86.  
  87.        NOTE: Batch input files must have a filename extension of ".INP" and
  88.              must be formatted EXACTLY as shown below...
  89.        -------------------------------------------------------------------
  90.  
  91.        filename    <-- DOS filename for the OCHypg output .OUT file
  92.        10000       <-- first N       = population size
  93.        20          <-- first n       = sample size
  94.        0           <-- first c       = accept number
  95.        0.05        <-- first fraction defective               \  note that
  96.        y           <-- the character "y" or else a blank line /  these lines
  97.        0.10        <-- second fraction defective              \  always come
  98.        y           <-- the character "y" or else a blank line /  in pairs...
  99.        0.15        <-- third fraction defective               \
  100.        y           <-- the character "y" or else a blank line /
  101.          ...etc
  102.        0.95        <-- last fraction defective               \
  103.        n           <-- the character "n"                     /
  104.        y           <-- the character "y" or else a blank line ...NEXT N,n,c
  105.        10000       <-- second N      = population size
  106.        125         <-- second n      = sample size
  107.        10          <-- second c      = accept number
  108.        0.05        <-- first fraction defective               \  note that
  109.        y           <-- the character "y" or else a blank line /  these lines
  110.        0.10        <-- second fraction defective              \  always come
  111.        y           <-- the character "y" or else a blank line /  in pairs...
  112.        0.15        <-- third fraction defective               \
  113.          OCHypg.EXE, version 9309 ............................. Page 3 of 5
  114.  
  115.  
  116.  
  117.        y           <-- the character "y" or else a blank line /
  118.          ...etc
  119.        0.95        <-- last fraction defective               \
  120.        n           <-- the character "n"                     /
  121.        n           <-- the character "n" ...No more N,n,c values
  122.  
  123.        Invoking OCHypg...
  124.        ====================
  125.        Enter the following command at your DOS prompt...
  126.  
  127.                                 DOSprompt>    ochypg
  128.  
  129.        OCHypg will then prompt you to choose between K = keyboard and B =
  130.        batch-data-file entry.  Press the K key to use your keyboard console to
  131.        respond to OCHypg's remaining prompts for input.  Each prompt displays
  132.        a [default] value that you may accept simply by pressing the ENTER (or
  133.        RETURN) key.  Otherwise, type in the numerical value or character string
  134.        you wish, and then press ENTER.
  135.  
  136.        If you choose batch input by pressing the B key, OCHypg will prompt
  137.        you to type in a filename (of at most 8 characters) for an .INP file you
  138.        have previously created with your favorite ASCII/text editor.  Don't
  139.        type the period (.) or the filename extenstion (INP); press ENTER to
  140.        start OCHypg calculations.  This batch input option allows you to
  141.        queue up, say, an entire series of calculations to be performed while
  142.        you are off doing something else!
  143.  
  144.  
  145.        The OCHypg Output File: filename.CSV
  146.        ======================================
  147.        The OCHypg output file saves the information that is displayed on your
  148.        computer screen in a Comma Separated Values (.CSV) format file.  Thus
  149.        you usually do not need to take any handwitten notes as OCHypg
  150.        executes.  These files are ideal for data import into Microsoft Excel
  151.        so that you may plot/print the Operating Characteristic Curve.
  152.  
  153.        You can also review the OCHypg output file on your computer screen by
  154.        entering the command:
  155.  
  156.                      DOSprompt>   type filename.csv | more
  157.  
  158.        or you can get a paper copy of the OCHypg output file by entering the
  159.        command:
  160.                      DOSprompt>   print filename.csv
  161.  
  162.        The output file will echo all Parameter Settings specified by the user
  163.        (or the batch input file) as well as give a complete listion of OCHypg
  164.        calculation results...
  165.  
  166.              Population Size,N = 3200,,
  167.              Sample Size,n = 18,,
  168.              Acceptance Number,c = 0,,
  169.          OCHypg.EXE, version 9309 ............................. Page 4 of 5
  170.  
  171.  
  172.  
  173.              Fraction Nonconforming, Probability of Acceptance, Nonconforms,Population
  174.              0.10000,0.14930,320,3200
  175.              0.12000,0.09951,384,3200
  176.              0.11000,0.12202,352,3200
  177.              0.00094,0.98321,3,3200
  178.              0.00063,0.98878,2,3200
  179.              0.00031,0.99438,1,3200
  180.  
  181.              Population Size,N = 3200,,
  182.              Sample Size,n = 125,,
  183.              Acceptance Number,c = 10,,
  184.  
  185.              Fraction Nonconforming, Probability of Acceptance,Nonconforms,Population
  186.              0.10000,0.27966,320,3200
  187.              0.12000,0.09882,384,3200
  188.              0.11000,0.17224,352,3200
  189.              0.05000,0.95423,160,3200
  190.              0.04000,0.98967,128,3200
  191.              0.03000,0.99892,96,3200
  192.  
  193.        When the lot size is 3200, the above calculations illustrate Figure
  194.        1.2, page 6, of Squeglia(1986).  Namely, the two plans (n=125, c=10)
  195.        and (n=18,c=0) have comparable 10% LTPD's of approximately p=0.12.  On
  196.        the other hand, (n=125, c=10) has a 99% AQL of approximately p=0.04
  197.        while that of (n=18,c=0) is only p=0.00031 (1 in 3200.)
  198.  
  199.  
  200.        Execution   The time required to perform OCHypg.EXE calculations
  201.        Time:       depends upon the speed of your Personal Computer and
  202.        =========   upon whether your PC has a numeric math co-processor chip.
  203.                    On a slow machine, a numeric math co-processor can speed
  204.                    calculations by a factor of 10.
  205.  
  206.        Source Code...
  207.        ==============
  208.        The C-language source code for OCHypg is provided in the file named
  209.        OCHypg.C.
  210.  
  211.  
  212.        Validation of Numerical Results...
  213.        ==================================
  214.        OCHypg computations were cross-validated against those from the SAS/PC
  215.        PROBHYPR( N, X, n, x ) function.
  216.  
  217.  
  218.                                       REFERENCES
  219.  
  220.        American Society for Quality Control Standards Committee (1981).
  221.                American National Standard: Sampling Procedures and Tables for
  222.                Inspection by Attributes, ANSI/ASQC Z1.4.  American Society for
  223.                Quality Control, Milwaukee, WI 53203.
  224.          OCHypg.EXE, version 9309 ............................. Page 5 of 5
  225.  
  226.  
  227.  
  228.        Department of Defense MIL-STD-105E (1989).  Military Standard: Sampling
  229.                Procedures and Tables for Inspection by Attributes.  Washington,
  230.                D.C. 20301.  Comments: Commander, U.S. Army Armament Research,
  231.                Development and Engineering, ATTN: SMCAR-BAC-S/Bldg6, Picatinny
  232.                Arsenal, NJ 07806-5000.
  233.  
  234.        Johnson, N.L. and Kotz, S. (1969).  Distributions in Statistics:
  235.                Discrete Distributions.  (Chapter 6: Hypergeometric
  236.                Distribution.)  New York: John Wiley and Sons.
  237.  
  238.        Lieberman, G.J. and Owen, D.B. (1961).  Tables of the Hypergeometric
  239.                Probability Distribution.  Stanford: Stanford University Press.
  240.  
  241.        Obenchain, R.L. (1990).  "AQL-LTPD.EXE: a C-language software
  242.                system for calculation of Acceptable Quality Levels (AQLs)
  243.                and Lot Tolerance Percent Defectives (LTPDs) for single-
  244.                stage sampling plans."  A Quality Assurance Training Tool from
  245.                the Statistics Committee of the QC Section of the
  246.                Pharmaceutical Manufacturing Association.
  247.  
  248.        SAS/PC (Release 6.04) Function: PROBHYPR( N, X, n, x ).  SAS Institute
  249.                Inc.; SAS Circle; Cary, North Carolina 27512-8000.
  250.  
  251.        Squeglia, N.L.  (1965).  "Sampling Plans for Zero Defects."
  252.                Quality Assurance 4, 28.
  253.  
  254.        Squeglia, N.L.  (1986).  Zero Acceptance Number C=0 Sampling
  255.                Plans, 3rd Edition.  American Society for Quality Control.
  256.                Milwaukee, Wisconsin.
  257.  
  258.        OCHypg Software Update History:
  259.        ===============================
  260.  
  261.        Version 9308 ...Beta Test Version
  262.        Version 9309 ...Convert output file to .CSV format; port to Macintosh
  263.