K-Sample Tests for Truncated and/or Censored Data

Nonparametric analysis and comparison of distributions under left truncation and right censoring. The package includes simulation routines for truncated and/or censored survival data, nonparametric distribution comparison methods based on Kolmogorov-Smirnov-type and Cramér-von Mises-type statistics, and bootstrap routines for p-value approximation. For methodological details, see Lago, de Uña-Álvarez and Pardo-Fernández (2025) and Lago, Pardo-Fernández and de Uña-Álvarez (2026) .


ksamplesLTRC

ksamplesLTRC provides nonparametric k-sample tests for comparing distributions under left truncation and/or right censoring. It implements Kolmogorov–Smirnov-type, Cramér–von Mises-type, and weighted log-rank statistics, with bootstrap-based p-value approximation, for one or more independent samples of possibly truncated and/or censored survival data.

Installation

You can install ksamplesLTRC from CRAN with:

install.packages("ksamplesLTRC")

Example

A basic k-sample comparison under left truncation and right censoring, using the well-known channing dataset from the KMsurv package:

library(ksamplesLTRC)
library(KMsurv)
data(channing)

data.channing <- data.frame(channing$ageentry, 
                            channing$age,
                            channing$death, 
                            channing$gender)

aa <- ltrc.test(data.channing,
                holes='conditional',
                tests=c('ks','cvm','logrank'),
                B = 200,
                p=c(0,1,0.5,0),
                q=c(0,0,0.5,1))
plot(aa)
summary(aa)
#>           Test Statistic    p.value
#> 1           KS 1.4460553 0.71641791
#> 2          CvM 0.2785837 0.75621891
#> 3     p=0, q=0 2.2850754 0.13062379
#> 4     p=1, q=0 2.8141049 0.09343901
#> 5 p=0.5, q=0.5 1.8900577 0.16919541
#> 6     p=0, q=1 1.1779684 0.27776998

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ksamplesLTRC")

0.1.1 by Adrián Lago, a month ago


https://github.com/adrian-lago/ksamplesLTRC


Report a bug at https://github.com/adrian-lago/ksamplesLTRC/issues


Browse source code at https://github.com/cran/ksamplesLTRC


Authors: Adrián Lago [aut, cre] , Jacobo de Uña-Álvarez [aut] , Juan Carlos Pardo-Fernández [aut]


Documentation:   PDF Manual  


GPL-3 license


Suggests knitr, rmarkdown, KMsurv, survival, mvna, twosamples, testthat


See at CRAN