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