Learn R Programming

csranks

The R package csranks provides statistical tools for estimation and inference involving ranks (the position in a ranking). Two central functions are csranks for confidence sets for ranks and lmranks for regressions involving ranks, e.g. rank-rank regressions that are popular in applied work in economics.

The functions are based on recent work developing these procedures and their theoretical properties. The confidence sets for ranks are based on Mogstad, Romano, Shaikh, and Wilhelm (2023) and Bazylik, Mogstad, Romano, Shaikh, and Wilhelm (2022). The inference methods for regressions involving ranks are developed in Chetverikov and Wilhelm (2023).

Installation

You can install the released version of csranks from CRAN with:

install.packages("csranks")

You can install the development version of csranks from GitHub with:

# install.packages("remotes")
remotes::install_github("danielwilhelm/R-CS-ranks")

Demo

If you want to play around with the confidence sets for ranks, feel free to try out demo available here.

Here is a sneak peek:

Copy Link

Version

Install

install.packages('csranks')

Monthly Downloads

349

Version

1.3.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Daniel Wilhelm

Last Published

August 21st, 2026

Functions in csranks (1.3.0)

irank

Compute ranks
irank_against

Compute integer ranks in another reference vector
parent_child_income

Income of parents and children
csranks

Confidence sets for ranks
cstaubest

Confidence sets for the tau-best
lmranks

Regressions Involving Ranks
csranks_multinom

Confidence sets for ranks based on multinomial data
ivregranks

Instrumental-Variable Regression by 2SLS Estimation Involving Ranks
plot.csranks

Plot ranking with confidence sets
pisa

Cross-country comparison of students' achievement
pisa2018

Cross-country comparison of students' achievement