In the table below, contains the information after initial nonparametric Kruskal-Wallis test ANOVA in data set with different samples sizes in each group and with 20 groups (k=20) that yielded a highly signigicant p value. Assume that the C12 column of Minitab contains the sample sizes for different groups and C14 contains the average ranks for each group. One wishes to do pair-wise comparions for all the possible 190 pairs i.e k(k-1)/2 to identify where the difference exists. Alternatively, if one could wish to compare with a base-line value at a particular time period. In such a case, there would be 19 pair-wise comparisons i.e (k-1).
C11 |
C12 |
C13 |
C14 |
1 |
41 |
|
534.5 |
2 |
56 |
|
670.1 |
3 |
50 |
|
298 |
4 |
82 |
|
628 |
5 |
76 |
|
793.5 |
6 |
29 |
|
393.2 |
7 |
74 |
|
573.1 |
8 |
51 |
|
336.9 |
9 |
53 |
|
722.6 |
10 |
73 |
|
755.4 |
11 |
42 |
|
247.6 |
12 |
67 |
|
424.8 |
13 |
15 |
|
669.3 |
14 |
74 |
|
169.3 |
15 |
38 |
|
795 |
16 |
12 |
|
118.5 |
17 |
24 |
|
282.6 |
18 |
25 |
|
789.4 |
19 |
78 |
|
655.6 |
20 |
99 |
|
403.7 |
The macro invoked by the following command assuming the macro text file is name phft.mac
%phkw c12 c14
Aternatively the macro could be invoked by named cloumns
%phft ‘sskw’ ‘arkw’
After the macro is invoked, the user is asked whether one wishes to do all pair-wise comparisons or
The macro uses the input from two columns in the Minitab’s worksheet: one column with sample sizes for different groups and average ranks in another column. The macro is invoked by the following command: %phft c12 c14, if the sample sizes and average ranks are entered in Columns 12 and 14 respectively of Mintab’s worksheet. After the macro is invoked, the user is asked whether the all pair-wise comparisons are required or comparisons with baseline value are required. In the latter case, the user is asked the group number to be compared. After the appropriate response from the user, the macro performs the required calculations and yields an output.
Description of output in the sessions window of Minitab from 1 to 10 columns respectively are serial number of comparisons, rank sums, group number of time periods, pair of time periods that are being compared, pair of corresponding rank sums, difference in average ranks, significance at 0.05 level (1 for yes, 0 for no) and significance at 0.01.
MTB > %phkw c12 c14
Executing from file: C:\MTBWIN\MACROS\phkw.MAC
This is a macro for Posthoc analysis after Friedman test either multigroup comparison or comparison againt a single control .
For computational details refer to
Nonparametric statistics for behavioural sciences
Siegel S and Castellan NJ, 2nd edition, 1988 , McGraw Hill, Inc, New York
, page 213-215
PLEASE REMEMBER TO ENTER THE AVERAGE RANKS IN THE INPUT COLUMN
What type of post hoc analysis you wish to perform
Type YES & enter for multipgroup comparison. Type NO & enter for single
group comparison
yes
Data Display
Row C14
ccgb ccga dcolb
dcola diffcol sig05
sig01
1 534.5
1 2 534.5
670.1 135.600 0
0
2 670.1
1 3 534.5
298.0 -236.500 1
0
3 298.0
1 4 534.5
628.0 93.500 0
0
4 628.0
1 5 534.5
793.5 259.000 1
1
5 793.5
1 6 534.5
393.2 -141.300 0
0
6 393.2
1 7 534.5
573.1 38.600 0
0
7 573.1
1 8 534.5
336.9 -197.600 0
0
8 336.9
1 9 534.5
722.6 188.100 0
0
9 722.6
1 10 534.5
755.4 220.900 1
0
10 755.4
1 11 534.5
247.6 -286.900 1
1
11 247.6
1 12 534.5
424.8 -109.700 0
0
12 424.8
1 13 534.5
669.3 134.800 0
0
13 669.3
1 14 534.5
169.3 -365.200 1
1
14 169.3
1 15 534.5
795.0 260.500 1
0
15 795.0
1 16 534.5 118.5 -416.000 1 1
16 118.5
1 17 534.5
282.6 -251.900 0
0
17 282.6
1 18 534.5
789.4 254.900 0
0
18 789.4
1 19 534.5
655.6 121.100 0
0
19 655.6
1 20 534.5 403.7
-130.800 0 0
20 403.7
2 3 670.1
298.0 -372.100 1
1
21 2 4 670.1 628.0
-42.100 0 0
22 2 5 670.1 793.5
123.400 0 0
23 2 6 670.1 393.2
-276.900 1 0
24 2 7 670.1 573.1
-97.000 0 0
25 2 8 670.1 336.9
-333.200 1 1
26 2 9 670.1 722.6
52.500 0 0
27 2 10 670.1 755.4
85.300 0 0
28 2 11 670.1 247.6
-422.500 1 1
29 2 12 670.1 424.8
-245.300 1 1
30 2 13 670.1 669.3
-0.800 0 0
31 2 14 670.1 169.3
-500.800 1 1
32 2 15 670.1 795.0
124.900 0 0
33 2 16 670.1 118.5
-551.600 1 1
34 2 17 670.1 282.6
-387.500 1 1
35 2 18 670.1 789.4
119.300 0 0
36 2 19 670.1 655.6
-14.500 0 0
37 2 20 670.1 403.7
-266.400 1 1
38 3 4 298.0
628.0 330.000 1
1
39 3 5 298.0 793.5
495.500 1 1
40 3 6 298.0 393.2
95.200 0 0
41 3 7 298.0 573.1
275.100 1 1
42 3 8 298.0
336.9 38.900 0
0
43 3 9 298.0 722.6
424.600 1 1
44 3 10 298.0 755.4
457.400 1 1
45 3 11 298.0 247.6
-50.400 0 0
46 3 12 298.0 424.8
126.800 0 0
47 3 13 298.0 669.3
371.300 1 1
48 3 14 298.0 169.3
-128.700 0 0
49 3 15 298.0 795.0
497.000 1
1
50 3 16 298.0 118.5
-179.500 0 0
51 3 17 298.0 282.6
-15.400 0 0
52 3 18 298.0 789.4
491.400 1 1
53 3 19 298.0 655.6
357.600 1 1
54 3 20 298.0 403.7
105.700 0 0
55 4 5 628.0 793.5
165.500 0 0
56 4 6 628.0 393.2
-234.800 0 0
57 4 7 628.0 573.1
-54.900 0 0
58 4 8 628.0 336.9
-291.100 1 1
59 4 9 628.0 722.6
94.600 0 0
60 4 10 628.0 755.4
127.400 0 0
61 4 11 628.0 247.6
-380.400 1 1
62 4 12 628.0 424.8
-203.200 1 0
63 4 13 628.0 669.3
41.300 0 0
64 4 14 628.0 169.3
-458.700 1 1
65 4 15 628.0
795.0 167.000 0
0
66 4 16 628.0 118.5
-509.500 1 1
67 4 17 628.0 282.6
-345.400 1 1
68 4 18 628.0 789.4
161.400 0 0
69 4 19 628.0 655.6
27.600 0 0
70 4 20 628.0 403.7
-224.300 1 1
71 5 6 793.5 393.2
-400.300 1 1
72 5 7 793.5 573.1
-220.400 1 1
73 5 8 793.5 336.9
-456.600 1 1
74 5 9 793.5 722.6
-70.900 0 0
75 5 10 793.5 755.4
-38.100 0 0
76 5 11 793.5 247.6
-545.900 1 1
77 5 12 793.5 424.8
-368.700 1 1
78 5 13 793.5 669.3
-124.200 0 0
79 5 14 793.5 169.3
-624.200 1 1
80 5 15 793.5 795.0
1.500 0 0
81 5 16 793.5 118.5
-675.000 1 1
82 5 17 793.5 282.6
-510.900 1 1
83 5 18 793.5 789.4
-4.100 0 0
84 5 19 793.5
655.6 -137.900 0
0
85 5 20 793.5 403.7
-389.800 1 1
86 6 7 393.2 573.1
179.900 0 0
87 6 8 393.2 336.9
-56.300 0 0
88 6 9 393.2
722.6 329.400 1
1
89 6 10 393.2 755.4
362.200 1 1
90 6 11 393.2 247.6
-145.600 0 0
91 6 12 393.2 424.8
31.600 0
0
92 6 13 393.2 669.3
276.100 0 0
93 6 14 393.2 169.3
-223.900 0 0
94 6 15 393.2 795.0
401.800 1 1
95 6 16 393.2 118.5
-274.700 0 0
96 6 17 393.2 282.6
-110.600 0 0
97 6 18 393.2 789.4
396.200 1 1
98 6 19 393.2 655.6
262.400 1 0
99 6 20 393.2 403.7
10.500 0 0
100 7 8 573.1 336.9
-236.200 1 1
101 7 9 573.1 722.6
149.500 0 0
102 7 10 573.1 755.4
182.300 0 0
103 7 11 573.1 247.6
-325.500 1 1
104 7 12 573.1 424.8
-148.300 0 0
105 7 13 573.1 669.3
96.200 0 0
106 7 14 573.1 169.3
-403.800 1 1
107 7 15 573.1
795.0 221.900 0
0
108 7 16 573.1 118.5
-454.600 1 1
109 7 17 573.1 282.6
-290.500 1 0
110 7 18 573.1 789.4
216.300 0 0
111 7 19 573.1 655.6
82.500 0 0
112 7 20 573.1 403.7
-169.400 0 0
113 8 9 336.9 722.6
385.700 1 1
114 8 10 336.9 755.4
418.500 1 1
115 8 11 336.9 247.6
-89.300 0 0
116 8 12 336.9 424.8
87.900 0 0
117 8 13 336.9 669.3
332.400 1 0
118 8 14 336.9 169.3
-167.600 0 0
119 8 15 336.9 795.0
458.100 1 1
120 8 16 336.9 118.5
-218.400 0 0
121 8 17 336.9 282.6
-54.300 0 0
122 8 18 336.9 789.4
452.500 1 1
123 8 19 336.9 655.6
318.700 1 1
124 8 20 336.9 403.7
66.800 0 0
125 9 10 722.6 755.4
32.800 0 0
126 9 11 722.6
247.6 -475.000 1
1
127 9 12 722.6 424.8
-297.800 1 1
128 9 13 722.6 669.3
-53.300 0 0
129 9 14 722.6 169.3
-553.300 1 1
130 9 15 722.6 795.0
72.400 0 0
131 9 16 722.6 118.5
-604.100 1 1
132 9 17 722.6 282.6
-440.000 1 1
133 9 18 722.6 789.4
66.800 0
0
134 9 19 722.6 655.6
-67.000 0 0
135 9 20 722.6 403.7
-318.900 1 1
136 10 11 755.4 247.6
-507.800 1 1
137 10 12 755.4 424.8
-330.600 1 1
138 10 13 755.4 669.3
-86.100 0 0
139 10 14 755.4 169.3
-586.100 1 1
140 10 15 755.4 795.0
39.600 0 0
141 10 16 755.4 118.5
-636.900 1 1
142 10 17 755.4 282.6
-472.800 1 1
143 10 18 755.4 789.4
34.000 0 0
144 10 19 755.4 655.6
-99.800 0 0
145 10 20 755.4 403.7
-351.700 1 1
146 11 12 247.6 424.8
177.200 0 0
147 11 13 247.6 669.3
421.700 1 1
148 11 14 247.6 169.3
-78.300 0 0
149 11 15 247.6
795.0 547.400 1
1
150 11 16 247.6 118.5
-129.100 0 0
151 11 17 247.6 282.6
35.000 0 0
152 11 18 247.6 789.4
541.800 1 1
153 11 19 247.6 655.6
408.000 1 1
154 11 20 247.6 403.7
156.100 0 0
155 12 13 424.8 669.3
244.500 0 0
156 12 14 424.8 169.3
-255.500 1 1
157 12 15 424.8 795.0
370.200 1 1
158 12 16 424.8 118.5
-306.300 0 0
159 12 17 424.8 282.6
-142.200 0 0
160 12 18 424.8 789.4
364.600 1 1
161 12 19 424.8 655.6
230.800 1 1
162 12 20 424.8 403.7
-21.100 0 0
163 13 14 669.3 169.3
-500.000 1 1
164 13 15 669.3 795.0
125.700 0 0
165 13 16 669.3 118.5
-550.800 1 1
166 13 17 669.3 282.6
-386.700 1 0
167 13 18 669.3 789.4
120.100 0 0
168 13 19 669.3
655.6 -13.700 0
0
169 13 20 669.3 403.7
-265.600 0 0
170 14 15 169.3 795.0
625.700 1 1
171 14 16 169.3 118.5
-50.800 0 0
172 14 17 169.3 282.6
113.300 0 0
173 14 18 169.3 789.4
620.100 1 1
174 14 19 169.3 655.6
486.300 1 1
175 14 20 169.3 403.7
234.400 1 1
176 15 16 795.0 118.5
-676.500 1 1
177 15 17 795.0 282.6
-512.400 1 1
178 15 18 795.0 789.4
-5.600 0 0
179 15 19 795.0 655.6
-139.400 0 0
180 15 20 795.0 403.7
-391.300 1 1
181 16 17 118.5 282.6
164.100 0 0
182 16 18 118.5 789.4
670.900 1 1
183 16 19 118.5 655.6
537.100 1 1
184 16 20 118.5 403.7
285.200 0 0
185 17 18 282.6 789.4
506.800 1 1
186 17 19 282.6 655.6
373.000 1 1
187 17 20 282.6 403.7
121.100 0 0
188 18 19 789.4 655.6
-133.800 0 0
189 18 20 789.4 403.7
-385.700 1 1
190 19 20 655.6 403.7
-251.900 1 1
Description of columns :
Input column i.e Average ranks
nsrno=Group serial number; ccgb=base group; ccga=comparative group
dcolb=Average rank of base group; dcola=Average rank of
comparative group
diffcol=Difference in Average ranks
sig05= 1 implies significance at 0.05 level and 0 implies not
signficant
sig01= 1 implies significance at 0.01 level and 0 implies not
signficant
Invoking
and macro output for comparison with a single group assuming time period 3 is
the group to be compared
MTB > %phkw c12 c14
Executing from file: C:\MTBWIN\MACROS\phkw.MAC
This is a
macro for Posthoc analysis after Friedman test either multigroup comparison or
comparison
againt a single control .
For
computational details refer to
Nonparametric statistics for behavioural sciences
Siegel S and
Castellan NJ, 2nd edition, 1988 , McGraw Hill, Inc, New York
, page 213-215
PLEASE REMEMBER
TO ENTER THE AVERAGE RANKS IN THE INPUT COLUMN
What type of
post hoc analysis you wish to perform
Type YES
& enter for multipgroup comparison.
Type NO & enter for single
group comparison
no
What is the
comparative group. Enter the number 1 or 2 or 3 etc and press
enter key
DATA> 3
Data Display
Row
C14 ccgb ccga
dcolb dcola diffcol
sig05 sig01
1 534.500 3
1 298 534.500
236.500 1 1
2 670.100 3
2 298 670.100
372.100 1 1
3 298.000 3
4 298 628.000
330.000 1 1
4 628.000 3
5 298 793.500
495.500 1 1
5 793.500 3
6 298 393.200
95.200 0
0
6 393.200 3
7 298 573.100
275.100 1 1
7 573.100 3
8 298 336.900
38.900 0 0
8 336.900 3
9 298 722.600
424.600 1 1
9 722.600 3
10 298 755.400
457.400 1 1
10 755.400 3
11 298 247.600
-50.400 0 0
11 247.600 3
12 298 424.800
126.800 0 0
12 424.800 3
13 298 669.300
371.300 1 1
13 669.300 3
14 298 169.300
-128.700 0 0
14 169.300 3
15 298 795.000
497.000 1 1
15 795.000 3
16 298 118.500
-179.500 0 0
16 118.500 3
17 298 282.600
-15.400 0 0
17 282.600 3
18 298 789.400
491.400 1 1
18 789.400 3
19 298 655.600
357.600 1 1
19 655.600 3
20 298 403.700
105.700 0 0
20 403.700
Description of columns : Input column i.e Average ranks
nsrno=Group serial number; ccgb=base group; ccga=comparative group
dcolb=Average rank of base group; dcola=Average rank of
comparative group
diffcol=Difference in Average ranks
sig05= 1 implies significance at 0.05 level and 0 implies not
signficant
sig01= 1 implies significance at 0.01 level and 0 implies not
signficant