View source: R/eqdist_2014BG.R
eqdist.2014BG | R Documentation |
Given two samples (either univariate or multivariate) X and Y of same dimension, it tests
H_0 : F_X = F_Y\quad vs\quad H_1 : F_X \neq F_Y
using the procedure by Biswas and Ghosh (2014) in a nonparametric way based on pairwise distance measures. Both asymptotic and permutation-based determination of p-values are supported.
eqdist.2014BG(X, Y, method = c("permutation", "asymptotic"), nreps = 999)
X |
a vector/matrix of 1st sample. |
Y |
a vector/matrix of 2nd sample. |
method |
method to compute p-value. Using initials is possible, |
nreps |
the number of permutations to be run when |
a (list) object of S3
class htest
containing:
a test statistic.
p-value under H_0.
alternative hypothesis.
name of the test.
name(s) of provided sample data.
biswas_nonparametric_2014SHT
## CRAN-purpose small example smallX = matrix(rnorm(10*3),ncol=3) smallY = matrix(rnorm(10*3),ncol=3) eqdist.2014BG(smallX, smallY) # run the test ## Not run: ## compare asymptotic and permutation-based powers set.seed(777) ntest = 1000 pval.a = rep(0,ntest) pval.p = rep(0,ntest) for (i in 1:ntest){ x = matrix(rnorm(100), nrow=5) y = matrix(rnorm(100), nrow=5) pval.a[i] = ifelse(eqdist.2014BG(x,y,method="a")$p.value<0.05,1,0) pval.p[i] = ifelse(eqdist.2014BG(x,y,method="p",nreps=100)$p.value <0.05,1,0) } ## print the result cat(paste("\n* EMPIRICAL TYPE 1 ERROR COMPARISON \n","*\n", "* Asymptotics : ", round(sum(pval.a/ntest),5),"\n", "* Permutation : ", round(sum(pval.p/ntest),5),"\n",sep="")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.