Skip to contents

Matched-Set Notation and Model Setup

The nested case–control (NCC) design provides an efficient alternative for fitting Cox proportional hazards models when covariate measurement for the full cohort is costly. At each observed failure time, the failing subject (the case) is retained, while a number of controls are randomly sampled from the corresponding risk set. The resulting sampled matched sets are then analyzed using conditional likelihood.

We first introduce the matched-set notation. Let k(s)\mathcal{R}_k^{(s)} denote the at-risk set at time tk(s)t_k^{(s)} in stratum ss. For the failure at tk(s)t_k^{(s)}, we randomly sample mm controls from k(s)\mathcal{R}_k^{(s)}, excluding the failing subject and matched by stratum. The failing subject together with the sampled controls forms a matched set of size m+1m+1, which we denote by ̃k(s)\tilde{\mathcal{R}}_k^{(s)}. Since each stratum contains K(s)K^{(s)} unique failure times, the NCC design yields a total of M=s=1SK(s)M = \sum_{s=1}^{S} K^{(s)} matched sets across all strata.

Under this construction, the matched set ̃k(s)\tilde{\mathcal{R}}_k^{(s)} forms a subset of the full at-risk set k(s)\mathcal{R}_k^{(s)}. Following the probabilistic framework introduced in the Cox KL divergence vignette, we similarly define a sequence of conditional experiments {Ãk(s)(i)B̃k(s):k=1,,K(s),s=1,,S}\{\tilde A_k^{(s)}(i) \mid \tilde B_k^{(s)} : k=1,\ldots,K^{(s)},\, s=1,\ldots,S\}. Here Ãk(s)(i)\tilde A_k^{(s)}(i) denotes the event that subject ĩk(s)i \in \tilde{\mathcal{R}}_k^{(s)} is the failing subject in the (s,k)(s,k)-th matched set, and B̃k(s)\tilde B_k^{(s)} collects all failure and censoring information up to time tk(s){t_k^{(s)}}^{-}, together with the information that the matched set ̃k(s)\tilde{\mathcal{R}}_k^{(s)} has been formed by sampling mm controls from k(s)\mathcal{R}_k^{(s)} and that exactly one failure occurs in [tk(s),tk(s)+dtk(s))[t_k^{(s)},\, t_k^{(s)} + dt_k^{(s)}).

Consequently, within the (s,k)(s,k)-th matched set, the NCC working model similarly specifies the conditional density within the matched set as a Multinomial distribution with a single trial, i.e.,

Multinomial(1,𝐪̃k(s)), \mathrm{Multinomial}\!\left(1,\, \tilde{\mathbf{q}}_k^{(s)}\right),

where the probability mass assigned to subject ĩk(s)i \in \tilde{\mathcal{R}}_k^{(s)} is

𝐪̃k(s)(i):=𝒫{Ãk(s)(i)|B̃k(s)}=exp{r(𝐙i(s),𝛃)}j̃k(s)exp{r(𝐙j(s),𝛃)}. \tilde{\mathbf{q}}_k^{(s)}(i) := \mathcal{P}\!\left\{\tilde A_k^{(s)}(i) \,\middle|\, \tilde B_k^{(s)}\right\} = \frac{ \exp\!\left\{ r(\mathbf{Z}_i^{(s)}, \boldsymbol{\beta}) \right\} }{ \sum_{j \in \tilde{\mathcal{R}}_k^{(s)}} \exp\!\left\{ r(\mathbf{Z}_j^{(s)}, \boldsymbol{\beta}) \right\} }.

KL Divergence Formulation

Because the full at-risk set k(s)\mathcal{R}_k^{(s)} is not used, the conditional probability 𝐪̃k(s)(i)\tilde{\mathbf{q}}_k^{(s)}(i) generally differs from the corresponding conditional probability 𝐪k(s)(i)\mathbf{q}_k^{(s)}(i) in the internal Cox working model. Nevertheless, the probabilities 𝐪̃k(s)(i)\tilde{\mathbf{q}}_k^{(s)}(i) remain valid conditional probabilities within the matched set, since

ĩk(s)𝐪̃k(s)(i)=1. \sum_{i \in \tilde{\mathcal{R}}_k^{(s)}} \tilde{\mathbf{q}}_k^{(s)}(i) = 1.

