Why Indexing Matters
A joint model uses two kinds of information about each subject: a sequence of longitudinal measurements and a time-to-event record. Before specifying either submodel, the data must be indexed so that every measurement is connected to the correct subject and time, and each subject’s event or censoring status is unambiguous. A small indexing error can change which observations belong in a subject’s record or incorrectly treat a censored time as an event.
The key organizational principle is that the subject is the unit carrying both histories. Visits are repeated observations within a subject; they are not independent subjects. The event-time record, in turn, summarizes how long the subject was followed and whether the event was observed. These definitions describe the data structure. They do not, by themselves, impose independence assumptions on the repeated measurements, missingness, or censoring.
Subject and Visit Indices
The subject index \(i\) labels a person or other study unit. A subject’s longitudinal record is a sequence of visit-level pairs \((t_{ij},Y_{ij})\), not a collection of unrelated records. The visit index \(j\) is local to that subject: visit 2 for subject 1 need not occur at the same calendar time, or even the same time since enrollment, as visit 2 for subject 2.
The time \(t_{ij}\) should have a clearly stated origin and unit. In many studies it is elapsed time since enrollment, such as months since baseline. Visits may be scheduled at common times, but actual measurement times can differ among subjects. If visits occur at baseline and 3, 6, and 12 months, for example, a measurement at \(t_{ij}=6\) means six months after the defined origin; it is not the sixth visit.
It is useful to distinguish the scheduled or eligible visit occasions from the measurements actually recorded. Let \(M_i\) be the number of visit occasions scheduled for subject \(i\) during the period in which that subject could still be observed. Define \(R_{ij}\) as the observation indicator:
A visit after a subject’s event is generally not an eligible occasion for a biomarker process that ends at the event. It should not be added to \(M_i\) as a missed visit merely because it appeared on the original study calendar. A missed eligible visit before the end of follow-up, however, can be represented by \(R_{ij}=0\). This distinction keeps “not observed because the event had already occurred” separate from “eligible but not recorded.”
Event Time, Censoring Time, and What Is Observed
The event time \(T_i\) is the time from the chosen origin until the event of interest. The censoring time \(C_i\) is the time at which event observation ends for a subject who has not had the event by then. It may arise from administrative study closure or loss to follow-up, among other reasons. For a censored subject, \(T_i\) is not observed; the data establish only that the subject remained event-free through \(C_i\), under the usual right-censoring interpretation.
Consequently, the observed follow-up time \(\tilde T_i\) is not synonymous with the event time. It equals the event time when an event is observed and the censoring time otherwise. The pair \((\tilde T_i,\delta_i)\) preserves this distinction. In particular, a follow-up duration of 9 months with \(\delta_i=0\) means “censored at 9 months,” not “event occurred at 9 months.”
The definition \(\delta_i=I(T_i\le C_i)\) treats a tie as an observed event. In continuous-time models, an exact tie often has probability zero, but recorded times may be rounded to days or months. A study’s event-status rule should therefore be specified when ties are possible. Use the rule that matches how event and censoring dates were adjudicated; do not resolve ties silently by changing the indicator definition.
Worked Example: Encoding an Event and a Censored Record
Consider two hypothetical subjects followed from enrollment, with time measured in months. Subject A has an event at 8.2 months and would otherwise have been administratively censored at 12 months. Subject B has no event recorded before being lost to follow-up at 9 months; the latent event time is later than 9 months.
For subject A, \(T_A=8.2\) and \(C_A=12\). Therefore, $$ \tilde T_A=\min(8.2,12)=8.2,\qquad \delta_A=I(8.2\le12)=1. $$ The data record an event at 8.2 months.
For subject B, \(C_B=9\) and \(T_B>9\). Therefore, $$ \tilde T_B=\min(T_B,9)=9,\qquad \delta_B=I(T_B\le9)=0. $$ The record is censored at 9 months. The value 9 is the observed follow-up time, not a known event time.
Building a Subject-Level Record
A convenient data organization is to keep each subject’s repeated measurements together conceptually, even if the computer file stores them in separate tables. A subject-level record can include baseline covariates \(X_i\), the eligible visit times \(t_{ij}\), their observation indicators \(R_{ij}\), the recorded \(Y_{ij}\) values when \(R_{ij}=1\), and the event summary \((\tilde T_i,\delta_i)\). The symbol \(X_i\) here denotes measured subject-level covariates; it is separate from the repeated biomarker outcomes.
For likelihood construction, it is the subject-level record that is the unit of contribution under independent sampling of subjects. If subjects are independent and share a common parameter vector \(\theta\), the full likelihood is organized as a product of subject contributions:
where \(D_i\) denotes the observed record for subject \(i\). This product does not mean that the repeated \(Y_{ij}\) values within a subject are independent. Their joint distribution is handled within \(L_i\). Nor does the indexing formula specify how censoring or missing measurements are modeled; those require additional assumptions. It simply makes clear which observed values, visit times, and event status belong to each subject’s contribution.
Worked Example: A Missed Visit Before an Event
A hypothetical study measures a biomarker at months 0, 3, 6, and 9. Subject C has an event at month 7.4. The month-0 and month-3 measurements were recorded, but the month-6 measurement was missed. The month-9 visit occurs after the event and is not an eligible visit for this subject’s pre-event biomarker record.
The eligible occasions are \(M_C=3\), at \(t_{C1}=0\), \(t_{C2}=3\), and \(t_{C3}=6\) months. The observation indicators are $$ (R_{C1},R_{C2},R_{C3})=(1,1,0). $$ If the observed biomarker values were 4.8 and 5.3 units at months 0 and 3, the available longitudinal record is \((0,4.8)\) and \((3,5.3)\). There is no recorded \(Y_{C3}\); \(R_{C3}=0\) marks that absence without assigning it a numerical value.
For the event record, \(T_C=7.4\) months and, because the event is observed before the study’s administrative end, \(C_C>7.4\). Thus \(\tilde T_C=7.4\) months and \(\delta_C=1\). The month-9 occasion is not coded as a missed pre-event measurement. It is outside the subject’s observable pre-event history.
From Records to a Joint-Model Likelihood
The joint-model likelihood uses the longitudinal and event information from the same subject. The notation \(D_i\) gives a compact way to identify those observed data before writing a model-specific likelihood. In a shared-random-effects model, the subject may also have latent random effects, often denoted \(b_i\), but these are not additional observed rows: they are subject-level latent quantities in the model introduced earlier in the canonical shared random-effects joint model.
A useful way to check the data-to-likelihood connection is to trace one subject from raw records to \(D_i\):
Assign one \(i\) to each independent study unit, and ensure every visit record and event record carries that same subject identifier.
For each subject, list the visit times \(t_{ij}\) within the observable period and record \(R_{ij}\) for each eligible occasion.
Enter \(Y_{ij}\) only when \(R_{ij}=1\); preserve the missingness marker for occasions with \(R_{ij}=0\).
Calculate \(\tilde T_i\) and \(\delta_i\) from event and censoring dates using the stated tie convention.
Keep the visit history, observed biomarker values, event summary, and relevant covariates together as the data for subject \(i\).
This organization also helps distinguish a subject-level likelihood from a visit-level dataset. A long-format file may have one row per visit, so a subject with more visits contributes more rows. That storage format does not turn those rows into independent subjects. The event summary may be stored in a separate table or repeated across visit rows for convenience, but it must still represent one event/censoring record per subject.
Worked Example: Checking a Subject-Level Data Record
A hypothetical subject D is followed from baseline. The eligible biomarker visits are at 0, 2, and 5 months. Measurements of 12.1 and 11.4 units are recorded at months 0 and 5, but the month-2 visit is missed. The subject is administratively censored at 8 months with no observed event.
There are three eligible occasions, so \(M_D=3\), with visit times \((0,2,5)\) months and indicators $$ (R_{D1},R_{D2},R_{D3})=(1,0,1). $$ The observed outcomes are \(Y_{D1}=12.1\) and \(Y_{D3}=11.4\) units; \(Y_{D2}\) is unavailable, not zero.
Because the subject is censored at \(C_D=8\) months without an event, \(T_D>8\), giving $$ \tilde T_D=8\text{ months},\qquad \delta_D=0. $$ The subject record therefore contains the three eligible visit occasions, the two recorded biomarker values, and a censored follow-up time of 8 months. It does not contain an observed event at month 8.
Why the Event Pair Is Sufficient for Event Status
The pair \((\tilde T_i,\delta_i)\) tells us which of the two competing times was observed. This can be justified directly from the definitions. If \(\delta_i=1\), then \(T_i\le C_i\), and \(\tilde T_i=\min(T_i,C_i)=T_i\): the observed time is the event time. If \(\delta_i=0\), then \(T_i>C_i\), and \(\tilde T_i=C_i\): the observed time is the censoring time, with the event known to occur later if it occurs at all.
This encoding is appropriate for right-censored data under the stated event-status convention. It does not cover interval censoring, in which an event is known only to have occurred between two observation times, or competing risks, where the type of event must also be recorded. Those settings require additional data fields and a different event-data representation.
Diagnostics, Alternatives, and Common Errors
Several checks can expose indexing problems before model fitting. Confirm that each subject has exactly one event summary; that visit times are ordered and use a common origin and unit; and that no measurement labeled as pre-event occurs after \(\tilde T_i\) when the protocol ends biomarker observation at the event. Check that \(\delta_i=1\) corresponds to a documented event date and that \(\delta_i=0\) corresponds to censoring without an event. Also verify that a missing measurement is represented by \(R_{ij}=0\), not by a fabricated value.
Two common storage approaches are long format, with one row per subject-visit, and a separate subject-level event table; and wide format, with repeated measurements in separate columns alongside event fields. Either can represent the same data. Long format is convenient for irregular visit counts and visit-level indicators. Wide format may make a small fixed schedule easy to inspect. Neither format changes the statistical unit of the event record or makes repeated measurements independent. The relevant choice is a practical data-management decision, not a substitute for specifying the joint model.
- Wrong: “The subject was censored at month 9, so the event occurred at month 9.” Correction: \(\delta_i=0\) means follow-up ended at month 9 without an observed event; the event time itself is unknown.
- Wrong: “The missing biomarker value is zero.” Correction: Use \(R_{ij}=0\) to indicate that the value was not recorded; zero is a substantive measurement only if it was actually observed.
- Wrong: “There were 40 visit rows, so the sample size is 40.” Correction: The number of subjects is \(N\); visit rows are repeated records nested within subjects.
- Wrong: “Every planned visit after enrollment is a missed visit if no value appears.” Correction: First determine whether the occasion was eligible and within the subject’s observable period. Post-event occasions are not automatically missing pre-event measurements.
These checks do not establish that censoring is independent or that biomarker measurements are missing at random. Those are modeling assumptions, not consequences of correct indexing. The data structure makes the assumptions expressible and the records auditable, but cannot guarantee that the assumptions hold.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- A subject has an event at 6 months and a planned administrative end at 10 months. Find \(\tilde T_i\) and \(\delta_i\).
- A subject is lost to follow-up at 4.5 months without an event. What does the observed time tell us, and what does it not tell us?
- At an eligible visit, no biomarker value is recorded. Which indicator records this, and what value should be assigned to \(Y_{ij}\)?
- Explain why a long-format data file with one row per visit does not make the visit rows independent subjects.
- A visit is scheduled for month 8, but the subject had an event at month 6. Should the month-8 visit automatically be coded as a missed measurement? Explain.
Solutions. (1) Since the event precedes administrative censoring, \(\tilde T_i=\min(6,10)=6\) months and \(\delta_i=I(6\le10)=1\). (2) The record has \(\tilde T_i=4.5\) months and \(\delta_i=0\): follow-up ended without an observed event, so the event time is not known, although under right censoring it exceeds 4.5 months. (3) Set \(R_{ij}=0\); \(Y_{ij}\) is unavailable and should not be replaced by zero. (4) Rows for the same subject are repeated measurements in one subject-level record. Their dependence is part of the longitudinal structure; the independent-sampling unit is the subject, not each visit row. (5) Not if the event ends biomarker observation. The month-8 occasion is after the subject’s observable pre-event history, so it is not an eligible missed visit in that history.