The following 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.
using System; using Imsl; using Imsl.Stat; public class NormalityTestEx1 { public static void Main(String[] args) { double[] x = new double[]{ 23.0, 36.0, 54.0, 61.0, 73.0, 23.0, 37.0, 54.0, 61.0, 73.0, 24.0, 40.0, 56.0, 62.0, 74.0, 27.0, 42.0, 57.0, 63.0, 75.0, 29.0, 43.0, 57.0, 64.0, 77.0, 31.0, 43.0, 58.0, 65.0, 81.0, 32.0, 44.0, 58.0, 66.0, 87.0, 33.0, 45.0, 58.0, 68.0, 89.0, 33.0, 48.0, 58.0, 68.0, 93.0, 35.0, 48.0, 59.0, 70.0, 97.0}; NormalityTest nt = new NormalityTest(x); Console.Out.WriteLine ("p-value = " + nt.ShapiroWilkWTest().ToString("0.0000")); Console.Out.WriteLine("Shapiro Wilk W Statistic = " + nt.ShapiroWilkW.ToString("0.0000")); } }
p-value = 0.2309 Shapiro Wilk W Statistic = 0.9642Link to C# source.