Learn R Programming

MD2sample (version 1.0.0)

Various Methods for the Two Sample Problem in D>1 Dimensions

Description

The routine twosample_test() in this package runs the two-sample test using various test statistic for multivariate data. The user can also run several tests and then find a p value adjusted for simultaneous inference. The p values are found via permutation or via the parametric bootstrap. The routine twosample_power() allows the estimation of the power of the tests. The routine run.studies() allows a user to quickly study the power of a new method and how it compares to those included in the package. For details of the methods and references see the included vignettes.

Copy Link

Version

Install

install.packages('MD2sample')

Version

1.0.0

License

GPL (>= 2)

Maintainer

Wolfgang Rolke

Last Published

July 22nd, 2025

Functions in MD2sample (1.0.0)

simTS

Helper function to find test statistics of simulated data.
TS_disc

Find test statistics for discrete data
twosample_power

Power Estimation for Multivariate Two-Sample Tests
transform01

transform data to interval (0,1).
chiTS.disc

Chi-square test for discrete data, example of user supplied function
chisq2D_test_cont

This function does the chi square two sample test for continuous data in two dimensions
chisq2D_test_disc

This function does the chi square two sample test for continuous data in two dimensions
edge.tests

This function does the tests by Chen and Friedman
twosample_test

Multivariate Two-Sample Tests
twosample_test_adjusted_pvalue

Adjusted p values
run.studies

Benchmarking for Multivariate Two-Sample Tests
timecheck

test function
test_methods

This function checks whether the correct methods have been requested
rDalitz

This function creates data for Dalitz plot
bincounterR

Count Events in Bins
xysort

sort vector y by values in vector x
powerC

Find the power of various continuous tests via simutation or permutation.
mdecdf

Finds the empirical distribution function
TS_cont_pval

This function runs a number of two sample tests which find their own p value.
TS_cont

Find test statistics for continuous data
FR.test

Friedman-Rafsky (FR) test
case.studies

Create case studies
chiTS.cont

Chi-square test for continuous data, example of user supplied function
signif.digits

This function does some rounding to nice numbers
calcTS

This function calculates the test statistics
Rank

equivalent to R command rank
MD2sample-package

MD2sample: Various Methods for the Two Sample Problem in D>1 Dimensions
Order

equivalent to R command order
power_studies_results

power_studies_results
power_pvals

This function finds the power for tests that find their own p values
change.marginals

Change Marginals of 2D Data
find_dist

find pairwise Euclidean distances
gen_sim_data

simulate new data
gen_cont

simulate continuous data
gen_disc

simulate new discrete data
simpvals

Helper function to find test statistics of simulated data.
testC

run tests using either simulation or permutation.