IMSLS_SHAPIRO_WILK_W, float*shapiro_wilk_w (Output) A pointer to a scalar for the Shapiro-Wilk W test statistic.
Description
The Shapiro-Wilk test for normality is thought by D’Agostino and Stevens (1986, p. 406) to be one of the best omnibus tests of normality. The function is based on the approximations and code given by Royston (1982a, b, c; and 1991). The minimum sample size is 3 and sample sizes as large as 5000 have been validated. In the Shapiro and Wilk test, W is given by
where x(i) is the i-th largest order statistic and is the sample mean. Royston (1982 and 1991) gives approximations and tabled values that can be used to compute the coefficients ai, i = 1, …, n, and obtains the significance level of the W statistic.
Example
This example is taken from Conover (1980, pp. 195, 364). The data consists of 50 two-digit numbers taken from a telephone book. The W test fails to reject the null hypothesis of normality at the .05 level of significance.