Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Choosing Knot Locations and Boundary Knots

Flexible Trajectories and Non-Gaussian Responses · Tutorial 477 of 697

Choosing Knot Locations and Boundary Knots

You will learn to choose spline knots that respect the observed follow-up and measurement pattern, and to diagnose weak support near the trajectory’s boundaries.

Advanced 12 min read

What You'll Learn

  • Distinguish interior knots, boundary knots, and the observed follow-up range.
  • Use measurement density and follow-up coverage to guide candidate knot locations.
  • Calculate empirical quantile knots correctly and recognize when candidates fall at boundaries.
  • Explain how unequal numbers of visits per subject can distort pooled-time quantiles.
  • Diagnose instability caused by sparse observations near the boundaries.
  • Compare quantile-based, equally spaced, and scientifically chosen knot locations.

Why Knot Placement Is a Data-Support Decision

A spline can represent a trajectory whose rate of change varies over time, but its flexibility is not equally useful everywhere. Interior knots allow the fitted curve to change polynomial pieces; boundary knots define the time interval over which the spline is constructed. Choosing these locations is therefore not just a matter of making a convenient grid. It is a decision about where the data can support changes in trajectory and where the model must rely on its boundary behavior.

In longitudinal and time-to-event studies, measurement times are often unevenly distributed. Some participants have many early visits and few late visits; others leave observation soon after enrollment. The event-time follow-up may also extend beyond the times at which biomarker measurements are available. Knot placement should reflect the intended time scale and the actual longitudinal support, rather than treating every nominal visit or every recorded row as equally informative.

Definition: An interior knot is a time point inside the spline’s boundary interval at which the polynomial pieces of a spline basis join. A boundary knot is an endpoint of the interval on which the spline basis is defined. The observed follow-up range is the range of times represented by available longitudinal measurements; it need not equal the scientifically intended time interval or the range of event-time follow-up.

The specific behavior at a boundary depends on the spline construction. For example, a restricted cubic spline is constrained to be linear beyond its boundary knots, whereas other spline bases can have different boundary behavior. In all cases, a boundary knot is a modeling choice, not evidence that the data are dense near that endpoint. Choosing a boundary at a late time with almost no biomarker measurements does not create information there.

Choosing the Boundary Interval

Begin by stating the time interval for which the trajectory is meant to be interpreted. This may be the protocol’s intended follow-up interval, a clinically meaningful interval, or a narrower interval with adequate longitudinal measurements. Then compare that target with the observed measurement times, including how many distinct participants contribute information at early and late times.

The minimum and maximum observed measurement times are useful summaries, but they are not automatic boundary knots. A single unusually early or late observation can extend the observed range without providing reliable support for the shape of the trajectory at that endpoint. Conversely, setting a boundary inside the observed range can be reasonable when the target is a restricted interval, but the resulting model should not be presented as describing the excluded times.

For joint models, distinguish longitudinal measurement coverage from event follow-up. A participant may remain under event surveillance after their last biomarker measurement. That later event follow-up does not itself supply longitudinal observations to estimate the biomarker trajectory. If the intended trajectory is needed through a later period, assess whether measurements from enough participants cover that period before placing the boundary there.

Worked Example: A Boundary Beyond the Biomarker Support

Suppose a hypothetical study plans to follow participants for 24 months. Biomarker measurements are available for 80 participants. There are many measurements from months 0 through 12, 18 participants contribute measurements between months 12 and 18, and only 3 participants have a measurement after month 18. Event follow-up extends to month 24.

A boundary at month 24 would align the spline interval with planned event follow-up, but it would not be supported by comparable biomarker coverage. The fact that event status is recorded through month 24 does not add biomarker measurements after month 18. If the scientific target is the biomarker trajectory only through month 18, month 18 is a plausible upper boundary, subject to checking the exact measurement distribution near that point. If the trajectory is required through month 24, the analyst should report that the late longitudinal support is sparse and avoid treating the fitted shape there as well determined.

The lower boundary needs the same scrutiny. If the nominal time origin is enrollment at month 0 but the first biomarker measurement occurs at month 3 for nearly everyone, a boundary at month 0 may still be scientifically appropriate, but the data do not directly show the curve’s shape between 0 and 3. The boundary choice should be reported alongside this lack of early measurement support; it should not be mistaken for evidence about the unobserved part of the trajectory.

