library(tidyverse)
library(conover.test)

Conover-Iman test

The Conover-Iman test is a post hoc test that perform pairwise comparisons using the same rankings used in the Kruskal-Wallis test (as opposed to just performing a bog-standard rank sum test for each pairwise comparison), and uses a pooled variance estimate implied by the Kruskal-Wallis test’s null hypothesis.

A similar procedure is the Dunn’s test. Dunn’s test is based on an asymptotic z distribution, while the Conover-Iman test is based on an asymptotic t distribution.

Plant Growth Data

kruskal.test(weight ~ group, data = PlantGrowth)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  weight by group
## Kruskal-Wallis chi-squared = 7.9882, df = 2, p-value = 0.01842
conover.test(PlantGrowth$weight , PlantGrowth$group)
##   Kruskal-Wallis rank sum test
## 
## data: x and group
## Kruskal-Wallis chi-squared = 7.9882, df = 2, p-value = 0.02
## 
## 
##                            Comparison of x by group                            
##                                 (No adjustment)                                
## Col Mean-|
## Row Mean |       ctrl       trt1
## ---------+----------------------
##     trt1 |   1.267026
##          |     0.1080
##          |
##     trt2 |  -1.914937  -3.181964
##          |     0.0331    0.0018*
## 
## alpha = 0.05
## Reject Ho if p <= alpha/2

homecare data

Example based on home care data from Dunn (1964)

data(homecare)
head(homecare)
##   occupation eligibility
## 1          1    Eligible
## 2          1    Eligible
## 3          1    Eligible
## 4          2    Eligible
## 5          2    Eligible
## 6          2    Eligible
homecare %>% tabyl(occupation,eligibility)
##  occupation Eligible No responsible person Responsible person unable
##           1        3                     0                         1
##           2       12                     4                         2
##           3       10                     7                         4
##           4       20                    10                        11
##           5       47                     9                        10
##           6       74                    12                        21
##           7       62                    26                        38
conover.test(homecare$occupation, homecare$eligibility, method="hs", list=TRUE)
##   Kruskal-Wallis rank sum test
## 
## data: x and group
## Kruskal-Wallis chi-squared = 4.2226, df = 2, p-value = 0.12
## 
## 
##                            Comparison of x by group                            
##                                  (Holm-Šidák)                                  
## Col Mean-|
## Row Mean |   Eligible   No respo
## ---------+----------------------
## No respo |  -0.156426
##          |     0.4379
##          |
## Responsi |  -2.028138  -1.445439
##          |     0.0635     0.1436
## 
## 
## List of pairwise comparisons: t statistic (adjusted p-value)
## ----------------------------------------------------------------------
## Eligible - No responsible person                  : -0.156426 (0.4379)
## Eligible - Responsible person unable              : -2.028138 (0.0635)
## No responsible person - Responsible person unable : -1.445439 (0.1436)
## 
## alpha = 0.05
## Reject Ho if p <= alpha/2