lundi 30 mars 2020

How do I sample and conduct a random permutation test for data with unequal list lengths in R?

I have an issue where I have 2 lists of unequal lengths, and I want to conduct a random permutation test of 5000 iterations on them to find out if the difference in means for both is significant.

dataset1v <- c(10, 10, 5, 10, 50, 2, 5, 50, 10, 40, 50, 20, 25, 20, 10, 10, 50, 10)
dataset2v <- c(50, 10, 20, 10, 40, 10, 20, 30, 10, 10, 80, 15)

All the tutorials on random permutation tests out there assume equal list lengths, and so they don't apply since a warning pops up when I run it with my lists. I've tried permutation.test.discrete among other options, but it's always the same issue: list length is unequal. Also, I would also like to resample each data into their original list lengths (18 and 12 each). I'm a beginner at coding for R, so I have spent hours upon hours trying to figure out how to solve this issue. Would appreciate some help and pointers in the right direction! Thanks!!




Aucun commentaire:

Enregistrer un commentaire