Dew Stats Master .NET
ShapiroFrancia Routine
Summary
The Shapiro-Francia test for normality of data.

Unit
Statistics

Declaration
Function ShapiroFrancia(Data: TVec; out hRes: THypothesisResult; out Signif: TSample; hType: THypothesisType = htTwoTailed; Alpha: TSample = 0.05): TSample;
 Parameter  Description 
Data Data vector, containing ordered and unique deviates from unknown distribution. 
hRes Returns the result of the null hypothesis (default assumption is that data comes from normal distribution). 
hType Defines the type of the null hypothesis (left, right and two - tailed). 
Signif (Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true. 
Alpha Defines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected. 
Result
the Shapiro-Francia statistics.
Description
Performs the The Shapiro-Francia test for normality of data.
Categories
Hypothesis testing
 See Also 
Unique 
ShapiroWilks 

Example 1

In this example we'll use Shapiro-Francia test to determine if data is coming from normal distribution.

Uses MtxExpr, Math387, Statistics; procedure Example; var avec,bvec: Vector; hres: THypothesisResult; Signif: TSample; begin avec.Size(1000,false); RandomWeibull(2.5,1,avec); // filter original data, retain only sorted unique values Unique(avec,bvec); ShapiroFrancia(bvec,hres,signif); // Significance approx. 0 // hres = hrReject -> data is not coming from normal distribution end;
#include "MtxVecCpp.h" #include "Math387.hpp" #include "Statistics.hpp" void __fastcall Example(); { Vector a,b; a->Size(1000,false); RandomWeibull(2.5,1.0,a); // filter original data, retain only sorted unique values Unique(a,b); THypothesisResult hres; double sign; ShapiroFrancia(b,hres, sign,htTwoTailed,0.05); // Significance approx. 0 // hres = hrReject -> data is not coming from normal distribution }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector a = new Vector(0); Vector b = new Vector(0); a.Size(1000,false); StatRandom.RandomWeibull(2.5,1.0,a); // filter original data, retain only sorted unique values Statistics.Unique(a,b); THypothesisResult hres; double sign; ShapiroFrancia(b,out hres, out sign,THypothesisType.htTwoTailed,0.05); // Significance approx. 0 // hres = hrReject -> data is not coming from normal distribution } }


Copyright 2008 Dew Research
http://www.dewresearch.com