Permutation test Test the null hypothesis P(X|I=0) = P(X|I=1), using permutation test.
perm_test(estimates, wgt, wgt1, X, n.quant, n.perm = 1000, Y = NULL,
control = NULL, func = "non_parm")
point estimates of the percentile distance between P(X|I=0) & P(X|I=1).
an optional vector of weights.
weights under I = 1.
numeric data frame or matrix of factors to be considered.
number of quantiles to use when calculating CDF distance.
number of permutations to permute from wgt1.
outcome vector (must be numeric without NA's).
numeric data frame or matrix of factors to control for. these are factors that we can't consider while looking for the optimal intervention (e.g. race).
either "non_parm" or "nn". for "nn", weights are recalculated for each permutation, and thus Y and control are needed. the default is "non_parm", and Y and control aren't needed.
vector of p values.