PROBHYPR Function

computes the probability that an observation from a hypergeometric distribution is less than or equal to .

Syntax

PROBHYPR

where

is the population size for a hypergeometric distribution. In terms of acceptance sampling, is the lot size.

is the number of items in the category of interest in the population. In terms of acceptance sampling, is the number of nonconforming items in a lot.

is the sample size for a hypergeometric distribution. In terms of acceptance sampling, is the sample size.

is the number of items from the category of interest in the sample. In terms of acceptance sampling, is the number of nonconforming items in the sample.

is optional and gives the odds ratio for the extended hypergeometric distribution. For the standard hypergeometric distribution, ; this value is the default. In acceptance sampling, typically .

Restrictions on items in the syntax are given in the following equations:

     

Description

The PROBHYPR function returns the probability that an observation from an extended hypergeometric distribution with parameters , and and an odds ratio of is less than or equal to . The default for is 1 and leads to the usual hypergeometric distribution.

In terms of acceptance sampling, if , the PROBHYPR function gives the probability of or fewer nonconforming items in a sample of size taken from a lot containing items, of which are nonconforming, when sampling is done without replacement. Typically 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 , the function returns the probability of selecting 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 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 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 (the default), the PROBHYPR function calculates probabilities from the usual hypergeometric distribution:

     

where

     

The PROBHYPR function accepts values other than 1 for , and in these cases, it calculates the probability for the extended hypergeometric distribution:

     

where

     

where

is binomially distributed with parameters K and .

is binomially distributed with parameters N-K and .

For details on the extended hypergeometric distribution, refer to Johnson and Kotz (1969).

Examples

Suppose you take a sample of size 10 (without replacement) from an urn that contains 200 balls, 50 of which are white. The remaining 150 balls are red. The following statements calculate the probability that your sample contains 2 or fewer white balls:

 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 and the probability of choosing a white ball is . Calculate as

     

With , 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 Functions and CALL Routines: Reference.