R2sample

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / R2sample

R2sample

v4.1.0
R2sample
Repository CRANLicense GPL (>= 2)Lifecycle activeNeeds compilation yes
DOI
10.32614/CRAN.package.R2sample

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

0
표시할 핵심 신호가 없습니다.

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
4.1.0
License
GPL (>= 2)
Lifecycle
active
Needs compilation
yes
Last observed
2026-05-30
CRAN
cran.r-project.org/package=R2sample

Build fields

LinkingTo
1
Rcpp

수집 소스별 패키지 정보

1개 소스
CRAN
4.1.0
2026-05-30
License
GPL (>= 2)
Depends
R (>= 3.5)
Imports
Rcpp, parallel, shiny, ggplot2, stats, graphics, microbenchmark
Suggests
rmarkdown, knitr, testthat (>= 3.0.0)
LinkingTo
Rcpp
Needs compilation
yes
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

5개 표시전체 11개
PackageTypeSpec
ggplot2
CRAN · 4.1.0 · 2026-05-30
Importsggplot2
graphics
CRAN · 4.1.0 · 2026-05-30
Importsgraphics
microbenchmark
CRAN · 4.1.0 · 2026-05-30
Importsmicrobenchmark
parallel
CRAN · 4.1.0 · 2026-05-30
Importsparallel
Rcpp
CRAN · 4.1.0 · 2026-05-30
ImportsRcpp
1 / 3

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
31
Repository
CRAN
Version
4.1.0
Collected
2026-05-16 11:10:14
Package page
https://cran.r-project.org/web/packages/R2sample/index.html
DOI
10.32614/CRAN.package.R2sample
CRAN checks
https://cran.r-project.org/web/checks/check_results_R2sample.html
NEWS
https://cran.r-project.org/web/packages/R2sample/news/news.html
Reference HTML
https://cran.r-project.org/web/packages/R2sample/refman/R2sample.html
Reference PDF
https://cran.r-project.org/web/packages/R2sample/R2sample.pdf
Source package
https://cran.r-project.org/src/contrib/R2sample_4.1.0.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/R2sample
Page fields
Author
Wolfgang Rolke [aut, cre]
CRAN Checks
R2sample results
DOI
10.32614/CRAN.package.R2sample
License
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
LinkingTo
Rcpp
Maintainer
Wolfgang Rolke <wolfgang.rolke at upr.edu>
Materials
NEWS
NeedsCompilation
yes
Old Sources
R2sample archive
Package Source
R2sample_4.1.0.tar.gz
Published
2025-06-16
Reference Manual
R2sample.html , R2sample.pdf
Version
4.1.0
Vignettes
R2sample ( source , R code )
Windows Binaries
r-devel: R2sample_4.1.0.zip , r-release: R2sample_4.1.0.zip , r-oldrel: R2sample_4.1.0.zip
MacOS Binaries
r-release (arm64): R2sample_4.1.0.tgz , r-oldrel (arm64): R2sample_4.1.0.tgz , r-release (x86_64): R2sample_4.1.0.tgz , r-oldrel (x86_64): R2sample_4.1.0.tgz
Version
4.1.0
LinkingTo
Rcpp
Published
2025-06-16
DOI
10.32614/CRAN.package.R2sample
Author
Wolfgang Rolke [aut, cre]
Maintainer
Wolfgang Rolke <wolfgang.rolke at upr.edu>
License
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
NeedsCompilation
yes
Materials
NEWS
CRAN Checks
R2sample results
Reference Manual
R2sample.html , R2sample.pdf
Vignettes
R2sample ( source , R code )
Package Source
R2sample_4.1.0.tar.gz
Windows Binaries
r-devel: R2sample_4.1.0.zip , r-release: R2sample_4.1.0.zip , r-oldrel: R2sample_4.1.0.zip
MacOS Binaries
r-release (arm64): R2sample_4.1.0.tgz , r-oldrel (arm64): R2sample_4.1.0.tgz , r-release (x86_64): R2sample_4.1.0.tgz , r-oldrel (x86_64): R2sample_4.1.0.tgz
Old Sources
R2sample archive
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"R2sample.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/R2sample/refman/R2sample.html"},{"label":"R2sample.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/R2sample/R2sample.pdf"},{"label":"R2sample","section":"","type":"","url":"https://cran.r-project.org/web/packages/R2sample/vignettes/R2sample.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/R2sample/vignettes/R2sample.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/R2sample/vignettes/R2sample.R"}]
Text
Reference manual: R2sample.html , R2sample.pdf Vignettes: R2sample ( source , R code )
Downloads
Heading
Downloads
Links
[{"label":"R2sample_4.1.0.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/R2sample_4.1.0.tar.gz"},{"label":"R2sample_4.1.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/R2sample_4.1.0.zip"},{"label":"R2sample_4.1.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/R2sample_4.1.0.zip"},{"label":"R2sample_4.1.0.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/R2sample_4.1.0.zip"},{"label":"R2sample_4.1.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/R2sample_4.1.0.tgz"},{"label":"R2sample_4.1.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/R2sample_4.1.0.tgz"},{"label":"R2sample_4.1.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/R2sample_4.1.0.tgz"},{"label":"R2sample_4.1.0.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/R2sample_4.1.0.tgz"},{"label":"R2sample archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/R2sample"}]
Text
Package source: R2sample_4.1.0.tar.gz Windows binaries: r-devel: R2sample_4.1.0.zip , r-release: R2sample_4.1.0.zip , r-oldrel: R2sample_4.1.0.zip macOS binaries: r-release (arm64): R2sample_4.1.0.tgz , r-oldrel (arm64): R2sample_4.1.0.tgz , r-release (x86_64): R2sample_4.1.0.tgz , r-oldrel (x86_64): R2sample_4.1.0.tgz Old sources: R2sample archive
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=R2sample","section":"","type":"","url":"https://CRAN.R-project.org/package=R2sample"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=R2sample to link to this page.
Materials 1
Documentation 5
Vignettes 3
Downloads 9
All page links 31

