The R package afttest is intended to be a user-friendly supplementary package to the base package aftgee.
In addition to the R interface, afttest provides a C++ header-only library integrated with Rcpp, which allows the construction of spline basis functions directly in C++ with the help of Rcpp and RcppArmadillo.
You can install the released version from CRAN.
install.packages("afttest")
The latest version of the package is under development at GitHub. If it is able to pass the automated package checks, one may install it by
if (!require(devtools)) install.packages("devtools")
devtools::install_github("WoojungBae/afttest")
The implementation of the main functions has been written in C++ with the help of the Rcpp and RcppArmadillo packages. The computational performance has thus been boosted.
The Replication/ directory contains the replication material for the JSS
manuscript, including the Primary Biliary Cirrhosis analysis, the figures, and
the simulations underlying Tables 1 and 2. The components have different
computational requirements.
Replication/afttest_replication_script.RReplication/package_sim2_hpc_TIME.R &
Replication/batchAFTsim2_hpc_TIME.sbatch
.sbatch file is configured
for execution on a High-Performance Computing (HPC) cluster (e.g., University of
Florida HiPerGator).Replication/package_sim2_hpc.R &
Replication/batchAFTsim2_hpc.sbatch
.sbatch file.Due to the journal’s time and computational constraints, the simulation results reported in the paper were based on a reduced set of Monte Carlo runs and parameter settings.
linApprox = TRUE versus linApprox = FALSE.gamma = 0.0 and 0.5. Results report the
empirical Type I error and power for linApprox = TRUE.Running the scripts in the replication folder produces a broader set of simulation results than those reported in the paper.
gamma = 0.0, 0.1, 0.2, 0.3, 0.4, and 0.5.
Results report the empirical Type I error and power for linApprox = TRUE.Run from the package root. The replication scripts reside in
Replication/.
To reproduce the manuscript analyses, figures, and simulation code: Open R or RStudio, set the working directory to the package root, and source:
source("Replication/afttest_replication_script.R")
To reproduce Tables 1 and 2 (HPC environment): If you have access to a Slurm-based HPC cluster, submit the batch jobs directly from the terminal:
sbatch Replication/batchAFTsim2_hpc_TIME.sbatch
sbatch Replication/batchAFTsim2_hpc.sbatch
Note: To run the simulation scripts locally for verification, open the
respective R scripts, drastically reduce the sim_per_file parameter, and
execute them in your R console.
Bae, W., Choi, D., Yan, J., Kang, S. (2026). Diagnostics for semiparametric accelerated failure time models with R Package afttest. Journal of Statistical Software, to appear, arxiv.org/abs/2511.09823.
Choi, D., Bae, W., Yan, J., and Kang, S. (2024). A general model-checking procedure for semiparametric accelerated failure time models. Statistics and Computing, 34(3) 117.
Bae, W., Choi, D., Yan, J., Kang, S. (2022). afttest: Model Diagnostics for Accelerated Failure Time Models. CRAN, https://CRAN.R-project.org/package=afttest.
Chiou, S., Kang, S., and Yan, J. (2014). Fitting accelerated failure time model in routine survival analysis with R package aftgee. Journal of Statistical Software, 61(11): 1--23.