From Visit Records to a Landmark Prediction
A longitudinal file may contain several biomarker measurements for each person, while a fixed-horizon prediction model needs one predictor record per person at the time a prediction is made. Landmarking provides that time point: restrict attention to people who are alive and event-free at the landmark, summarize information observed by then, and predict whether an event occurs during a prespecified period afterward.
The key is to keep the time ordering explicit. Measurements after the landmark cannot be used to predict an outcome that begins at the landmark. Likewise, people who have already had the event by the landmark are not members of the prediction cohort. The risk being estimated is therefore a conditional risk among landmark survivors, not a risk from the start of follow-up.
For a simple fixed-horizon model, let \(X\) be a summary of a biomarker observed by \(L\). A logistic regression specifies the conditional event probability as
This model assumes independent individuals, correct ascertainment of the event status through the horizon, and an appropriate logit relationship between the predictor and event risk. If \(X\) is categorical, the model estimates a log odds for each category relative to a reference category. Predictions apply to the landmark survivor population represented by the data and model; they do not automatically describe people who did not survive event-free to \(L\).
Worked Dataset and Landmark Records
Consider a hypothetical study with a landmark at month 6 and a prediction horizon of 6 months, ending at month 12. All 12 individuals in the table are alive and event-free at month 6. Each has biomarker measurements at months 2, 4, and 6. The prespecified predictor is the last observed biomarker value at or before month 6, in mg/L. For this example, define the high category as a last value of at least 10 mg/L; lower values are classified as low. The outcome records whether an event occurs during the next 6 months.
| Person | Biomarker at months 2, 4, 6 (mg/L) | Last value at landmark (mg/L) | Category | Event by month 12? |
|---|---|---|---|---|
| A | 6.8, 7.1, 7.4 | 7.4 | Low | Yes |
| B | 7.0, 7.6, 8.2 | 8.2 | Low | No |
| C | 6.5, 8.3, 8.8 | 8.8 | Low | Yes |
| D | 7.1, 7.5, 8.5 | 8.5 | Low | No |
| E | 8.0, 8.6, 9.0 | 9.0 | Low | No |
| F | 7.6, 8.8, 9.6 | 9.6 | Low | No |
| G | 8.0, 9.5, 10.2 | 10.2 | High | Yes |
| H | 8.5, 10.4, 11.0 | 11.0 | High | Yes |
| I | 9.0, 10.0, 11.8 | 11.8 | High | No |
| J | 9.5, 11.5, 12.4 | 12.4 | High | Yes |
| K | 8.8, 10.2, 13.1 | 13.1 | High | Yes |
| L | 9.4, 11.2, 14.0 | 14.0 | High | No |
Worked Example: Creating the Landmark Cohort
To construct a record for person C, first check eligibility at month 6. Person C is alive and event-free at that time, so C belongs in the landmark cohort. The observed measurements by month 6 are 6.5, 8.3, and 8.8 mg/L. The last observed value is 8.8 mg/L, which is below the prespecified 10 mg/L cut point, so C's predictor category is low. C has an event within the following 6 months, so \(Y=1\).
C's resulting landmark record is therefore one row with person identifier C, category low, and outcome 1. The measurements are not three independent rows for the prediction analysis: they are the repeated observations used to calculate this person's landmark predictor. Applying the same rule to all 12 people produces 12 records.
The table also makes the time ordering checkable: every predictor is measured no later than month 6, and each outcome refers only to the interval after month 6 through month 12.
Fitting the Fixed-Horizon Model
Let \(X=0\) indicate a low last-observed biomarker and \(X=1\) indicate a high value. Fit the logistic model
In this small example, the model has a separate fitted risk for each of the two categories. There are 2 events among 6 people in the low category and 4 among 6 in the high category. These proportions determine the maximum-likelihood fitted probabilities. The resulting coefficients and risks can be derived directly.
Worked Example: Estimating the Category Risks
For the low category, the observed event proportion is \(2/6=1/3\). Its fitted log odds are
For the high category, the observed event proportion is \(4/6=2/3\), so its fitted log odds are
Subtracting the low-category log odds gives
Thus the fitted event risks are \(1/3\), or about 0.333, for the low category and \(2/3\), or about 0.667, for the high category. With the exact coefficients, the high-category log odds equal \(-\log 2+\log 4=\log 2\), giving risk \(e^{\log 2}/(1+e^{\log 2})=2/3\). The estimated odds in the high group are four times those in the low group, since \(\exp(\hat{\beta}_1)=4\). This odds ratio is not a risk ratio.
The calculation is a special case of logistic maximum likelihood. For a category with \(y\) events among \(n\) people, its likelihood for event probability \(p\) is proportional to \(p^y(1-p)^{n-y}\). The log likelihood is \(y\log p+(n-y)\log(1-p)\). Differentiating with respect to \(p\) and setting the derivative to zero gives
So, when the model gives each category its own fitted probability, the maximum-likelihood prediction is the observed event proportion in that category. This justifies the direct calculation above; it does not mean that a small sample provides precise estimates.
Calculating Individual Predictions
Worked Example: Predicting Risk for Two Individuals
Person C's last value is 8.8 mg/L, so \(X=0\). Substituting into the fitted model gives log odds \(\hat{\beta}_0+\hat{\beta}_1X=-\log 2\). Converting to a probability,
The estimated probability for C is about 33.3% of an event by month 12, conditional on being event-free at month 6 and having a low last-observed value under this model.
Person K's last value is 13.1 mg/L, so \(X=1\). Using the exact fitted coefficients, the linear predictor is \(-\log 2+\log 4=\log 2\). Therefore,
K's estimated risk is about 66.7% by month 12, with the same conditioning on landmark survival. This is a group-based prediction: all people classified high receive the same estimate in this model. It does not imply that K's individual outcome is known or that the biomarker caused the difference in observed risks.
Assumptions, Checks, and Alternatives
Before using this procedure, verify that the analysis matches the intended prediction task. The landmark and horizon should be specified in advance, the eligible cohort should include only people event-free at the landmark, and the predictor calculation should use only information available by then. For the binary outcome, each person must have a known event status through \(L+h\). A person censored before \(L+h\) without an event cannot simply be coded as \(Y=0\), because that person's event status for the full horizon is unknown.
For a more general logistic model, check whether the chosen predictors and functional forms are plausible, whether categories have adequate data, and whether fitted risks are sensible. The present example has just 12 people and only two predictors levels; it is for learning the arithmetic, not for establishing reliable clinical predictions. Sparse categories can produce unstable estimates, and complete separation can make ordinary logistic maximum-likelihood estimates diverge. Out-of-sample calibration and discrimination are also relevant when judging a prediction model, but a numerical prediction alone does not establish that performance is adequate.
A fixed-horizon logistic model is direct and easy to interpret when the outcome is completely observed at a common horizon. A landmark Cox model instead uses event times and censoring after the landmark to model the event hazard; its conditional survival predictions can be converted to risks at a chosen horizon. The two approaches differ in their outcome model and data requirements. If follow-up is censored before the horizon, the simple binary-outcome calculation here is not justified without additional methods that address censoring.
The predictor also represents a deliberate summary of a trajectory. A last-observed value is not the same as a latent or error-free biomarker value, and it does not use the entire trajectory's shape. Visit timing may vary, and the last value can be less recent for some people than others. Those features can affect interpretation and predictive performance. The estimated risk is conditional on reaching the landmark and on the observed predictor information, so selection into the landmark cohort matters.
Common Pitfalls
- Using post-landmark information. A measurement after month 6 cannot be used as a predictor for risk beginning at month 6. Restrict the summary to values observed by the landmark.
- Treating an early censoring as no event. No recorded event before loss to follow-up does not establish that the person remained event-free through the horizon. Do not assign \(Y=0\) unless the outcome is known through \(L+h\).
- Interpreting conditional risk as baseline-population risk. The prediction applies to people alive and event-free at \(L\), not automatically to everyone enrolled at the beginning.
- Confusing odds and risk. A coefficient of \(\log 4\) means the estimated odds are multiplied by 4 for high versus low values in this model; it does not mean the risk is four times as large.
- Reading a fitted risk as a personal certainty. A prediction of 0.667 is an estimated probability under the model, not a guarantee about the person's future event status.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- At landmark month 3, an individual is event-free and has biomarker values 4.0, 5.2, and 6.1 mg/L at months 1, 2, and 3. If the predictor is the last observed value, what value enters the landmark record?
- Among 10 landmark survivors in a category, 3 have the event by the horizon. What fitted category risk does a logistic model with a separate intercept for that category assign?
- In the worked model, what are the predicted risks for low and high categories, and what does the high-versus-low coefficient represent?
- A person is censored two months after the landmark, without a recorded event, when the prediction horizon is six months. Can this person be coded as event-free through the horizon? Why or why not?
Solutions. (1) Use 6.1 mg/L, the last measurement observed at or before month 3. The earlier measurements are not separate prediction records. (2) The fitted risk is \(3/10=0.300\), provided event status is known for all 10 people through the horizon. (3) The low and high fitted risks are \(1/3\approx0.333\) and \(2/3\approx0.667\). The coefficient \(\log 4\) represents a fourfold ratio of event odds for high versus low in this model, not a fourfold risk ratio. (4) No. The individual's event status for the remaining four months is unknown, so coding the outcome as zero would incorrectly treat incomplete follow-up as confirmed event-free survival.