패키지 문서 원문

3 artifacts
field
NEWS
CRAN · 4.1.0 · Materials · text/html · 3,959 · 2026-05-07
Title
NEWS
Label
NEWS
Text content
Text content
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} R2sample 4.1.0 User supplied routine can now also return p value for twosample_power Some other minor changes R2sample 4.0.1 Fixed a serious bug in twosample_test R2sample 4.0.0 It is now possible to use a routine to generate new simulated data to find p values, the parametric bootstrap approach. This is needed for the goodness-of-fit/twosample hybrid problem. Also some changes to the hidden interior routines R2sample 3.1.1 Fixed a minor bug R2sample 3.1.0 Improved the routines that do power calculations for better speed. Included a timing routine to see whether using a single core is faster than using multiple processing. Some minor changes to other routines. R2sample 3.0.0 Added routine to allow benchmarking of new user supplied tests. Some minor changes to other routines. R2sample 2.2.0 some minor bug fixes, additions to vignette R2sample 2.1.0 Added routines for calculating p values adjusted for simultaneous testing R2sample 1.1.0 fixed a bug in calculation of chi square test, made cpp routines invisible, fixed issue with help titles R2sample 1.0.0 fixed a code problem in TS_disc_cpp on line 146 made some changes to the arguments of twosample_power R2sample 0.0.4 changed line 66 in TS_cont_cpp.cpp from while ( (x[j]<=sxy[i]) && (j<nx)) to while ( (j<nx) && (x[j]<=sxy[i]) ) to avoid heap-buffer-overflow error. R2sample 0.0.3 Changed & to && in a TS_cont_cpp.cpp R2sample 0.0.2 Changed | to || in a number of the C++ routines per request from the CRAN Team R2sample 0.0.1 Added a NEWS.md file to track changes to the package. Oct 10, 2022: Added to run_shiny(), added () to function names eliminated \dontrun(), added toy examples changed cat to message changed Maintainer to Authors@R Oct. 11, 2022: Eliminated all and , added toy examples Searched and eliminated all empty spaces in DESCRIPTION that I could find.
reference_manual_html
Reference manual HTML
CRAN · 4.1.0 · Documentation · text/html · 45,173 · 2026-05-07
Title
Help for package R2sample
Label
Reference manual HTML
Text content
Text content
Help for package R2sample const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {R2sample} Contents R2sample-package Cpporder TS_cont TS_disc TSw_cont TSw_disc asymptotic_pvalues bincounter calcTS case.studies chi_power chi_test gen_cont_noweights gen_cont_weights gen_disc gen_sim_data myTS2 plot_power powerC powerR power_cont_LS power_newtest power_studies_results pvaluecdf repC run.studies run_shiny signif.digits testC test_methods timecheck twosample_power twosample_test twosample_test_adjusted_pvalue wbincounter weights Title: Various Methods for the Two Sample Problem Version: 4.1.0 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. License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] Encoding: UTF-8 RoxygenNote: 7.3.2 LinkingTo: Rcpp Imports: Rcpp, parallel, shiny, ggplot2, stats, graphics, microbenchmark Suggests: rmarkdown, knitr, testthat (≥ 3.0.0) VignetteBuilder: knitr Depends: R (≥ 3.5) LazyData: true NeedsCompilation: yes Packaged: 2025-06-16 18:11:44 UTC; Wolfgang Author: Wolfgang Rolke [aut, cre] Maintainer: Wolfgang Rolke <wolfgang.rolke@upr.edu> Repository: CRAN Date/Publication: 2025-06-16 18:30:06 UTC R2sample: 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. Author(s) Maintainer : Wolfgang Rolke wolfgang.rolke@upr.edu ( ORCID ) sort vector y by values in vector x Description sort vector y by values in vector x Usage Cpporder(y, x) Arguments y numeric vector x numeric vector Value numeric vector find test statistics for continuous data Description find test statistics for continuous data Usage TS_cont(x, y) Arguments x first continuous data set y second continuous data set Value A vector of test statistics find test statistics for discrete data Description find test statistics for discrete data Usage TS_disc(x, y, vals, ADweights = as.numeric(c(2))) Arguments x integer vector of data set 1 y integer vector of data set 2 vals numeric vector of values of discrete data set ADweights A vector of weights for AD method Value A vector of test statistics find test statistics for continuous data with weights Description find test statistics for continuous data with weights Usage TSw_cont(x, y, wx, wy) Arguments x first continuous data set y second continuous data set wx weights of x wy weights of y Value A vector of test statistics Find test statistics for weighted discrete data Description Find test statistics for weighted discrete data Usage TSw_disc(x, y, vals, wx, wy) Arguments x integer vector of counts y integer vector of counts vals A numeric vector with the values of the discrete rv. wx integer vector of weights wy integer vector of weights Value A vector with test statistics This function finds the p values of several tests based on large sample theory Description This function finds the p values of several tests based on large sample theory Usage asymptotic_pvalues(x, n, m) Arguments x a vector of test statistics n size of sample 1 m size of sample 2 Value A vector of p values. find counts in bins. Useful for power calculations. Replaces hist command from R. Description find counts in bins. Useful for power calculations. Replaces hist command from R. Usage bincounter(x, bins) Arguments x numeric vector bins numeric vector Value Integer vector of counts This function calculates the test statistics for continuous data Description This function calculates the test statistics for continuous data Usage calcTS(dta, TS, typeTS, TSextra) Arguments dta data set TS routine typeTS format of TS TSextra list passed to TS function Value A vector of numbers This function creates the functions needed to run the various case studies. Description This function creates the functions needed to run the various case studies. Usage case.studies(which, nsample = 500) Arguments which name of the case study. nsample =500, sample size. Value a list of functions This function runs the chi-square test for continuous or discrete data Description This function runs the chi-square test for continuous or discrete data Usage chi_power( rxy, alpha = 0.05, B = 1000, xparam, yparam, nbins = c(50, 10), minexpcount = 5, typeTS ) Arguments rxy a function to generate data alpha =0.05 type I error probability of test B =1000 number of simulation runs xparam vector of parameter values yparam vector of parameter values nbins =c(50, 10) number of desired bins minexpcount =5 smallest number of counts required in each bin typeTS type of problem, continuous/discrete, with/without weights Value A matrix of power values This function runs the chi-square test for continuous or discrete data Description This function runs the chi-square test for continuous or discrete data Usage chi_test(dta, nbins = c(50, 10), minexpcount = 5, typeTS, ponly = FALSE) Arguments dta a list with two elements for continuous data or three elements for discrete data, Can also include weights for continuous data nbins =c(50, 10) number of desired bins minexpcount =5 smallest number of counts required in each bin typeTS =5 type of problem, continuous/discrete, with/without weights ponly Should the p value alone be returned? Value A list with the test statistics, the p value and the degree of freedom for each test simulate continuous data without weights Description simulate continuous data without weights Usage gen_cont_noweights(x, y, TSextra) Arguments x first data set y second data set TSextra extra stuff Value A list of permuted vectors simulate continuous data with weights Description simulate continuous data with weights Usage gen_cont_weights(x, y, wx, wy, TSextra) Arguments x first data set y second data set wx weights of first data set wy weights of second data set TSextra extra stuff Value A list of permuted vectors simulate new discrete data Description simulate new discrete data Usage gen_disc(dtax, dtay, vals, TSextra) Arguments dtax first data set, counts dtay second data set, counts vals values of discrete random variable TSextra extra stuff Value A list of permuted vectors simulate continuous data without weights Description simulate continuous data without weights Usage gen_sim_data(dta, TSextra) Arguments dta data set TSextra extra stuff Value A list of permuted vectors a local function needed for the vignette Description a local function needed for the vignette Usage myTS2(x, y, vals) Arguments x An integer vector. y An integer vector. vals A numeric vector with the values of the discrete rv. Value A vector with test statistics This function draws the power graph, with curves sorted by the mean power and smoothed for easier reading. Description This function draws the power graph, with curves sorted by the mean power and smoothed for easier reading. Usage plot_power(pwr, xname = " ", title = " ", Smooth = TRUE, span = 0.25) Arguments pwr a matrix of power values, usually from the twosample_power command xname Name of variable on x axis title (Optional) title of graph Smooth =TRUE lines are smoothed for easier reading span =0.25bandwidth of smoothing method Va
section
R2sample.pdf
CRAN · 4.1.0 · Documentation · application/pdf · 111,068 · 2026-05-07
Title
R2sample.pdf
Label
R2sample.pdf

