## Simulated from Student's t-distribution.
## Observations for the two samples are from different distributions.
data(example0)
data = as.matrix(example0$data) # pooled dataset
label = example0$label # label of observations
s1 = data[label == 'sample 1', ] # sample 1
s2 = data[label == 'sample 2', ] # sample 2
num1 = nrow(s1) # number of observations in sample 1
num2 = nrow(s2) # number of observations in sample 2
## Graph-based two sample test using data as input
rg.test(data.X = s1, data.Y = s2, n1 = num1, n2 = num2, k = 5, weigh.fun = weiMax, perm.num = 0)
## Graph-based two sample test using distance matrix as input
dist = example0$distance
rg.test(dis = dist, n1 = num1, n2 = num2, k = 5, weigh.fun = weiMax, perm.num = 0)
## Graph-based two sample test using edge matrix of the similarity graph as input
E = example0$edge
rg.test(E = E, n1 = num1, n2 = num2, weigh.fun = weiMax, perm.num = 0)
Run the code above in your browser using DataLab