Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Posterior Predictive Checks Of Event Histories

Model Diagnostics · Tutorial 609 of 697

Posterior Predictive Checks Of Event Histories

Use posterior predictive replications to assess whether a fitted joint model reproduces important features of observed survival histories.

Advanced 12 min read

What You'll Learn

  • Define posterior predictive replications for right-censored event histories under a fitted joint model.
  • Distinguish checks conditional on observed censoring times from checks that simulate censoring.
  • Compare observed and replicated event counts and censoring summaries using predictive distributions.
  • Use Kaplan–Meier summaries to compare event-time distributions when follow-up is censored.
  • Interpret posterior predictive tail areas cautiously and identify common diagnostic failures.

Why Check Replicated Event Histories?

A fitted joint model can describe longitudinal trajectories well and still reproduce survival outcomes poorly. It may predict too many events by a clinically relevant time, place events too early, or fail to reproduce the observed amount or timing of censoring. Posterior predictive checks address these questions by comparing the observed event history with histories simulated from the fitted model.

The goal is not to prove that a model is correct. A check asks whether a feature of the observed data would be unusual if the fitted model and its assumptions were adequate. The feature should be chosen to expose a relevant survival-component discrepancy, and the simulation should reproduce the design and conditioning used in the analysis.

Event Histories and Posterior Prediction

For subject \(i\), let \(T_i\) be the event time and \(C_i\) the censoring time. The observed follow-up time and event indicator are \(Y_i=\min(T_i,C_i)\) and \(\Delta_i=I(T_i\le C_i)\), respectively. Thus \(\Delta_i=1\) denotes an observed event and \(\Delta_i=0\) denotes right censoring. Let \(w_i\) denote observed baseline covariates and \(b_i\) the subject-specific random effects in the joint model.

A common survival component specifies an event hazard conditional on model parameters and the longitudinal process. For example, if \(m_i(t)\) is the subject-specific latent marker trajectory, one possible specification is

$$ h_i(t\mid b_i,\theta)=h_0(t;\theta)\exp\{\gamma^\mathsf{T}w_i+\alpha m_i(t)\}. $$

Here \(\theta\) collects model parameters, including baseline hazard and association parameters. The specific hazard form depends on the fitted joint model; a check must simulate from that fitted form, not from a different survival model. The event-time simulation must also respect the model's risk interval and any competing study-end rules.

Definition: A posterior predictive event history is a simulated survival outcome generated from the posterior predictive distribution, conditional on the observed data and the specified design information. For each posterior draw, parameters and any latent quantities are drawn or retained according to the chosen predictive target, and a replicated event history is generated from the model.

A typical workflow draws \(\theta^{(s)}\) from the posterior distribution and generates replicated outcomes \(T_i^{\mathrm{rep},(s)}\). The treatment of \(b_i\) matters. Drawing random effects from their posterior conditional on the subject's data gives a check conditional on information about these particular subjects. Drawing new effects from the estimated population distribution targets new subjects from the modeled population. These answer different questions; conditioning closely on subject-specific information can make a check less sensitive to misspecification.

Specify What Is Held Fixed

Right censoring requires an explicit prediction plan. One option is to hold each observed \(C_i\) fixed, simulate \(T_i^{\mathrm{rep}}\), and form \(Y_i^{\mathrm{rep}}=\min(T_i^{\mathrm{rep}},C_i)\) and \(\Delta_i^{\mathrm{rep}}=I(T_i^{\mathrm{rep}}\le C_i)\). This checks event predictions under the actual observed follow-up limits. It does not check whether a model for censoring is adequate, because the censoring times were not generated.

Alternatively, if the analysis specifies a censoring model, draw \(C_i^{\mathrm{rep}}\) from that model and construct the replicated observed history from both simulated times. This can assess censoring patterns, but requires an adequate censoring model and a defensible assumption about its relationship to event times. In standard survival analyses, censoring is often assumed independent of the event time conditional on modeled covariates and relevant history. If censoring is informative and the model does not account for it, ordinary posterior predictive comparisons may be misleading.

The posterior predictive distribution of a summary \(D\) is the distribution of \(D^{\mathrm{rep}}\) across replicated histories, with uncertainty in fitted quantities included. A one-sided posterior predictive tail area can be estimated as

$$ \widehat{p}_{\mathrm{ppc}}= \frac{1+\sum_{s=1}^{S} I\{D^{\mathrm{rep},(s)}\ge D^{\mathrm{obs}}\}}{S+1}. $$

For a lower-tail question, reverse the inequality. The added one prevents reporting a zero estimate when no simulated value is as extreme as the observed value. This tail area is a model-checking measure, not a frequentist p-value with a uniform null distribution. Because the same data inform the posterior and the discrepancy, posterior predictive tail areas can be conservative.

Choose Survival Summaries That Match the Question

