Logo

HYPGEOMDISTP

Updated 2024-03-08 16:33:16.647000

Syntax

SELECT [westclintech].[wct].[HYPGEOMDISTP] (
  <@Sample_s, float,>
 ,<@Number_sample, float,>
 ,<@Population_s, float,>
 ,<@Number_population, float,>)

Description

Use the scalar function HYPGEOMDISTP to calculate the lower cumulative distribution of the hypergeometric function. The formula is:

P(k;N,m,n)=\sum_{t=0}^{k}f(t;N,m,n)

where f(t; N, m, n) is the probability mass function and

{
    "columns": [
        {
            "field": "column 1",
            "maxWidth": 100
        },
        {
            "field": "column 2",
            "maxWidth": 325
        }
    ],
    "rows": [
        {
            "column 1": "k",
            "column 2": "is the number of successes in the sample"
        },
        {
            "column 1": "N",
            "column 2": "is the size of the sample"
        },
        {
            "column 1": "m",
            "column 2": "is the number of successes in the population"
        },
        {
            "column 1": "n",
            "column 2": "is the population size"
        }
    ]
}

Arguments

@Number_population

is the population size. @Number_population is an expression of type float or of a type that can be implicitly converted to float.

@Number_sample

is the size of the sample. @Number_sample is an expression of type float or of a type that can be implicitly converted to float.

@Sample_s

is the number of successes in the sample. @Sample_s is an expression of type float or of a type that can be implicitly converted to float.

@Population_s

is the number of successes in the population. @Population_s is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Sample_s < 0 or @Sample_s > MIN(@Number_sample, @Population_s), HYPGEOMDISTP returns an error.

If @Sample_s < MAX(0, @Number_sample - @Number_population + @Population_s), HYPGEOMDISTP returns an error.

If @Number_sample = 0 or @Number_sample > @Number_population, HYPGEOMDISTP returns an error.

If @Population_s = 0 or @Population_s > @Number_populations, HYPGEOMDISTP returns an error.

If @Number_population = 0, HYPGEOMDISTP returns an error.

Examples

SELECT wct.HYPGEOMDISTP(20, 900, 45, 2000);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.532069788839458"}]}