This example supports no single boundary by arithmetic alone. It shows why boundary selection has two parts: define the time domain needed for interpretation, then state where measurements actually support that domain.

Using Measurement Density to Place Interior Knots

Interior knots should fall within the boundary interval and in regions where the data can estimate changes in trajectory. Equally spaced knots are simple and may be sensible when observations are reasonably spread across time. When measurement times are concentrated in some periods and sparse in others, empirical quantiles of measurement time can place knots nearer to the dense regions and farther apart in sparse regions.

Quantile knots are candidates, not an automatic rule. If a candidate quantile equals a boundary, it is not an interior knot. Repeated candidate times also do not provide distinct locations. Further, a quantile of pooled measurement records weights participants with many visits more heavily than participants with few visits. That may be appropriate if the target is the distribution of observed records, but it can be misleading if the goal is to represent the follow-up pattern across participants.

Practical principle: Choose boundary knots to match the intended time domain, and choose interior knots only where there is enough longitudinal support to estimate the added flexibility. Check both the distribution of measurement records and how many distinct participants contribute observations across time.

Worked Example: Checking Quantile-Knot Candidates

Consider a hypothetical set of 40 biomarker records at integer months 0 through 12. Their counts are: 10 at month 0; 2 at each of months 1, 2, 3, and 4; 1 at month 5; 6 at month 6; 1 at each of months 7, 8, 9, 10, and 11; and 10 at month 12. These counts sum to \(10+8+1+6+5+10=40\). Use the nearest-rank convention, under which the empirical quantile at probability \(q\) is the ordered observation with rank \(\lceil 40q\rceil\).

The cumulative ranks are 1–10 at month 0; 11–12 at month 1; 13–14 at month 2; 15–16 at month 3; 17–18 at month 4; 19 at month 5; 20–25 at month 6; 26 at month 7; 27 at month 8; 28 at month 9; 29 at month 10; 30 at month 11; and 31–40 at month 12.

The first quartile is the observation at rank \(\lceil40(0.25)\rceil=10\), which is at month 0. The median is at rank \(\lceil40(0.50)\rceil=20\), which is at month 6. The third quartile is at rank \(\lceil40(0.75)\rceil=30\), which is at month 11. Thus only the first quartile lands on a boundary. Months 6 and 11 are interior candidate locations if the boundary knots are months 0 and 12.

If three interior knots are required, these three quartiles do not provide three interior locations: month 0 cannot be counted as an interior knot. The analyst should not move it slightly above zero just to retain it. Instead, inspect the visit pattern and consider another prespecified interior location, or use a different candidate scheme, while checking whether the data support the resulting knot. The calculation identifies locations; it does not establish that a particular number of knots is appropriate.

Why Quantile Spacing Responds to Density

The rationale for quantile spacing follows from the empirical distribution of measurement times. Let \(F(t)\) denote the distribution function of times represented by the records. If candidate knots divide this distribution into roughly equal probability increments, adjacent knots satisfy approximately \(F(\kappa_{j+1})-F(\kappa_j)=1/(K+1)\), where \(K\) is the number of interior knots and \(\kappa_j\) denotes a knot. In a region with high time density, a small change in time produces a relatively large change in \(F\); in a sparse region, the same probability increment requires a larger time interval.

$$ F(\kappa_{j+1})-F(\kappa_j) \approx f(\kappa_j)(\kappa_{j+1}-\kappa_j) \approx \frac{1}{K+1} \quad\Longrightarrow\quad \kappa_{j+1}-\kappa_j \approx \frac{1}{(K+1)f(\kappa_j)}. $$

This approximation uses a local density \(f(t)\) that is positive and does not change sharply over the interval between adjacent knots. It explains why quantile knots tend to be closer together in dense regions and farther apart in sparse regions. It does not prove that a quantile-based spline will fit well: repeated records within participants, measurement error, and thin coverage at the edges can all make the empirical record-time distribution an incomplete guide to trajectory support.

Worked Example: Pooled Records Versus Participant Coverage

