I ran a weighted Kruskal Wallis test using the survey package in R.
The result shows that there is a significant difference between groups, but does not specify between which ones. Therefore, I´d like to follow up with weighted pairwise comparisons (post-hoc test).
In the stats package, there is the 'pairwise.wilcox.test' function, which does exactly that. However, as far as I know, it does not allow to use weights. Therefore, I´ve tried looping a weighted wilcoxon test through the levels of the grouping variable - without success though. And even if this had worked, I would still need to manually adjust all the p-values to correct for multiple comparisons...
Hence my question: How can I run pairwise comparisons with weights in R?
You don't say what you tried for looping over levels, or provide an example, but using the example from the help page:
Or if you want the p-values in an object
Once you have the p-values, you can just call
p.adjustto get whatever p-value adjustment you would have used withpairwise.wilcox.test