The semiparametric accelerated failure time (AFT) model offers a direct and interpretable alternative to the Cox proportional hazards model, yet practical diagnostic tools for this framework remain limited. We introduce afttest, an R package that implements martingale-residual-based goodness-of-fit procedures for semiparametric AFT models. In addition to the recently developed multiplier bootstrap diagnostics, the package introduces a new computationally efficient resampling strategy based on an influence-function linear approximation. Unlike the original approach, which requires repeatedly solving estimating equations for each bootstrap replicate, the proposed method avoids iterative optimization and substantially reduces computation time while preserving asymptotic validity. Both the standard multiplier bootstrap and the accelerated linear approximation are implemented, allowing users to balance finite-sample performance and computational scalability. The package supports rank-based and least-squares estimators, provides omnibus, link function, and functional form tests, and includes graphical tools for visualizing residual processes. An application to the Mayo Clinic primary biliary cirrhosis study illustrates the workflow.
翻译:半参数加速失效时间(AFT)模型为Cox比例风险模型提供了一种直接且可解释的替代方案,但针对该框架的实用诊断工具仍然有限。本文介绍afttest——一个用于实现半参数AFT模型基于鞅残差的拟合优度检验程序的R包。除了近期发展的乘数自助法诊断工具外,该包还引入了一种基于影响函数线性近似的新型计算高效重抽样策略。与原始方法需要在每次自助法重复中反复求解估计方程不同,所提出的方法避免了迭代优化,在保持渐近有效性的同时显著减少了计算时间。包中同时实现了标准乘数自助法和加速线性近似方法,使用户能够在有限样本性能与计算可扩展性之间取得平衡。该包支持基于秩和最小二乘的估计量,提供综合性检验、连接函数检验和函数形式检验,并包含用于可视化残差过程的图形工具。通过对梅奥诊所原发性胆汁性肝硬化研究数据的应用,展示了该工具的工作流程。