When the matched set is formed by random sampling from k(s)\mathcal{R}_k^{(s)}, the denominator satisfies

𝔼[j̃k(s)exp{r(𝐙j(s),𝛃)}]m|k(s)|jk(s)exp{r(𝐙j(s),𝛃)}, \mathbb{E}\!\left[ \sum_{j \in \tilde{\mathcal{R}}_k^{(s)}} \exp\!\left\{ r(\mathbf{Z}_j^{(s)}, \boldsymbol{\beta}) \right\} \right] \approx \frac{m}{|\mathcal{R}_k^{(s)}|} \sum_{j \in \mathcal{R}_k^{(s)}} \exp\!\left\{ r(\mathbf{Z}_j^{(s)}, \boldsymbol{\beta}) \right\},

when the risk-set size |k(s)||\mathcal{R}_k^{(s)}| is large. However, it is important to note that these two probabilities are defined under different conditioning events: 𝐪k(s)(i)\mathbf{q}_k^{(s)}(i) conditions on the full at-risk set k(s)\mathcal{R}_k^{(s)}, whereas 𝐪̃k(s)(i)\tilde{\mathbf{q}}_k^{(s)}(i) conditions on the sampled matched set ̃k(s)\tilde{\mathcal{R}}_k^{(s)}. Consequently, the two probabilities are not directly comparable and do not satisfy a simple proportional relationship. Numerically, the value of 𝐪̃k(s)(i)\tilde{\mathbf{q}}_k^{(s)}(i) is typically larger than 𝐪k(s)(i)\mathbf{q}_k^{(s)}(i) because the matched set constitutes only a subsample of the full risk set, resulting in a smaller normalization set in the denominator. However, such a comparison should be interpreted with caution, since the two probabilities correspond to different conditional experiments. In particular, under the NCC construction the probability 𝐪̃k(s)(i)\tilde{\mathbf{q}}_k^{(s)}(i) is defined only for subjects included in the sampled matched set, whereas subjects in the full risk set who are not sampled into the matched set do not have a corresponding probability defined in this conditional experiment.

To extract information from the external model under the NCC design, we similarly replace the internal risk score by the external risk score r̃()\tilde r(\cdot) obtained from the external coefficient estimates 𝛃̃\tilde{\boldsymbol\beta}. Analogous to the construction of 𝐪̃k(s)(i)\tilde{\mathbf q}_k^{(s)}(i), we define the corresponding probability mass under the external model within the matched set as

𝐩̃k(s)(i):=𝒫ext{Ãk(s)(i)B̃k(s)},ĩk(s), \tilde{\mathbf p}_k^{(s)}(i) := \mathcal P_{\mathrm{ext}}\!\left\{\tilde A_k^{(s)}(i)\mid \tilde B_k^{(s)}\right\}, \qquad i\in\tilde{\mathcal R}_k^{(s)},

which takes the same multinomial form as in the Cox construction but with the denominator restricted to the matched set ̃k(s)\tilde{\mathcal R}_k^{(s)}.

To quantify the discrepancy between the external and internal conditional probabilities for the (s,k)(s,k)-th matched set, we define the KL divergence:

𝐝KL(𝐩̃k(s)𝐪̃k(s))=ĩk(s)𝐩̃k(s)(i)log𝐩̃k(s)(i)𝐪̃k(s)(i). \mathbf d_{KL}\!\left(\tilde{\mathbf p}_k^{(s)}\|\tilde{\mathbf q}_k^{(s)}\right) = \sum_{i\in\tilde{\mathcal R}_k^{(s)}} \tilde{\mathbf p}_k^{(s)}(i) \log \frac{\tilde{\mathbf p}_k^{(s)}(i)} {\tilde{\mathbf q}_k^{(s)}(i)}.

Accumulating over all matched sets gives

