Abstract: Monotonicity testing is a classic and longstanding problem in statistics, with particular importance in econometrics when analyzing data measured over time. More generally, monotonicity often underlies many statistical methods as a common assumption, typically related to a true underlying function estimated from observed data. In this work, we introduce and describe the R package MontonicityTest which implements a nonparametric test of the null hypothesis that the conditional mean function E ( Y |X = x ) is monotone increasing (non-decreasing) in x given observed data on ( X, Y ). The test itself was introduced in Hall and Heckman (2000) but has thus far not been readily available. Our package leverages recursive least squares and is implemented in C++ using the Rcpp package, which significantly reduces computational time relative to a naive approach. We describe the package details and features, as well as illustrate the main functions with an application to simulated diabetes clinical trial data.
Huynh et al. (Thu,) studied this question.