Model diagnostics is an indispensable component of regression analysis, yet it is not well addressed in standard textbooks on generalized linear models. The lack of exposition is attributed to the fact that when outcome data are discrete, classical methods (e.g., Pearson/deviance residual analysis and goodness-of-fit tests) have limited utility in model diagnostics and treatment. This paper establishes a novel framework for model diagnostics of discrete data regression. Unlike the literature defining a single-valued quantity as the residual, we propose to use a function as a vehicle to retain the residual information. In the presence of discreteness, we show that such a functional residual is appropriate for summarizing the residual randomness that cannot be captured by the structural part of the model. We establish its theoretical properties, which leads to the innovation of new diagnostic tools including the functional-residual-vs covariate plot and Function-to-Function (Fn-Fn) plot. Our numerical studies demonstrate that the use of these tools can reveal a variety of model misspecifications, such as not properly including a higher-order term, an explanatory variable, an interaction effect, a dispersion parameter, or a zero-inflation component. The functional residual yields, as a byproduct, Liu-Zhang's surrogate residual mainly developed for cumulative link models for ordinal data (Liu and Zhang, 2018, JASA). As a general notion, it considerably broadens the diagnostic scope as it applies to virtually all parametric models for binary, ordinal and count data, all in a unified diagnostic scheme.
Z-residual diagnostics for detecting misspecification of the functional form of covariates for shared frailty models
在生存分析中,风险函数往往依赖于一组协变量。鞅和偏差残差最广泛地用于检查协变量函数形式的有效性,通过检查其对连续协变量的散点图中是否存在可辨别的趋势。然而,目视检查鞅和偏差残差往往是主观的。此外,由于删失,这些残差缺乏参考分布。因此,它是具有挑战性的数值统计检验的基础上鞅或偏差残差。在本文中,我们扩展了随机生存概率的思想(Li et al. 2021),并开发了一种残差诊断工具,可以提供图形和数值检验,用于检查半参数共享脆弱模型中的协变量函数形式。我们开发了一个通用函数,它基于R中\texttt{survival}包中\texttt{coxph}函数的输出计算半参数共享脆弱模型的Z残差。我们广泛的模拟研究表明,基于Z-残差推导的数值检验方法对于检验协变量的函数形式有很大的作用。在急性髓性白血病患者生存时间建模的实际数据应用中,Z-残差诊断结果表明,具有对数变换的模型不适合建模生存时间,这不能通过其他诊断方法检测。