This function performs a weighted permutation test to determine if there is a significant difference between the means of two weighted numeric vectors. It tests the null hypothesis that the difference in means is zero against the alternative that it is not zero.
test(var1, var2, weights, n = 2000)
A list containing the observed difference in means and the p-value of the test.
A numeric vector.
A numeric vector of the same length as var1
.
A numeric vector of weights, assumed to be the same for both var1
and var2
.
The number of permutations to perform (default is 1000).