Useful discrepancies include the total number of events by a fixed time, the distribution of event-free time, and the number or timing of censorings. These summaries should be defined before examining the resulting predictive comparisons, and time points should be meaningful and within the observed follow-up range.

  • Event counts: compare the observed number of events by a time \(t\) with replicated counts. Counts are easy to interpret but may conceal when events occurred or which subgroups drive a discrepancy.
  • Event-time distribution: compare a survival curve or selected survival probabilities. When follow-up is censored, a Kaplan–Meier estimate uses both event and censoring information; a histogram of observed event times alone discards censored observations and can distort the comparison.
  • Censoring pattern: compare counts censored by selected times or the distribution of censoring times when censoring is simulated. If observed censoring times are held fixed, the replicated censoring pattern is fixed by construction and is not a test of the censoring mechanism.

Worked Example: Checking the Number of Events by 12 Months

Suppose a hypothetical cohort has 40 subjects, with 24 observed events by 12 months. A fitted joint model is used to generate 1,000 posterior predictive histories, holding the observed censoring times fixed. In 39 replications, at least 24 events occur by 12 months.

The discrepancy is \(D=\) number of events by 12 months, and the observed value is \(D^{\mathrm{obs}}=24\). The estimated upper-tail area is

$$ \widehat{p}_{\mathrm{ppc}}= \frac{1+39}{1000+1} =\frac{40}{1001} =0.0400. $$

Only about 4.0% of the replicated histories have an event count at least as large as the observed count. This is a warning that the model may underpredict events by 12 months, but it is not a probability that the model is false or a calibrated test of a null hypothesis. The conclusion is conditional on the fitted model, posterior, and fixed censoring design. Inspecting other times and summaries can reveal whether the discrepancy is localized or part of a broader mismatch.

Compare Event-Time Distributions With Censoring Present

A Kaplan–Meier summary is often more appropriate than comparing only observed event times. At each event time, it estimates the probability of remaining event-free by multiplying the conditional survival proportions among those still at risk. Censoring removes a subject from subsequent risk sets but is not counted as an event. The method relies on censoring being non-informative for event time under the analysis conditions.

For a predictive check, calculate the same summary from observed data and every replicated data set. This gives a predictive distribution for the selected survival probability or curve feature. The Kaplan–Meier estimate is a summary for comparison, not an additional data-generation step. A small sample can make its uncertainty wide, so a visual or numerical discrepancy should be interpreted alongside the number at risk and the predictive spread.

Worked Example: Comparing Event-Free Survival at 8 Months

Consider a hypothetical sample of six subjects with observed times and indicators: event at 4 months, censoring at 6, event at 7, event at 9, censoring at 10, and event at 12. Assume censoring is non-informative for this illustrative Kaplan–Meier calculation.

At month 4, all six are at risk and one event occurs, so the estimated event-free probability becomes \(5/6\). The subject censored at month 6 leaves the risk set. At month 7, four subjects remain at risk and one event occurs, giving

$$ \widehat{S}(8)=\frac{5}{6}\left(\frac{3}{4}\right) =\frac{15}{24}=0.625. $$

There are no further events before month 8, so the estimate is 0.625. Suppose 500 posterior predictive histories, with the observed censoring times fixed, produce 61 Kaplan–Meier estimates at month 8 that are at or below 0.625. The lower-tail estimate is

$$ \widehat{p}_{\mathrm{ppc}}= \frac{1+61}{500+1} =\frac{62}{501}=0.1238. $$

The observed event-free estimate is lower than the estimate in most replications, but a lower-tail area of about 0.124 is not an especially extreme discrepancy by itself. With only six subjects, the estimate is also imprecise. This comparison concerns event-free survival at 8 months; it does not establish that the full event-time distribution is adequate.

Check Censoring Patterns When They Are Simulated

A censoring check requires replicated censoring times, not just replicated event times. For example, a censoring model might generate \(C_i^{\mathrm{rep}}\) conditional on administrative study end and observed predictors. A useful discrepancy could be the number censored before 12 months. The check is meaningful only if the censoring model and its assumptions are part of the analysis and the same censoring summary is computed for observed and replicated histories.

Worked Example: Early Censoring Counts

Suppose a hypothetical study observes 20 of 50 subjects censored before 12 months. A fitted censoring model is included in the prediction scheme, and 1,000 replicated data sets are generated. The replicated number censored before 12 months has mean 15 and standard deviation 3; 42 replications have counts of at least 20.

For the observed count \(D^{\mathrm{obs}}=20\), the upper-tail estimate is

$$ \widehat{p}_{\mathrm{ppc}}= \frac{1+42}{1000+1} =\frac{43}{1001}=0.0430. $$

The observed early-censoring count is unusually high relative to this model's predictive distribution and merits investigation. The difference from the predictive mean is \(20-15=5\) subjects, or \(5/3=1.67\) predictive standard deviations. This standardized difference is descriptive, not a formal test statistic with a standard normal reference distribution. Possible explanations include a poor censoring model, an incorrect follow-up representation, or an omitted feature that affects censoring. If censoring times had instead been fixed at their observed values, this comparison could not be made: every replication would have the same censoring times by design.

