One-Way Layouts: Kruskal-Wallis test for equality of location parameters Model: X(i,j) dist X + theta_i --- Test H_0: Theta are identical Example 1: Treatment #1: Control #2: Obstruc.Air.Disease #3: Asbestosis Values relate to efficiency of ciliary dust clearance. Table 6.1 in text page 192 Data in 3 treatment groups with sizes 5,4,5 Trtment #1 (n=5) 2.9 3.0 2.5 2.6 3.2 Trtment #2 (n=4) 3.8 2.7 4.0 2.4 Trtment #3 (n=5) 2.8 3.4 3.7 2.2 2.0 Number of treatment groups and total number of observations: 3 14 Assemble in a vertical array for analysis: (Columns are Ordinal, Value, Treatment group, Midrank, Tiegroups 1 2.90 1 8.0 0 2 3.00 1 9.0 0 3 2.50 1 4.0 0 4 2.60 1 5.0 0 5 3.20 1 10.0 0 6 3.80 2 13.0 0 7 2.70 2 6.0 0 8 4.00 2 14.0 0 9 2.40 2 3.0 0 10 2.80 3 7.0 0 11 3.40 3 11.0 0 12 3.70 3 12.0 0 13 2.20 3 2.0 0 14 2.00 3 1.0 0 Parallel display with midranks: 2.9 ( 8.0) 3.8 (13.0) 2.8 ( 7.0) 3.0 ( 9.0) 2.7 ( 6.0) 3.4 (11.0) 2.5 ( 4.0) 4.0 (14.0) 3.7 (12.0) 2.6 ( 5.0) 2.4 ( 3.0) 2.2 ( 2.0) 3.2 (10.0) 2.0 ( 1.0) By Treatment Group: Number, Rank Sum, Rank Average: Group #1 n=5 36.0 7.20 Group #2 n=4 36.0 9.00 Group #3 n=5 33.0 6.60 Kruskal-Wallis statistic: H = 0.771429 Large-sample chi-square approximation for H: No ties, so no tie correction needed P= 0.6800 (df=2) Doing nsims simulations for the true P-value nsims = 10000 Initializing the RNG from the system clock at startseed = 2.0843e+005 H_and_Hscore = 0.7714 801.0000 Number of simulations with values >= Hscore and total number: 7122 10000 95% CI for true P-value bracketing estimate of true pvalue: (Since H and Hscore >= 0, P-values are inherently two-sided.) 0.7033 0.7122 0.7211 Test for an alternative of monotonic treatment-group medians: The Jonckheere-Terpstra test statistic is very similar to the Kendall nonparametric correlation statistic between values and treatment-group numbers jj = 30 The Jonckheere-Terpstra test statistic mean, variance, Z-statistic, and one-sided normal P-value (assuming no ties): Jmean_Jvar_Zval_NormPval = 32.5000 72.9167 -0.2928 0.3848