Skip to main content

StatsKWTest

StatsKWTest [/ALPH=significance /Q/Z/T=k /WSTR=wList ] [wave1, wave2,... wave100 ]

The StatsKWTest operation performs the nonparametric Kruskal-Wallis test which tests variances using the ranks of the data. Output is to the W_KWTestResults wave in the current data folder.

Flags

/ALPH=valSets the significance level (default val =0.05).
/DEST=kwWaveSpecify the destination wave for the nonparametric Kruskal-Wallis test results. If you do not use this flag, the operation saves the output in the wave W_KWTestResults in the current data folder.
This flag was added in Igor Pro 10.00.
/EComputes the exact P-value using the Klotz and Teng algorithm, which may require long computation times for large data sets. You can stop the calculation by pressing the User Abort Key Combinations after which all remaining results remain valid and the exact P-value is set to NaN.
/FREECreates the user-specified destination wave as a free wave.
/FREE is allowed only in functions, and only if the destination waves are simple names or wave reference structure fields.
See Free Waves for more discussion.
The /FREE flag was added in Igor Pro 10.00.
/QNo results printed in the history area.
/T=kDisplays results in a table. k specifies the table behavior when it is closed.
k =0:Normal with dialog (default).
k =1:Kills with no dialog.
k =2:Disables killing.
/WSTR=waveListString
Specifies a string containing a semicolon-separated list of waves that contain sample data. Use waveListString instead of listing each wave after the flags.
/ZIgnores errors. V_flag will be set to -1 for any error and to zero otherwise.

Details

Inputs are two or more 1D numerical waves (one for each group of samples). Use NaNs for missing data or use waves with different number of points.

StatsKWTest always computes the critical values using both the Chi-squared and Wallace approximations. If appropriate (small enough data set) you can also use /E to obtain the exact P value. When the calculation involves many waves or many data points the calculation of the exact critical value can be very lengthy. All the results are saved in the wave W_KWTestResults in the current data folder and are optionally displayed in a table (/T). The wave contains the following information:

RowData
0Number of groups
1Number of valid data points (excludes NaNs)
2Alpha
3Kruskal-Wallis Statistic H
4Chi-squared approximation for the critical value Hc
5Chi-squared approximation for the P value
6Wallace approximation for the critical value Hc
7Wallace approximation for the P value
8Exact P value (requires /E)

H0 for the Kruskal-Wallis test is that all input waves are the same. If the test fails and the input consisted of more than two waves, there is no indication for possible agreement between some of the waves. See StatsNPMCTest for further analysis.

V_flag will be set to -1 for any error and to zero otherwise.

References

Zar, J.H., Biostatistical Analysis, 4th ed., 929 pp., Prentice Hall, Englewood Cliffs, New Jersey, 1999.

Wallace, D.L., Simplified Beta-Approximation To The Kruskal-Wallis H Test, Jour. Am. Stat. Assoc., 54, 225-230, 1959.

J.H. Klotz, Computational Approach to Statistics.

Klotz, J. and Teng, J. (1977). One-way layout for counts and the exact enumeration of the Kruskal-Wallis H distribution with ties. Journal of the American Statistical Association 72, 165-169.

See Also

Statistical Analysis, StatsWilcoxonRankTest, StatsNPMCTest, StatsAngularDistanceTest

Demos

Open Kruskal-Wallis Demo.pxp