# Is there an implementation of the minP or Westfall & Young corrections?

Let us consider variables $$X_1,\dots,X_k$$. They are highly dependent. We want to perform some test for any pair $$(X_i,Y)$$ and imply proper multiple-comparisons correction.

As i understand, Westfall & Young or minP/maxT corrections should be efficient in this task. But i can't find any general implementation in R. And code it from scratch is hard and dangerous, as for me.

Is there any implementation of this methods or any alternatives?

Edit 1: Practical example.

X1=c(0,1,1,0,1,1,0,1)
X2=c(0,1,1,0,1,1,0,0)
X3=c(0,1,1,0,1,1,1,1)
set.seed(16)
Y=rnorm(8,mean = 3)*X1+rnorm(8)

p_1=wilcox.test(Y[X1==0],Y[X1==1])$$p.value p_2=wilcox.test(Y[X2==0],Y[X2==1])$$p.value
p_3=wilcox.test(Y[X3==0],Y[X3==1])$p.value p_vec=c(p_1,p_2,p_3) p.adjust(p_vec,method = "holm")  Holm's correction is too strict for such dependent tests. I wanted to permute Y and perform Westfall & Young correction. • I'm not quite clear on which hypotheses you're actually trying to test given your data. Do you have multiple observations for each variable$X_i$and$Y$? More generally, the R library multtest provides methods for adjusting p-values using the step-down maxT and minP procedures of Westfall & Young. Have you already taken a look at multtest? – Maurits Evers Feb 11 at 13:51 • @MauritsEvers, I have, say, N patients with$X_1, \dots,X_k$and$Y$measured for every patient. As i understood, multtest can only be used if$X_i$is continuous and$Y$is binary. In my case$X_i$is binary,$Y$is continuous and i want to perform Wilcoxon test with resampling of$Y$ranks. Also im interested in case when$Y$is binary and we use Exact Fisher's test. – Kess Feb 11 at 16:21 • I'm sorry but I'm still confused about your data. I assume you have multiple measurements for every variable$X_i$for every patient? Otherwise I'm not clear on how you'd like to "perform some test for any pair$(X_i, Y)$". Perhaps it might help if you were to provide some sample data and code (since this post has an r code tag) that shows what test(s) you'd like to perform on which (subset of) your data. I'm also wondering whether modelling Y directly as a function of the X_i`s wouldn't be more sensible. This might avoid the whole multiple comparison issue altogether. – Maurits Evers Feb 12 at 1:17 • @MauritsEvers I apologize for such unclear data. I meant pairs of random variables$(X_i,Y),\quad i=1\dots k$. I added a code example to the post. – Kess Feb 12 at 13:04 • I'm very confused about your data and what you're trying to do; in your post you state that you want to perform pairwise tests (Wilcoxon rank tests in your case) of random variables$(X_i, Y)$where$X_i$is binary and$Y$is continuous; but in your code you perform tests on disjoint subsets of$Y\$. – Maurits Evers Feb 16 at 12:10