2.1.24.7.7 ocmath_shapiro_wilk_test_R94


Description

Function to preform Shapiro-Wilk test for normality with Algorithm R94

Syntax

int ocmath_shapiro_wilk_test_R94( double * pX, UINT N, double * W, double * PW, int * nErr )

Parameters

pX
[Input]pointer to ordered sample values
N
[Input]value indicates sample size
W
[Output]W Statistic
PW
[Output]significance level of W
nErr
[Output]fault indicator, equal to
0 for no fault
1 if N < 3
2 if N > 5000

Return

Returns STATS_NO_ERROR on successful exit.

Examples

EX1

void ocmath_shapiro_wilk_test_R94_ex1()
{
   int nRet;
   double X[] = {0.139,0.157,0.175,0.256,0.344,0.413,0.503,0.577,0.614,
           0.655,0.954,1.392,1.577,1.648,1.690,1.994,2.174,2.206,
           3.245,3.510,3.571,4.354,4.980,6.084,8.351};
   int N = 25;
   double W, PW;
   int nErr = 10;
   nRet = ocmath_shapiro_wilk_test_R94(X, N, &W, &PW, &nErr);
   printf("W=%d, PW=%d\n", W, PW);// print out W and PW values.
}

Remark

See Also

Header to Included

origin.h

Reference

1> Royston J P (1995) ALGORITHM AS R94:A Remark on Algorithm AS181: The W Test for Normality APPL. STATIST. (1995) VOL.441> Royston J P (1995) ALGORITHM AS R94:A Remark on Algorithm AS181: The W Test for Normality APPL. STATIST. (1995) VOL.44, NO.4