Justification and Practical Workflow

The central calculation follows directly from conditional probability. If \(D^{\mathrm{rep}}\) is a chosen discrepancy, then its posterior predictive distribution averages its sampling distribution over uncertainty about the fitted quantities:

$$ p(D^{\mathrm{rep}}\mid \text{data}) =\int p(D^{\mathrm{rep}}\mid \theta,\text{design})\, p(\theta\mid \text{data})\,d\theta. $$

In simulation, the integral is approximated by drawing \(\theta^{(s)}\) from the posterior, simulating a history under that draw and the chosen design, and computing \(D^{\mathrm{rep},(s)}\). Averaging the indicators \(I\{D^{\mathrm{rep},(s)}\ge D^{\mathrm{obs}}\}\) estimates the corresponding tail probability. Thus posterior uncertainty and outcome variability both contribute to the predictive distribution; plugging in a single parameter estimate would omit the former.

1
Define the target.
Choose an event-count, event-time, or censoring summary and specify the time horizon and tail direction.
2
State the conditioning.
Decide whether random effects are conditioned on subject information or redrawn, and whether censoring times are fixed or simulated.
3
Replicate and summarize.
Generate event histories under posterior draws, apply the same observation and censoring rules, and calculate the chosen summary for every replicate.
4
Compare and diagnose.
Locate the observed summary in its predictive distribution, then examine relevant neighboring summaries and model assumptions before drawing a conclusion.

Diagnostics, Alternatives, and Limitations

A predictive distribution that is too narrow, shifted, or systematically unlike the observed summaries signals that the model may not capture the relevant feature. Check that simulated histories obey the same entry, follow-up, and administrative censoring rules as the observed data. Also confirm that event indicators and time scales were encoded consistently. Monte Carlo uncertainty matters: with few replications, tail-area estimates are noisy, so increase \(S\) when a decision depends on a small tail area.

Posterior predictive checks complement, rather than replace, survival residual diagnostics such as martingale, Cox–Snell, and event-time probability integral transform residuals. Residual methods summarize subject-level departures in particular ways; posterior predictive checks directly ask whether selected features of whole replicated histories resemble the observed data. Neither approach alone guarantees adequate fit. A global event count can look reasonable while event timing is wrong, and an acceptable event-time summary can conceal poor fit in a subgroup.

These checks are limited by the summaries selected, the fitted model, and the censoring assumptions. Repeatedly searching many summaries and reporting only the most extreme comparison exaggerates apparent evidence of misfit. Also, posterior predictive tail areas are not calibrated frequentist significance levels, especially when the discrepancy is strongly informed by the same data used to estimate the posterior. Treat an unusual comparison as a prompt for focused model assessment, not an automatic instruction to change one parameter.

Common Pitfall

Wrong reasoning: “The replicated data use the observed censoring times, and their censoring pattern resembles the data, so the model reproduces censoring well.” Correction: with censoring times fixed, the replicated pattern is imposed, not predicted. This design can assess event outcomes under the observed follow-up limits, but checking the censoring process requires generating censoring times from an explicit censoring model. A second pitfall is comparing only the times of observed events as if they were a complete sample of event times; censoring makes that subset selective. Use a censoring-aware summary, such as a Kaplan–Meier estimate, and state the assumptions needed for its interpretation.

Key takeaway: A posterior predictive check is only as informative as its discrepancy and simulation design. State what is conditioned on, reproduce the censoring scheme appropriately, compare identical summaries, and interpret tail areas as diagnostic evidence rather than definitive tests.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. In a posterior predictive check, observed censoring times are held fixed. Can this check assess whether the censoring model is adequate? Why?
  2. For an observed count of 18 events by 10 months, 29 of 999 replications have at least 18 events. Calculate the upper-tail estimate using the plus-one formula.
  3. Why is a histogram of observed event times alone generally not an adequate comparison when some subjects are censored?
  4. What does drawing random effects from their posterior conditional on each subject's data target, compared with drawing new effects from a population distribution?

Solutions. (1) No. Fixed censoring times are imposed on every replication, so their pattern is not generated and cannot diagnose the censoring model. (2) \((1+29)/(999+1)=30/1000=0.0300\); about 3.00% of replications have at least 18 events, a potentially notable upper-tail discrepancy, not a probability that the model is false. (3) Censored subjects do not have observed event times, and omitting them selects only subjects whose events were observed; a censoring-aware summary such as a Kaplan–Meier estimate uses the risk sets and censoring information under its assumptions. (4) Posterior conditional effects target predictions informed by these subjects' data, whereas new draws from the population distribution target histories for new subjects from the modeled population.

Clinical Biostats