𝒟KL(𝐏̃𝐐̃)=s=1Sk=1K(s)𝐝KL(𝐩̃k(s)𝐪̃k(s))=s=1Sk=1K(s)ĩk(s)𝐩̃k(s)(i)[r(𝐙i(s),𝛃)log{j̃k(s)exp{r(𝐙j(s),𝛃)}}]+Ψ̃, \mathcal D_{KL}(\tilde{\mathbf P}\|\tilde{\mathbf Q}) = \sum_{s=1}^{S} \sum_{k=1}^{K^{(s)}} \mathbf d_{KL}\!\left(\tilde{\mathbf p}_k^{(s)}\|\tilde{\mathbf q}_k^{(s)}\right) = -\sum_{s=1}^{S} \sum_{k=1}^{K^{(s)}} \sum_{i\in\tilde{\mathcal R}_k^{(s)}} \tilde{\mathbf p}_k^{(s)}(i) \Bigg[ r(\mathbf Z_i^{(s)},\boldsymbol\beta) - \log \Bigg\{ \sum_{j\in\tilde{\mathcal R}_k^{(s)}} \exp\!\left\{r(\mathbf Z_j^{(s)},\boldsymbol\beta)\right\} \Bigg\} \Bigg] + \tilde\Psi,

where Ψ̃\tilde\Psi does not involve 𝛃\boldsymbol\beta.

Let ξki(s)\xi_{ki}^{(s)} denote the indicator that subject ii is the observed failure in the (s,k)(s,k)-th matched set, so that the internal NCC conditional log-likelihood is

NCC(𝛃)=s=1Sk=1K(s)ĩk(s)ξki(s)[r(𝐙i(s),𝛃)log{j̃k(s)exp{r(𝐙j(s),𝛃)}}]. \ell_{\mathrm{NCC}}(\boldsymbol\beta) = \sum_{s=1}^{S} \sum_{k=1}^{K^{(s)}} \sum_{i\in\tilde{\mathcal R}_k^{(s)}} \xi_{ki}^{(s)} \Bigg[ r(\mathbf Z_i^{(s)},\boldsymbol\beta) - \log \Bigg\{ \sum_{j\in\tilde{\mathcal R}_k^{(s)}} \exp\!\left\{r(\mathbf Z_j^{(s)},\boldsymbol\beta)\right\} \Bigg\} \Bigg].

Integrated Objective Function

Proposition. Under the NCC construction, the integrated objective function satisfies

QηNCC(𝛃)=NCC(𝛃)+η𝒟KL(𝐏̃𝐐̃)s=1Sk=1K(s)ĩk(s){ξki(s)+η𝐩̃k(s)(i)1+ηr(𝐙i(s),𝛃)ξki(s)log[j̃k(s)exp{r(𝐙j(s),𝛃)}]}, Q_{\eta}^{\mathrm{NCC}}(\boldsymbol\beta) = -\ell_{\mathrm{NCC}}(\boldsymbol\beta) + \eta\,\mathcal D_{KL}(\tilde{\mathbf P}\|\tilde{\mathbf Q}) \propto -\sum_{s=1}^{S} \sum_{k=1}^{K^{(s)}} \sum_{i\in\tilde{\mathcal R}_k^{(s)}} \left\{ \frac{\xi_{ki}^{(s)}+\eta\,\tilde{\mathbf p}_k^{(s)}(i)}{1+\eta} \,r(\mathbf Z_i^{(s)},\boldsymbol\beta) - \xi_{ki}^{(s)} \log \left[ \sum_{j\in\tilde{\mathcal R}_k^{(s)}} \exp\!\left\{r(\mathbf Z_j^{(s)},\boldsymbol\beta)\right\} \right] \right\},

where NCC(𝛃)\ell_{\mathrm{NCC}}(\boldsymbol\beta) is the internal NCC conditional log-likelihood, 𝐩̃k(s)(i)\tilde{\mathbf p}_k^{(s)}(i) denotes the externally induced pseudo-event weight within the (s,k)(s,k)-th matched set that can be fully precomputed before optimization, and η0\eta\ge 0 is the integration weight.

It is worth emphasizing that, although the NCC design is commonly used as a computationally efficient surrogate for the Cox model and yields consistent estimators of the regression coefficients, the KL divergence defined under the NCC construction is not a direct surrogate for the Cox-model KL divergence. This is because the two KL quantities are defined with respect to different conditional experiments. Consequently, the corresponding probability models, and hence the associated KL divergences, are defined on different probability spaces.