Examples - pi.science.hypothesistesting.PIShapiroWilk
1. How to check if sample belongs to a normal distribution using Shapiro-Wilk (original) test ?
PIVariable var = new PIVariable(); var.AddValues( new int[] { 65, 61, 63, 86, 70, 55, 74, 35, 72, 68, 45, 58 } ); PIShapiroWilk test = new PIShapiroWilk( var ); test.Evaluate(); Console.WriteLine( "W value = " + test.W ); Console.WriteLine( "p-value = " + test.PValue ); Console.WriteLine( test.ToString() );
Output:
W value = 0,971026084704613 p-value = 0,873681129394841 The sample belongs to a normal distribution -> accepted (0,05).