<< ST_ivplot Distribution-Tests Outlier-Tests >>

samplestat >> samplestat > Distribution-Tests > ST_shapirowilk

ST_shapirowilk

Shapiro-Wilk test of normality

Calling Sequence

[normal] = ST_shapirowilk(v, p)

Parameters

v:

m-by-1 or 1-by-n matrix of doubles

p:

statistical confidence level (%) as a string or the level of significance (alpha) as a decimal value, "90%", "95%", "99%" or 0.1, 0.05, 0.01 resp. (see examples).

normal:

Returns %T if sample distribution is normally distributed or %F if not.

Description

The Shapiro-Wilk test is a statistical significance test that tests the hypothesis that the underlying population of a sample is normally distributed.

The Shapiro-Wilk test exhibiting high power, leading to good results even with a small number of observations. In contrast to other comparison tests the Shapiro-Wilk test is only applicable to check for normality.

The test can be used for sample sizes from 3 to 50 values.

The theory behind Shapiro-Wilk can be find at Distribution Overview.

The test reacts very sensitively to outliers, both for one-sided and two-sided ones. Outliers can strongly distort the distribution pattern so that the normal distribution assumption could be erroneously rejected.

The test is relatively susceptible to Ties, i.e. if there are many identical values, the test strength is strongly affected.

Although the Shapiro-Wilk test has a big test strength, especially for smaller sample sizes, it should not be used blindfolded for the reasons mentioned above.

Check the results graphically with individual value plot, histogram, QQ-plot or box-plot. The latter two are provided in the toolbox STIXBOX.

Examples

scf();
data1 = [200, 545, 290, 165, 190, 355, 185, 205, 175, 255];
normal = ST_shapirowilk(data1, "95%") // normal = %F => non-normally distr.
ST_ivplot(data1,"data1");
scf();
data2 = [-15.6, -21.6, -19.5, -19.1, -20.9, -20.7, -19.3, -18.3, -15.1];
normal = ST_shapirowilk(data2, "95%") // normal = %T => normally distributed
ST_ivplot(data2,"data2");

See also

Authors

Bibliography


Report an issue
<< ST_ivplot Distribution-Tests Outlier-Tests >>