Reference for R2sample (4.1.0)

36개 topic
Cpporder
sort vector y by values in vector x
CRAN · 4.1.0 · R2sample/man/Cpporder.Rd · 2026-05-07

sort vector y by values in vector x

Aliases
Cpporder
Keywords
internal
Usage
Cpporder(y, x)
Arguments
y
numeric vector
x
numeric vector
Value
numeric vector
R2sample-package
R2sample: Various Methods for the Two Sample Problem
CRAN · 4.1.0 · package · R2sample/man/R2sample-package.Rd · 2026-05-07

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.

Aliases
R2sampleR2sample-package
Keywords
internal
Author
Maintainer: Wolfgang Rolke wolfgang.rolke@upr.edu (https://orcid.org/0000-0002-3514-726XORCID)
TS_cont
find test statistics for continuous data
CRAN · 4.1.0 · R2sample/man/TS_cont.Rd · 2026-05-07

find test statistics for continuous data

Aliases
TS_cont
Keywords
internal
Usage
TS_cont(x, y)
Arguments
x
first continuous data set
y
second continuous data set
Value
A vector of test statistics
TS_disc
find test statistics for discrete data
CRAN · 4.1.0 · R2sample/man/TS_disc.Rd · 2026-05-07

find test statistics for discrete data

Aliases
TS_disc
Keywords
internal
Usage
TS_disc(x, y, vals, ADweights = as.numeric(c(2)))
Arguments
x
integer vector of data set 1
y
integer vector of data set 2
vals
numeric vector of values of discrete data set
ADweights
A vector of weights for AD method
Value
A vector of test statistics
TSw_cont
find test statistics for continuous data with weights
CRAN · 4.1.0 · R2sample/man/TSw_cont.Rd · 2026-05-07

find test statistics for continuous data with weights

Aliases
TSw_cont
Keywords
internal
Usage
TSw_cont(x, y, wx, wy)
Arguments
x
first continuous data set
y
second continuous data set
wx
weights of x
wy
weights of y
Value
A vector of test statistics
TSw_disc
Find test statistics for weighted discrete data
CRAN · 4.1.0 · R2sample/man/TSw_disc.Rd · 2026-05-07

Find test statistics for weighted discrete data

Aliases
TSw_disc
Keywords
internal
Usage
TSw_disc(x, y, vals, wx, wy)
Arguments
x
integer vector of counts
y
integer vector of counts
vals
A numeric vector with the values of the discrete rv.
wx
integer vector of weights
wy
integer vector of weights
Value
A vector with test statistics
asymptotic_pvalues
This function finds the p values of several tests based on large sample theory
CRAN · 4.1.0 · R2sample/man/asymptotic_pvalues.Rd · 2026-05-07

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

Aliases
asymptotic_pvalues
Usage
asymptotic_pvalues(x, n, m)
Arguments
x
a vector of test statistics
n
size of sample 1
m
size of sample 2
Value
A vector of p values.
bincounter
find counts in bins. Useful for power calculations. Replaces hist command from R.
CRAN · 4.1.0 · R2sample/man/bincounter.Rd · 2026-05-07

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

Aliases
bincounter
Keywords
internal
Usage
bincounter(x, bins)
Arguments
x
numeric vector
bins
numeric vector
Value
Integer vector of counts
calcTS
This function calculates the test statistics for continuous data
CRAN · 4.1.0 · R2sample/man/calcTS.Rd · 2026-05-07

This function calculates the test statistics for continuous data

Aliases
calcTS
Keywords
internal
Usage
calcTS(dta, TS, typeTS, TSextra)
Arguments
dta
data set
TS
routine
typeTS
format of TS
TSextra
list passed to TS function
Value
A vector of numbers
case.studies
This function creates the functions needed to run the various case studies.
CRAN · 4.1.0 · R2sample/man/case.studies.Rd · 2026-05-07

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

Aliases
case.studies
Usage
case.studies(which, nsample = 500)
Arguments
which
name of the case study.
nsample
=500, sample size.
Value
a list of functions
chi_power
This function runs the chi-square test for continuous or discrete data
CRAN · 4.1.0 · R2sample/man/chi_power.Rd · 2026-05-07

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

Aliases
chi_power
Usage
chi_power( rxy, alpha = 0.05, B = 1000, xparam, yparam, nbins = c(50, 10), minexpcount = 5, typeTS )
Arguments
rxy
a function to generate data
alpha
=0.05 type I error probability of test
B
=1000 number of simulation runs
xparam
vector of parameter values
yparam
vector of parameter values
nbins
=c(50, 10) number of desired bins
minexpcount
=5 smallest number of counts required in each bin
typeTS
type of problem, continuous/discrete, with/without weights
Value
A matrix of power values
chi_test
This function runs the chi-square test for continuous or discrete data
CRAN · 4.1.0 · R2sample/man/chi_test.Rd · 2026-05-07

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

Aliases
chi_test
Keywords
internal
Usage
chi_test(dta, nbins = c(50, 10), minexpcount = 5, typeTS, ponly = FALSE)
Arguments
dta
a list with two elements for continuous data or three elements for discrete data, Can also include weights for continuous data
nbins
=c(50, 10) number of desired bins
minexpcount
=5 smallest number of counts required in each bin
typeTS
=5 type of problem, continuous/discrete, with/without weights
ponly
Should the p value alone be returned?
Value
A list with the test statistics, the p value and the degree of freedom for each test
gen_cont_noweights
simulate continuous data without weights
CRAN · 4.1.0 · R2sample/man/gen_cont_noweights.Rd · 2026-05-07

simulate continuous data without weights

Aliases
gen_cont_noweights
Keywords
internal
Usage
gen_cont_noweights(x, y, TSextra)
Arguments
x
first data set
y
second data set
TSextra
extra stuff
Value
A list of permuted vectors
gen_cont_weights
simulate continuous data with weights
CRAN · 4.1.0 · R2sample/man/gen_cont_weights.Rd · 2026-05-07

simulate continuous data with weights

Aliases
gen_cont_weights
Keywords
internal
Usage
gen_cont_weights(x, y, wx, wy, TSextra)
Arguments
x
first data set
y
second data set
wx
weights of first data set
wy
weights of second data set
TSextra
extra stuff
Value
A list of permuted vectors
gen_disc
simulate new discrete data
CRAN · 4.1.0 · R2sample/man/gen_disc.Rd · 2026-05-07

simulate new discrete data

Aliases
gen_disc
Keywords
internal
Usage
gen_disc(dtax, dtay, vals, TSextra)
Arguments
dtax
first data set, counts
dtay
second data set, counts
vals
values of discrete random variable
TSextra
extra stuff
Value
A list of permuted vectors
gen_sim_data
simulate continuous data without weights
CRAN · 4.1.0 · R2sample/man/gen_sim_data.Rd · 2026-05-07

simulate continuous data without weights

Aliases
gen_sim_data
Keywords
internal
Usage
gen_sim_data(dta, TSextra)
Arguments
dta
data set
TSextra
extra stuff
Value
A list of permuted vectors
myTS2
a local function needed for the vignette
CRAN · 4.1.0 · R2sample/man/myTS2.Rd · 2026-05-07

a local function needed for the vignette

Aliases
myTS2
Usage
myTS2(x, y, vals)
Arguments
x
An integer vector.
y
An integer vector.
vals
A numeric vector with the values of the discrete rv.
Value
A vector with test statistics
plot_power
This function draws the power graph, with curves sorted by the mean power and smoothed for easier reading.
CRAN · 4.1.0 · R2sample/man/plot_power.Rd · 2026-05-07

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

Aliases
plot_power
Usage
plot_power(pwr, xname = " ", title = " ", Smooth = TRUE, span = 0.25)
Arguments
pwr
a matrix of power values, usually from the twosample_power command
xname
Name of variable on x axis
title
(Optional) title of graph
Smooth
=TRUE lines are smoothed for easier reading
span
=0.25bandwidth of smoothing method
Value
plt, an object of class ggplot.
powerC
Find the power of various continuous tests via simutation or permutation.
CRAN · 4.1.0 · R2sample/man/powerC.Rd · 2026-05-07

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

Aliases
powerC
Keywords
internal
Usage
powerC(rxy, xparam, yparam, TS, typeTS, TSextra, B = 1000L)
Arguments
rxy
a function that generates x and y data.
xparam
arguments for r1.
yparam
arguments for r2.
TS
routine to calculate test statistics for non-chi-square tests
typeTS
indicator for type of test statistics
TSextra
additional info passed to TS, if necessary
B
=1000 number of simulation runs
Value
A list values of test statistics
powerR
Find the power of two sample tests using Rcpp and parallel computing.
CRAN · 4.1.0 · R2sample/man/powerR.Rd · 2026-05-07

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

Aliases
powerR
Usage
powerR( rxy, xparam, yparam, TS, typeTS, TSextra, alpha = 0.05, B = 1000, SuppressMessages, maxProcessor )
Arguments
rxy
function to generate a list with data sets x, y and (optional) vals, weights
xparam
first argument passed to rxy
yparam
second argument passed to rxy
TS
test statistic
typeTS
which format has TS?
TSextra
list of items passed TS
alpha
=0.05, the level of the hypothesis test
B
= 1000 number of simulation runs
SuppressMessages
= FALSE print informative messages?
maxProcessor
maximum number of cores to use. If maxProcessor=1 no parallel computing is used.
Value
A numeric vector of power values.
power_cont_LS
Find the power of various discrete tests via permutation.
CRAN · 4.1.0 · R2sample/man/power_cont_LS.Rd · 2026-05-07

Find the power of various discrete tests via permutation.

Aliases
power_cont_LS
Keywords
internal
Usage
power_cont_LS(rxy, alpha = 0.05, B = 1000, xparam = 0, yparam = 0)
Arguments
rxy
a function that generates x and y data.
alpha
A numeric constant
B
Number of simulation runs.
xparam
arguments for r1.
yparam
arguments for r2.
Value
A numeric matrix of powers
power_newtest
Power for tests with p values
CRAN · 4.1.0 · R2sample/man/power_newtest.Rd · 2026-05-07

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

Aliases
power_newtest
Usage
power_newtest(TS, f, param_alt, TSextra, alpha = 0.05, B = 1000)
Arguments
TS
routine to calculate test statistics.
f
routine that generates data.
param_alt
values of parameter under the alternative hypothesis.
TSextra
list passed to TS.
alpha
=0.05 type I error.
B
= 1000 number of simulation runs to estimate the power.
Value
A matrix of power values
power_studies_results
CRAN · 4.1.0 · data · R2sample/man/power_studies_results.Rd · 2026-05-07

the results of the included power studies

Aliases
power_studies_results
Keywords
datasets
Usage
power_studies_results
Format
'power_studies_results' A list of matrices with powers
pvaluecdf
CRAN · 4.1.0 · data · R2sample/man/pvaluecdf.Rd · 2026-05-07

data to draw a graph in vignette

Aliases
pvaluecdf
Keywords
datasets
Usage
pvaluecdf
Format
'pvaluecdf' A matrix
repC
cpp version of R routine rep
CRAN · 4.1.0 · R2sample/man/repC.Rd · 2026-05-07

cpp version of R routine rep

Aliases
repC
Keywords
internal
Usage
repC(x, times)
Arguments
x
numeric vector
times
integer vector
Value
A numeric vector
run.studies
Power Comparisons
CRAN · 4.1.0 · R2sample/man/run.studies.Rd · 2026-05-07

This function runs the case studies included in the package and compares the power of a new test to those included.

Aliases
run.studies
Usage
run.studies( TS, study, TSextra, With.p.value = FALSE, BasicComparison = TRUE, nsample = 500, alpha = 0.05, param_alt, maxProcessor, SuppressMessages = FALSE, B = 1000 )
Arguments
TS
routine to calculate test statistics.
study
either the name of the study, or its number. If missing all the studies are run.
TSextra
list passed to TS.
With.p.value
=FALSE does user supplied routine return p values?
BasicComparison
=TRUE if true compares tests on one default value of parameter of the alternative distribution.
nsample
= 500, desired sample size.
alpha
=0.05 type I error
param_alt
(list of) values of parameter under the alternative hypothesis. If missing included values are used.
maxProcessor
number of cores to use for parallel programming
SuppressMessages
= FALSE print informative messages?
B
= 1000
Details
For details consult vignette("R2sample","R2sample")
Value
A (list of ) matrices of power values.
Examples
#The new test is a simple chisquare test: chitest = function(x, y, TSextra) nbins=TSextra$nbins nx=length(x);ny=length(y);n=nx+ny xy=c(x,y) bins=quantile(xy, (0:nbins)/nbins) Ox=hist(x, bins, plot=FALSE)$counts Oy=hist(y, bins, plot=FALSE)$counts tmp=sqrt(sum(Ox)/sum(Oy)) chi = sum((Ox/tmp-Oy*tmp)^2/(Ox+Oy)) pval=1-pchisq(chi, nbins-1) out=ifelse(TSextra$statistic,chi,pval) names(out)="ChiSquare" out TSextra=list(nbins=5,statistic=FALSE) # Use 5 bins and calculate p values run.studies(chitest,TSextra=TSextra, With.p.value=TRUE, B=100)
run_shiny
Runs the shiny app associated with R2sample package
CRAN · 4.1.0 · R2sample/man/run_shiny.Rd · 2026-05-07

Runs the shiny app associated with R2sample package

Aliases
run_shiny
Usage
run_shiny()
Value
No return value, called for side effect of opening a shiny app
signif.digits
This function does some rounding to nice numbers
CRAN · 4.1.0 · R2sample/man/signif.digits.Rd · 2026-05-07

This function does some rounding to nice numbers

Aliases
signif.digits
Usage
signifdigits(x, d = 4)
Arguments
x
a list of two vectors
d
=4 number of digits to round to
Value
A list with rounded vectors
testC
run test using either simulation or permutation.
CRAN · 4.1.0 · R2sample/man/testC.Rd · 2026-05-07

run test using either simulation or permutation.

Aliases
testC
Keywords
internal
Usage
testC(dta, TS, typeTS, TSextra, B = 5000L)
Arguments
dta
a list with the data
TS
routine to calculate test statistics for non-chi-square tests
typeTS
type of a test statistic
TSextra
additional info passed to TS, if necessary
B
=5000, number of simulation runs.
Value
A list with test statistics and p values
test_methods
This function checks whether the correct methods have been requested
CRAN · 4.1.0 · R2sample/man/test_methods.Rd · 2026-05-07

This function checks whether the correct methods have been requested

Aliases
test_methods
Keywords
internal
Usage
test_methods(doMethods, Continuous, UseLargeSample, WithWeights)
Arguments
doMethods
="all" Which methods should be included?
Continuous
is data continuous
UseLargeSample
should p values be found via large sample theory?
WithWeights
with weights?
Value
TRUE or FALSE
timecheck
test function
CRAN · 4.1.0 · R2sample/man/timecheck.Rd · 2026-05-07

test function

Aliases
timecheck
Usage
timecheck(dta, TS, typeTS, TSextra)
Arguments
dta
data set
TS
test statistics
typeTS
format of TS
TSextra
additional info TS
Value
Mean computation time
twosample_power
Power estimation for two-sample methods
CRAN · 4.1.0 · R2sample/man/twosample_power.Rd · 2026-05-07

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

Aliases
twosample_power
Usage
twosample_power( f, ..., TS, TSextra, With.p.value = FALSE, alpha = 0.05, B = 1000, nbins = c(50, 10), minexpcount = 5, UseLargeSample, samplingmethod = "Binomial", rnull, SuppressMessages = FALSE, maxProcessor )
Arguments
f
function to generate a list with data sets x, y and (optional) vals, weights
...
additional arguments passed to f, up to 2
TS
routine to calculate test statistics for non-chi-square tests
TSextra
additional info passed to TS, if necessary
With.p.value
=FALSE does user supplied routine return p values?
alpha
=0.05, the level of the hypothesis test
B
=1000, number of simulation runs.
nbins
=c(50,10), number of bins for chi large and chi small.
minexpcount
=5 minimum required count for chi square tests
UseLargeSample
should p values be found via large sample theory if n,m>10000?
samplingmethod
="Binomial" or independence in discrete data case
rnull
a function that generates data from a model, possibly with parameter estimation.
SuppressMessages
= FALSE print informative messages?
maxProcessor
maximum number of cores to use. If maxProcessor=1 no parallel computing is used.
Details
For details consult vignette("R2sample","R2sample") This routine runs a number of different two-sample tests for univariate data, either discrete or continuous. The user can also provide their own test method.
Value
A numeric vector of power values.
Examples
# Power of standard normal vs. normal with mean mu. f1=function(mu) list(x=rnorm(25), y=rnorm(25, mu)) #Power of uniform discrete distribution vs. with different probabilities. twosample_power(f1, mu=c(0,2), B=100, maxProcessor = 1) f2=function(n, p) list(x=table(sample(1:5, size=1000, replace=TRUE)), y=table(sample(1:5, size=n, replace=TRUE, prob=c(1, 1, 1, 1, p))), vals=1:5) twosample_power(f2, n=c(1000, 2000), p=c(1, 1.5), B=100, maxProcessor = 1) # Compare power of a new test with those in package: myTS=function(x,y) z=c(mean(x)-mean(y),sd(x)-sd(y));names(z)=c("M","S");z cbind(twosample_power(f1, mu=c(0,2), TS=myTS,B=100, maxProcessor = 1), twosample_power(f1, mu=c(0,2), B=100, maxProcessor = 1)) # Power estimation if routine returns a p value myTS2=function(x, y) out=ks.test(x,y)$p.value; names(out)="KSp"; out twosample_power(f1, c(0,1), TS=myTS2, With.p.value = TRUE, B=100)
twosample_test
Tests for the univariate two-sample problem
CRAN · 4.1.0 · R2sample/man/twosample_test.Rd · 2026-05-07

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

Aliases
twosample_test
Usage
twosample_test( x, y, vals = NA, TS, TSextra, wx = rep(1, length(x)), wy = rep(1, length(y)), B = 5000, nbins = c(50, 10), minexpcount = 5, maxProcessor, UseLargeSample, samplingmethod = "Binomial", rnull, SuppressMessages = FALSE, doMethods = "all" )
Arguments
x
a vector of numbers if data is continuous or of counts if data is discrete or a list with the data
y
a vector of numbers if data is continuous or of counts if data is discrete.
vals
=NA, a vector of numbers, the values of a discrete random variable. NA if data is continuous data.
TS
routine to calculate test statistics for non-chi-square tests
TSextra
additional info passed to TS, if necessary
wx
A numeric vector of weights of x.
wy
A numeric vector of weights of y.
B
=5000, number of simulation runs for permutation test
nbins
=c(50,10), number of bins for chi square tests.
minexpcount
=5, minimum required expected counts for chi-square tests.
maxProcessor
maximum number of cores to use. If missing (the default) no parallel processing is used.
UseLargeSample
should p values be found via large sample theory if n,m>10000?
samplingmethod
="Binomial" or "independence" for discrete data
rnull
a function that generates data from a model, possibly with parameter estimation.
SuppressMessages
= FALSE print informative messages?
doMethods
="all" a vector of codes for the methods to include. If "all", all methods are used.
Details
For details consult vignette("R2sample","R2sample")
Value
A list of two numeric vectors, the test statistics and the p values.
Examples
R2sample::twosample_test(rnorm(1000), rt(1000, 4), B=1000) myTS=function(x,y) z=c(mean(x)-mean(y),sd(x)-sd(y));names(z)=c("M","S");z R2sample::twosample_test(rnorm(1000), rt(1000, 4), TS=myTS, B=1000) vals=1:5 x=table(sample(vals, size=100, replace=TRUE)) y=table(sample(vals, size=100, replace=TRUE, prob=c(1,1,3,1,1))) R2sample::twosample_test(x, y, vals)
twosample_test_adjusted_pvalue
Adjusted p values for simultaneous testing in the two-sample problem.
CRAN · 4.1.0 · R2sample/man/twosample_test_adjusted_pvalue.Rd · 2026-05-07

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.

Aliases
twosample_test_adjusted_pvalue
Usage
twosample_test_adjusted_pvalue( x, y, vals = NA, TS, TSextra, wx = rep(1, length(x)), wy = rep(1, length(y)), B = c(5000, 1000), nbins = c(50, 10), minexpcount = 5, samplingmethod = "independence", rnull, SuppressMessages = FALSE, doMethods )
Arguments
x
a vector of numbers if data is continuous or of counts if data is discrete, or a list with the data.
y
a vector of numbers if data is continuous or of counts if data is discrete.
vals
=NA, a vector of numbers, the values of a discrete random variable. NA if data is continuous data.
TS
routine to calculate test statistics for non-chi-square tests
TSextra
additional info passed to TS, if necessary
wx
A numeric vector of weights of x.
wy
A numeric vector of weights of y.
B
=c(5000, 1000), number of simulation runs for permutation test
nbins
=c(50,10), number of bins for chi square tests.
minexpcount
= 5, minimum required expected counts for chi-square tests
samplingmethod
="independence" or "Binomial" for discrete data
rnull
routine for parametric bootstrap
SuppressMessages
= FALSE print informative messages?
doMethods
="all" a vector of codes for the methods to include. If "all", all methods are used.
Details
For details consult vignette("R2sample","R2sample")
Value
A list of two numeric vectors, the test statistics and the p values.
Examples
x=rnorm(100) y=rt(200, 4) R2sample::twosample_test_adjusted_pvalue(x, y, B=c(500, 500)) vals=1:5 x=table(c(1:5, sample(1:5, size=100, replace=TRUE)))-1 y=table(c(1:5, sample(1:5, size=100, replace=TRUE, prob=c(1,1,3,1,1))))-1 R2sample::twosample_test_adjusted_pvalue(x, y, vals, B=c(500, 500))
wbincounter
Find counts and/or sum of weights in bins. Useful for power calculations. Replaces hist command from R.
CRAN · 4.1.0 · R2sample/man/wbincounter.Rd · 2026-05-07

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

Aliases
wbincounter
Keywords
internal
Usage
wbincounter(x, bins, w)
Arguments
x
numeric vector
bins
numeric vector
w
numeric vector of weights
Value
sum of weights in bins
weights
find weights for several statistics for discrete data
CRAN · 4.1.0 · R2sample/man/weights.Rd · 2026-05-07

find weights for several statistics for discrete data

Aliases
weights
Keywords
internal
Usage
weights(dta)
Arguments
dta
A list with vectors x, y and vals.
Value
A vector of weights

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN4.1.02026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.