Returns the pvalue of the normality test (i.e. whether a data set is wellmodeled by a normal distribution).
Syntax
NormalityTest(X, Method, Return_type, Alpha)
 X
 is the input data sample (one/two dimensional array of cells (e.g. rows or columns)).
 Method
 the statistical test to perform (1=JarqueBera, 2=ShapiroWilk, 3=ChiSquare (Doornik and Hansen)).
Method Description 1 JarqueBera test 2 ShapiroWilk test 3 Doornik ChiSquare test  Return_type
 is a switch to select the return output (1 = PValue (default), 2 = Test Stats, 3 = Critical Value.
Method Description 1 PValue 2 Test Statistics (e.g. Zscore) 3 Critical Value  Alpha
 is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.
Remarks
 The sample data may include missing values (e.g. a time series as a result of a lag or difference operator).
 The ShapiroWilk test This test is best suited to samples of less than 5000 observations
 The JarqueBera test This test is more powerful the higher the number of values.
 The test hypothesis for the data is from a normal distribution:
$H_{o}: x \sim N(.)$
$H_{1}: x \neq N(.)$
Where:
 $H_{o}$ is the null hypothesis.
 $H_{1}$ is the alternate hypothesis.
 $N(.)$ is the normal probability distribution function.
 The JarqueBera test is a goodnessoffit measure of departure from normality based on the sample kurtosis and skewness. The test is named after Carlos M. Jarque and Anil K. Bera. The test statistic JB is defined as:
$$\mathit{JB} = \frac{n}{6} \left( S^2 + \frac{K^2}{4} \right)$$
Where:
 $S$ is the sample skewness.
 $K$ is the sample excess kurtosis.
 $n$ is the number of nonmissing values in the data sample.
 The JarqueBera $\mathit{JB}$ statistic has an asymptotic chisquare distribution with two degrees of freedom and can be used to test the null hypothesis that the data is from a normal distribution.
$\mathit{JB} \sim \chi_{\nu=2}^2() $
Where:
 $\chi_{\nu}^2()$ is the Chisquare probability distribution function.
 $\nu$ is the degrees of freedom for the Chisquare distribution.
 This is oneside (i.e. onetail) test, so the computed pvalue should be compared with the whole significance level ($\alpha$).
Examples
Example 1:


Formula  Description (Result) 

=NormalityTest($B$2:$B$11,1)  JarqueBera test (0.7711) 
=NormalityTest($B$2:$B$11,2)  ShapiroWilk test (0.8003) 
=NormalityTest($B$2:$B$11,3)  Doornik ChiSquare test (0.7136) 
Files Examples
Related Links
 Wikipedia  Portmanteau test
 Wikipedia  JarqueBera test
 Wikipedia  ShapiroWilk Normality test
 Shapiro, S. S. and Wilk, M. B. (1965). "An analysis of variance test for normality (complete samples)", Biometrika, 52, 3 and 4, pages 591611
References
 Jarque, Carlos M.; Anil K. Bera (1980). "Efficient tests for normality, homoscedasticity and serial independence of regression residuals". Economics Letters 6 (3): 255259.
 Ljung, G. M. and Box, G. E. P., "On a measure of lack of fit in time series models." Biometrika 65 (1978): 297303
 Enders, W., "Applied econometric time series", John Wiley & Sons, 1995, p. 8687
 Shapiro, S. S. and Wilk, M. B. (1965). "An analysis of variance test for normality (complete samples)", Biometrika, 52, 3 and 4, pages 591611
Comments
Article is closed for comments.