D2 Function

computes the expected value of the sample range.

Syntax

D2(n)

where n is the sample size, with $2\leq n\leq 25$.

Description

The D2 function returns the expected value of the sample range of n independent, normally distributed random variables with the same mean and a standard deviation of 1. This expected value is referred to as the control chart constant $d_2$. The values returned by the D2 function are accurate to ten decimal places.

The value $d_2$ can be expressed as

\[  d_2 = \int _{-\infty }^{\infty } \left[ 1- \left(1-\Phi (x)\right)^ n -\left(\Phi (x)\right)^ n \right] \;  dx  \]

where $\Phi (\cdot )$ is the standard normal cumulative distribution function. Refer to Tippett (1925). In other chapters, $d_2$ is written as $d_2(n)$ to emphasize the dependence on n.

In the SHEWHART procedure, $d_2$ is used to calculate control limits for r charts, and it is used in the estimation of the process standard deviation based on subgroup ranges. Also refer to the American Society for Quality Control (1983), the American Society for Testing and Materials (1976), Kume (1985), Montgomery (1996), and Wadsworth, Stephens, and Godfrey (1986).

You can use the constant $d_2$ to calculate an unbiased estimate $(\hat{\sigma })$ of the standard deviation $\sigma $ of a normal distribution from the sample range of n observations:

\[  \hat{\sigma } = (\mbox{sample range})/d_2  \]

Note that the statistical efficiency of this estimate relative to that of the sample standard deviation decreases as n increases.

Examples

The following statements result in a value of 2.3259289473:

data;
   constant=d2(5);
   put constant;
run;