Student[Statistics] - Maple Programming Help

Home : Support : Online Help : Education : Student Package : Statistics : Student/Statistics/ShapiroWilkWTest

Student[Statistics]

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

 Calling Sequence ShapiroWilkWTest(X, level_option, output_option)

Parameters

 X - level_option - (optional) equation of the form level=float. output_option - (optional) equation of the form output=x where x is report, plot, or both

Description

 • The ShapiroWilkWTest function computes Shapiro and Wilk's W-test applied to a data sample X.  This tests whether X comes from a normally distributed population.
 • The first parameter X is the data sample to use in the analysis. It should contain between $3$ and $2000$ data points.
 • 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.
 • If the option output is not included or is specified to be output=report, then the function will return a report. If output=plot is specified, then the function will return a plot of the sample test. If output=both is specified, then both the report and the plot will be returned.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{Statistics}]\right):$

Specify the data sample.

 > $S≔\mathrm{Sample}\left(\mathrm{NormalRandomVariable}\left(5,2\right),10\right):$
 > $T≔\mathrm{Sample}\left(\mathrm{UniformRandomVariable}\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:      .967478742211855 Computed p-value:        .856735713777028   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{pvalue}}{=}{0.856735713777028}{,}{\mathrm{statistic}}{=}{0.967478742211855}\right]$ (1)
 > $\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:      .832591474899495 Computed p-value:        .0351513590317937   Result: [Rejected] This statistical test provides evidence that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{pvalue}}{=}{0.0351513590317937}{,}{\mathrm{statistic}}{=}{0.832591474899495}\right]$ (2)

If the output=plot option is included, then a plot will be returned.

 > $\mathrm{ShapiroWilkWTest}\left(S,\mathrm{level}=0.05,\mathrm{output}=\mathrm{plot}\right)$

If the output=both option is included, then both a report and a plot will be returned.

 > $\mathrm{report},\mathrm{graph}≔\mathrm{ShapiroWilkWTest}\left(T,\mathrm{level}=0.05,\mathrm{output}=\mathrm{both}\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:      .832591474899495 Computed p-value:        .0351513590317937   Result: [Rejected] This statistical test provides evidence that the null hypothesis is false. Histogram Type:  default Data Range:      4.0095669690037 .. 5.99292266316546 Bin Width:       .0661118564720588 Number of Bins:  30 Frequency Scale: relative
 > $\mathrm{report}$
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{pvalue}}{=}{0.0351513590317937}{,}{\mathrm{statistic}}{=}{0.832591474899495}\right]$ (3)
 > $\mathrm{graph}$

References

 Kanji, Gopal K. 100 Statistical Tests. London: SAGE Publications Ltd., 1994.
 Sheskin, David J. Handbook of Parametric and Nonparametric Statistical Procedures. London: CRC Press, 1997.

Compatibility

 • The Student[Statistics][ShapiroWilkWTest] command was introduced in Maple 18.