computes the expected value of the sample range.
D2(n)
where n is the sample size, with  .
. 
            
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  . The values returned by the D2 function are accurate to ten decimal places.
. The values returned by the D2 function are accurate to ten decimal places. 
            
The value  can be expressed as
 can be expressed as 
            
| ![\[  d_2 = \int _{-\infty }^{\infty } \left[ 1- \left(1-\Phi (x)\right)^ n -\left(\Phi (x)\right)^ n \right] \;  dx  \]](images/qcug_functions0080.png) | 
where  is the standard normal cumulative distribution function. Refer to Tippett (1925). In other chapters,
 is the standard normal cumulative distribution function. Refer to Tippett (1925). In other chapters,  is written as
 is written as  to emphasize the dependence on n.
 to emphasize the dependence on n. 
            
In the SHEWHART procedure,  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).
 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  to calculate an unbiased estimate
 to calculate an unbiased estimate  of the standard deviation
 of the standard deviation  of a normal distribution from the sample range of n observations:
 of a normal distribution from the sample range of n observations: 
            
| ![\[  \hat{\sigma } = (\mbox{sample range})/d_2  \]](images/qcug_functions0083.png) | 
Note that the statistical efficiency of this estimate relative to that of the sample standard deviation decreases as n increases.