Learn R Programming

R2sample (version 4.0.1)

Various Methods for the Two Sample Problem

Description

The routine twosample_test() in this package runs the two sample test using various test statistic. The p values are found via permutation or large sample theory. The routine twosample_power() allows the calculation of the power in various cases, and plot_power() draws the corresponding power graphs. The routine run.studies allows a user to quickly study the power of a new method and how it compares to some of the standard ones.

Copy Link

Version

Install

install.packages('R2sample')

Monthly Downloads

335

Version

4.0.1

License

GPL (>= 2)

Maintainer

Wolfgang Rolke

Last Published

April 30th, 2025

Functions in R2sample (4.0.1)

myTS2

a local function needed for the vignette
timecheck

test function
testC

run test using either simulation or permutation.
twosample_power

Find the power of various two sample tests using Rcpp and parallel computing.
gen_disc

simulate new discrete data
gen_cont_noweights

simulate continuous data without weights
gen_cont_weights

simulate continuous data with weights
repC

cpp version of R routine rep
run.studies

This function runs the case studies included in the package
twosample_test

This function runs a number of two sample tests using Rcpp and parallel computing.
twosample_test_adjusted_pvalue

This function runs a number of two sample tests using Rcpp and parallel computing and then finds the correct p value for the combined tests.
wbincounter

Find counts and/or sum of weights in bins. Useful for power calculations. Replaces hist command from R.
gen_sim_data

simulate continuous data without weights
power_studies_results

power_studies_results
pvaluecdf

pvaluecdf
weights

find weights for several statistics for discrete data
power_newtest

This function estimates the power of test routines that calculate p value(s)
run_shiny

Runs the shiny app associated with R2sample package
chi_power

This function runs the chi-square test for continuous or discrete data
signif.digits

This function does some rounding to nice numbers
power_cont_LS

Find the power of various discrete tests via permutation.
chi_test

This function runs the chi-square test for continuous or discrete data
Cpporder

sort vector y by values in vector x
asymptotic_pvalues

This function finds the p values of several tests based on large sample theory
TSw_cont

find test statistics for continuous data with weights
plot_power

This function draws the power graph, with curves sorted by the mean power and smoothed for easier reading.
powerR

Find the power of two sample tests using Rcpp and parallel computing.
powerC

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

Find test statistics for weighted discrete data
R2sample-package

R2sample: Various Methods for the Two Sample Problem
TS_disc

find test statistics for discrete data
calcTS

This function calculates the test statistics for continuous data
TS_cont

find test statistics for continuous data
bincounter

find counts in bins. Useful for power calculations. Replaces hist command from R.
case.studies

This function creates the functions needed to run the various case studies.