apply Shapiro and Wilk's W-test for normality of a sample - Maple Help

Home : Support : Online Help : Statistics : Statistics Package : Tests : Statistics/ShapiroWilkWTest

Statistics[ShapiroWilkWTest] - apply Shapiro and Wilk's W-test for normality of a sample

 Calling Sequence ShapiroWilkWTest(X, options)

Parameters

 X - options - (optional) equation(s) of the form option=value where option is one of level or output; specify options for the ShapiroWilkWTest function

Description

 • The ShapiroWilkWTest function computes Shapiro and Wilk's W-test applied to a data set X.  This test attempts to determine how closely a given sample matches a normal distribution.
 • The first parameter X is the data sample to use in the analysis. It should contain between $3$ and $2000$ data points.

Options

 The options argument can contain one or more of the options shown below.
 • level=float
 This option is used to specify the level of the analysis (minimum criteria for a data set to be considered roughly normal).  By default this value is 0.05.
 • output='report', 'statistic', 'pvalue', 'hypothesis', or list('statistic', 'pvalue', 'hypothesis')
 This option is used to specify the desired format of the output from the function.  If 'report' is specified then a module containing all output from this test is returned.  If a single parameter name is specified other than 'report' then that quantity alone is returned.  If a list of parameter names is specified then a list containing those quantities in the specified order will be returned.

Notes

 • This test generates a complete report of all calculations in the form of a userinfo message.  In order to access this report, specify infolevel[Statistics] := 1.

Examples

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $\mathrm{infolevel}[\mathrm{Statistics}]:=1:$

Specify the data sample.

 > $S:=\mathrm{Sample}\left(\mathrm{Normal}\left(5,2\right),10\right):$
 > $T:=\mathrm{Sample}\left(\mathrm{Uniform}\left(4,6\right),10\right):$

Calculate Shapiro and Wilk's W-test on the normally distributed sample.

 > $\mathrm{ShapiroWilkWTest}\left(S,\mathrm{level}=0.05\right)$
 Shapiro and Wilk's W-Test for Normality --------------------------------------- Null Hypothesis: Sample drawn from a population that follows a normal distribution Alt. Hypothesis: Sample drawn from population that does not follow a normal distribution Sample size:             10 Computed statistic:      0.967479 Computed pvalue:         0.856736 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 ${\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{pvalue}}{=}{0.856735713777028}{,}{\mathrm{statistic}}{=}{0.967478742211855}$ (1)

Calculate Shapiro and Wilk's W-test on the uniformly distributed sample.

 > $\mathrm{ShapiroWilkWTest}\left(T,\mathrm{level}=0.05\right)$
 Shapiro and Wilk's W-Test for Normality --------------------------------------- Null Hypothesis: Sample drawn from a population that follows a normal distribution Alt. Hypothesis: Sample drawn from population that does not follow a normal distribution Sample size:             10 Computed statistic:      0.832591 Computed pvalue:         0.0351514 Result: [Rejected] This statistical test provides evidence that the null hypothesis is false
 ${\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{pvalue}}{=}{0.0351513590317937}{,}{\mathrm{statistic}}{=}{0.832591474899495}$ (2)