Suppose a hypothetical study has 10 participants. Five participants each contribute 8 measurements between months 0 and 6, while the other five each contribute 2 measurements between months 6 and 12. There are 40 early records and 10 later records, for 50 in total. A pooled-record median is the 25th ordered time; because the early group contributes 40 records, that median lies in the early period.

Now consider the participant-level follow-up pattern. Five of 10 participants contribute measurements into the later period, so half the participants provide some late coverage even though only 10 of 50 records are later. The pooled-record median emphasizes the early period partly because those participants have more visits, not solely because fewer participants are followed late.

There is no universal correction that turns these summaries into a single ideal knot. If the goal is to place knots according to where individual measurements are concentrated, pooled quantiles may be relevant. If the goal is to ensure representation across participants, inspect participant counts by time interval as well, and consider a participant-weighted summary or prespecified clinical times. In either case, do not infer strong late-time support from five participants alone: the number of contributing participants and the observations’ spread within that period still matter.

Diagnostics, Alternatives, and Failure Modes

Before fitting, tabulate or plot observation times and the number of distinct participants contributing measurements across the proposed boundary interval. Mark candidate knots on that display. After fitting, inspect the estimated trajectory and its uncertainty near both boundaries, and compare it with fits using a modest alternative knot placement. A large change in boundary curvature or in the estimated trajectory when a knot moves slightly is a warning that the data may not identify the local shape reliably.

The main placement strategies have different trade-offs:

StrategyUseful whenImportant caution
Equally spaced knotsObservation support is fairly even, or a transparent fixed grid is desiredCan place knots in sparse periods and miss dense periods
Empirical quantile knotsMeasurement density varies and enough distinct candidate times are availablePooled records over-weight participants with more visits; quantiles can coincide with boundaries
Scientifically chosen timesThere are meaningful phases, such as a known treatment transition or planned visit periodScientific relevance does not guarantee enough observations to estimate a change there

A key failure mode is treating the observed minimum and maximum as well-supported boundaries. A lone extreme observation can make a range look broad while leaving the curve near that endpoint highly uncertain. Another is placing many interior knots in a narrow region because records are dense there: added flexibility may then represent small-scale noise rather than a stable trajectory feature. Sparse coverage at a boundary is especially consequential because there may be little information to distinguish the spline’s imposed boundary behavior from the underlying trajectory.

Knot placement does not repair biased or incomplete follow-up. If measurement availability is related to health or event status, a dense-looking set of records may still be selectively observed. Knot choice alone cannot establish that observed trajectories represent unobserved ones. Likewise, changing knot locations is not a substitute for reporting the time range with adequate data or for checking whether conclusions depend on reasonable modeling choices.

Common mistake: “The 75th percentile is near the end of follow-up, so it is a suitable late interior knot even if few participants were measured there.” A quantile gives a location in the chosen set of records; it does not certify adequate support. Check its rank calculation, whether it is strictly inside the boundary interval, how many distinct participants contribute nearby, and whether the fitted trajectory is sensitive to that choice.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A study’s event follow-up reaches month 30, but biomarker measurements from only two participants extend beyond month 22. What should be checked before using month 30 as the upper boundary knot?
  2. With \(n=60\) pooled records and the nearest-rank convention, what rank defines the median? If that record is at a boundary, may it be used as an interior knot?
  3. Why might pooled measurement-time quantiles place knots differently from a strategy that gives each participant equal weight?
  4. When are equally spaced knots a reasonable alternative to empirical quantile knots, and what diagnostic should still be performed?

Solutions. (1) Check whether the intended trajectory must be interpreted through month 30, how many distinct participants have measurements near the endpoint, and whether the sparse late support can justify the boundary behavior. Event follow-up alone does not provide biomarker information. (2) The median rank is \(\lceil60(0.50)\rceil=30\). If rank 30 is at a boundary, it is not an interior knot; choose a distinct, supported interior candidate instead. (3) Participants with more measurements contribute more records to pooled quantiles, so they influence those quantiles more heavily. Equal participant weighting changes that influence but does not by itself guarantee adequate coverage. (4) Equal spacing can be reasonable when support is fairly even or a transparent fixed grid is wanted. Still plot candidate knots against observation times and participant counts, then assess uncertainty and sensitivity near the boundaries.

Clinical Biostats