powered by
Performs a weighted permutation test for the null hypothesis that the weighted mean of (var1 - var2) is zero.
feature.test(var1, var2, weights, n = 2000)
A list with:
Observed weighted mean difference (var1 - var2).
Monte Carlo permutation p-value.
A numeric vector.
A numeric vector of the same length as var1.
var1
A numeric vector of non-negative weights of the same length as var1 and var2.
var2
Integer. Number of permutations (default 2000).
if (FALSE) { var1 <- rnorm(100) var2 <- rnorm(100) weights <- runif(100) result <- shapley:::feature.test(var1, var2, weights) result$mean_wmshap_diff result$p_value }
Run the code above in your browser using DataLab