Skip to content

RATest

0.1.12Package record

Randomization Tests

0packages depend
4.5Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

A collection of randomization tests, data sets and examples. The current version focuses on five testing problems and their implementation in empirical work. First, it facilitates the empirical researcher to test for particular hypotheses, such as comparisons of means, medians, and variances from k populations using robust permutation tests, which asymptotic validity holds under very weak assumptions, while retaining the exact rejection probability in finite samples when the underlying distributions are identical. Second, the description and implementation of a permutation test for testing the continuity assumption of the baseline covariates in the sharp regression discontinuity design (RDD) as in Canay and Kamat (2018) https://goo.gl/UZFqt7. More specifically, it allows the user to select a set of covariates and test the aforementioned hypothesis using a permutation test based on the Cramer-von Misses test statistic. Graphical inspection of the empirical CDF and histograms for the variables of interest is also supported in the package. Third, it provides the practitioner with an effortless implementation of a permutation test based on the martingale decomposition of the empirical process for testing for heterogeneous treatment effects in the presence of an estimated nuisance parameter as in Chung and Olivares (2021) doi:10.1016/j.jeconom.2020.09.015. Fourth, this version considers the two-sample goodness-of-fit testing problem under covariate adaptive randomization and implements a permutation test based on a prepivoted Kolmogorov-Smirnov test statistic. Lastly, it implements an asymptotically valid permutation test based on the quantile process for the hypothesis of constant quantile treatment effects in the presence of an estimated nuisance parameter.

Changes in 0.1.12

Bug fixes (Khmaladze permutation tests)

This release corrects several errors in the Khmaladze-transformation

permutation tests PT.Khmaladze.fit() and PTQTE.Khmaladze.fit(). Users of

these functions in earlier versions should re-run their analyses. A detailed

erratum documenting each issue, its mechanism, and the corrected behavior is

available separately.

  • **PT.Khmaladze.fit() — empirical process.** The two-sample empirical process was constructed so that the test statistic did not depend on the treatment sample. It now evaluates both empirical CDFs at the control quantiles (generalized-inverse convention) as intended.
  • **PT.Khmaladze.fit() — score function.** The extended score is now estimated on the correct (outcome) scale and with the correct normalization (-psi from quantreg::akj, i.e. f'/f, rather than f').
Show all changes in 0.1.12Hide the rest of the changes in 0.1.12
  • **PT.Khmaladze.fit() / PTQTE.Khmaladze.fit() — evaluation grid.** The compensator grid was set to three times the total sample size, which disabled the score-direction projection of the martingale transform. The grid is now tied to the control sample size, restoring the intended behavior.
  • **PTQTE.Khmaladze.fit() — observed statistic.** The observed treatment assignment was not included among the permutations, forcing the rejection rate to equal the nominal level regardless of the data. The observed assignment is now included, so the test has power against alternatives.

New features

  • **PT.Khmaladze.fit() gains an akj.control argument**, an optional named list of tuning parameters passed to quantreg::akj for score estimation (alpha, kappa, h, iker1). The default (standard akj settings) is recommended: in simulation, alternative settings that reduce the score's estimation error were found to lower test power.

Notes

  • Under the designs used in the associated papers the corrected tests have approximately nominal size. Under heavier-tailed designs, finite-sample size distortion can appear at small samples and diminishes as the sample size grows.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.0 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-30
  • WARNING10 OK, 2 NOTE, 1 WARNING2026-06-05
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.1.12
READMEYes · 214 wordsVignettesYes · 1 · dynamicNEWSYes · 67% structured · mentions 0.1.12Citation fileNo
Help pages
18
Examples that run
14%1 run in a plain check · 6 never run
Exported functions with examples
60%
Documented parameters
98%
Return-value docs
100%
Help pages citing references
67%

Downloads

4.5K
CRAN downloads in the past year
Rank #5,143 · ~12/day · ~377/mo
Daily download trend is not available in this view yet.
47130 days
1.6K90 days
4.5K1 year
Compare downloads with other packages →
Also on118 r2u96 c2d4u

Repository

7Stars
1Forks
2Open issues
0Open PRs
0Releases
22Commits
1Commit identities
22 commits · Last activity 2018-12-05 · 0% stars, 30d · The default branch showed an older version (0.1.4) than CRAN on 2026-10-21
Responsiveness
How these are sampled
PRs merged (all time)
0%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-06-06 · 72026-07-07 · 7
PracticesBeta

3 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/ignaciomsarmiento/ratest on 2026-10-21.

Docs source (1)

GitHub Pages site last deployed 2018-12-05

CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing RATest adds 21 packages (9 with compiled code, 15 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.

Depends (3)
Imports (3)
statsquantregcompiler
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (2)
Author, Maintainer · added in 0.1.7

Maintainer since 0.1.0 (2017)

Listed in earlier versions (1)
Mauricio Olivares-Gonzalez
no longer listed · 0.1.0 to 0.1.6
Releases (13)

Pick two releases to compare their code metrics.

  • 0.1.12Latest
    record
    2026-09-07 · current release · diff ↗
  • 0.1.11
    record
    2026-08-21 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 0.1.10
    record
    2022-09-29 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.9
    record
    2021-07-13 · diff ↗ ·
    added 1 export
    PTQTE.Khmaladze.fit
  • R
    R 4.1.0 released · 2021-05-18
  • 0.1.8
    record
    2020-10-17 · diff ↗ ·
    added 1 export
    prepivot.ks.permtest
  • R
    R 4.0.0 released · 2020-04-24
  • 0.1.7
    record
    2020-01-24 · diff ↗ ·
    added 2 exports
    PT.Khmaladze.MultTest, randomization.test
  • 0.1.6
    record
    2019-07-18 · diff ↗ ·
    added 1 export
    group.action
  • 0.1.5
    record
    2019-07-12 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
Show 7 earlier eventsHide 7 earlier events

Package metadata

First published
2017-08-14
Total releases
13 / 9 yrs
License
MIT + file LICENSE OSI · relicensed from GPL (>= 2) in 0.1.11
Minimum R
≥ 3.00
Bundled data
94 KB / 1 file
Download size
322 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("RATest")
Olivares, M., & Sarmiento-Barbieri, I. (2026). RATest: Randomization Tests (Version 0.1.12) [Computer software]. https://doi.org/10.32614/CRAN.package.RATest

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for RATest version 0.1.12 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy