Chapter Contents |
Previous |
Next |
Functions |
where
N | is the population size for a hypergeometric distribution. In terms of acceptance sampling, N is the lot size. |
K | is the number of items in the category of interest in the population. In terms of acceptance sampling, K is the number of nonconforming items in a lot. |
n | is the sample size for a hypergeometric distribution. In terms of acceptance sampling, n is the sample size. |
x | is the number of items from the category of interest in the sample. In terms of acceptance sampling, x is the number of nonconforming items in the sample. |
r | is optional and gives the odds ratio for the extended hypergeometric distribution. For the standard hypergeometric distribution, r=1; this value is the default. In acceptance sampling, typically r=1. |
Restrictions on items in the syntax are given in the following
equations:
In terms of acceptance sampling, if r=1, the PROBHYPR function gives the probability of x or fewer nonconforming items in a sample of size n taken from a lot containing N items, K of which are nonconforming, when sampling is done without replacement. Typically r=1 in acceptance sampling.
For example, suppose an urn contains red and white balls, and you are interested in the probability of selecting a white ball. If r=1, the function returns the probability of selecting x white balls when given the population size (number of balls in the urn), sample size (number of balls taken from the urn), and number of white balls in the population (urn).
If, however, the probability of selecting a white ball differs from the probability of selecting a red ball, then .Suppose an urn contains one white ball and one red ball, and the probability of choosing the red ball is higher than the probability of choosing the white ball. This might occur if the red ball were larger than the white ball, for example. Given the probabilities of choosing a red ball and a white ball when an urn contains one of each, you calculate r and use the value in the PROBHYPR function. Returning to the case where an urn contains many balls with , the function gives the probability of selecting x white balls when given the number of balls in the urn, the number of balls taken from the urn, the number of white balls in the urn, and the relative probability of selecting a white ball or a red ball.
The PROBHYPR function is used to evaluate Type A single-sampling plans. See "Evaluating Single-Sampling Plans" for details.
If r=1 (the default), the PROBHYPR function calculates probabilities
from the usual hypergeometric distribution:
where
The PROBHYPR function accepts values other than 1 for r, and in these cases, it calculates the probability for the extended hypergeometric distribution:
where
X_{1} | is binomially distributed with parameters K and p_{1}. |
X_{2} | is binomially distributed with parameters N-K and p_{2}. |
q_{1} | =1-p_{1} |
q_{2} | =1-p_{2} |
r | =(p_{1}q_{2})/(p_{2}q_{1}) |
For details on the extended hypergeometric distribution, refer to Johnson and Kotz (1969).
data; y=probhypr(200,50,10,2); put y; run;
These statements result in a value of 0.5236734081. Now, suppose the probability of selecting a red ball does not equal the probability of selecting a white ball. Specifically, suppose the probability of choosing a red ball is p_{2}=0.4 and the probability of choosing a white ball is p_{1}=0.2. Calculate r as
With r=0.375, the probability of choosing 2 or fewer white balls from an urn that contains 200 balls, 50 of which are white, is calculated using the following statements:
data; y=probhypr(200,50,10,2,0.375); put y; run;
These statements return a value of 0.9053936127. See "Evaluating Single-Sampling Plans" for another example.
For additional information on probability functions, refer to SAS Language Reference: Dictionary.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.