Perhaps this is a very basic question, but I didn't find yet a simple solution for this simple problem:
I want to compare two samples (say X and Y) for a continuous variable which is non-normally distributed and test if X and Y are significantly different. The sample size of X is N=81 and Y is N=5110, so they are quite unbalanced. My first attempt was to use the Mann-Whitney (i.e. Wilcoxon Signed Rank test). However, I am bothered with this huge difference in sample sizes.
I thought that some kind of randomization or bootstrap method is a good alternative, but I am not sure if my approach makes sense. My idea was to get 1000 random samples of size 81 from Y and X and then use the Mann-Whitney to compare both distributions. The empirical p-value would be the proportion of tests with p-value < 0.05. I "R", I've implemented as follows:
X = data1 # sample size 81
Y = data2 # sample size 5510
R = 1000
alpha = numeric(R)
for(i in 1:R) {
group1 = sample(X, replace=TRUE)
group2 = sample(Y, size=81, replace=TRUE)
alpha[i] = wilcox.test(group1, group2)$p.value
}
Empirical p-value would be the proportion of p-values < 0.05:
mean(alpha < 0.05)
Does this approach make sense? How can I do this hypothesis testing correctly?
BEST
package $\endgroup$