Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Piecewise Polynomial Mean Trajectories

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

Piecewise Polynomial Mean Trajectories

You will learn to specify piecewise polynomial biomarker means, interpret their knot-defined regions, and recognize the assumptions and limitations of this flexible trajectory choice.

Advanced 12 min read

What You'll Learn

  • Define a piecewise polynomial mean using knot-defined time regions.
  • Interpret regional polynomial coefficients and their time units.
  • Calculate predicted biomarker means on either side of a knot.
  • Distinguish continuity of the mean from continuity of its slope.
  • Diagnose sparse regions, boundary artifacts, and poor polynomial fit.
  • Compare piecewise polynomials with a single global polynomial.

Why Divide Follow-Up Into Time Regions?

A biomarker may rise quickly early in follow-up, level off, and then change at a different rate later. A single low-degree polynomial imposes one overall pattern, while a high-degree polynomial can behave erratically, especially near the ends of follow-up. A piecewise polynomial mean offers another option: it uses a polynomial within each time region and lets the polynomial behavior differ across regions.

In a joint model, the longitudinal submodel describes the biomarker trajectory over time. That trajectory may also enter the event submodel through a current value, slope, or other feature. Piecewise specification therefore affects not only the fitted biomarker curve but also the time-varying quantity that may be related to event risk. The focus here is how to define and interpret the piecewise mean itself.

Definition: Let follow-up run from time \(a\) to time \(b\), and choose ordered knots \(a<\kappa_1<\cdots<\kappa_K<b\). These knots divide follow-up into \(K+1\) regions, with boundary points assigned to one region by a stated convention. A piecewise polynomial mean is a function that equals a polynomial in time within each region. The polynomial degree, coefficients, and possibly covariate effects may differ between regions.

For example, with one knot \(\kappa\), a two-region mean can be written directly as

$$ m_i(t)= \begin{cases} \beta_{10}+\beta_{11}t+\cdots+\beta_{1p_1}t^{p_1}, & a\leq t<\kappa,\\ \beta_{20}+\beta_{21}t+\cdots+\beta_{2p_2}t^{p_2}, & \kappa\leq t\leq b. \end{cases} $$

Here \(m_i(t)\) denotes the modeled mean biomarker value at time \(t\) for subject \(i\), conditional on any covariates or random effects included in the longitudinal model. The displayed form suppresses those terms to make the time-region structure clear. A piecewise mean can have a different polynomial degree in each region; in practice, each degree should be chosen with the amount and pattern of data in mind.

Specification and Interpretation

The knot locations define where one regional formula stops and the next begins. They do not, by themselves, dictate that the mean or its slope must be continuous at a knot. If the formula on the left and the formula on the right give different values at the knot, the specified mean has a jump. If the values match but the derivatives differ, the mean is continuous but its slope changes abruptly. Those are distinct modeling choices.

Coefficients must be interpreted with their time scale in view. In a linear regional polynomial written in \(t\), the coefficient of \(t\) is the slope in biomarker units per unit time within that region. In a quadratic region, the derivative depends on time, so there is no single constant slope throughout that region. If a polynomial is instead written using time measured from the region's start, its intercept is the fitted mean at that region's start, provided the formula applies at that boundary.

Key distinction: A knot partitions the time axis; it is not automatically a biological change point, and it does not automatically impose continuity. Continuity at \(\kappa_r\) requires the polynomial values from the neighboring regions to agree there. Matching derivatives is an additional condition, not a consequence of matching values.

Worked Example: Evaluating a Continuous Two-Region Mean

Suppose a hypothetical biomarker is measured in units and time is in years. A one-knot mean has a knot at year 3:

$$ m_i(t)= \begin{cases} 5+0.6t, & 0\leq t<3,\\ 6.8+0.2(t-3)+0.1(t-3)^2, & 3\leq t\leq 6. \end{cases} $$

At the knot, the first formula approaches \(5+0.6(3)=6.8\) units, and the second formula gives \(6.8+0.2(0)+0.1(0^2)=6.8\) units. Thus the mean is continuous at year 3. The left-region slope is \(0.6\) units per year. In the second region, differentiating with respect to time gives \(0.2+0.2(t-3)\) units per year; at year 3 this is also \(0.2\), not \(0.6\). So the mean is continuous, but its slope changes at the knot.

At year 5, \(t-3=2\), so \(m_i(5)=6.8+0.2(2)+0.1(2^2)=6.8+0.4+0.4=7.6\) units. The quadratic term matters: dropping it would give an incorrect prediction.

This specification is a model for the conditional mean, not a claim that every subject's observed biomarker follows this curve exactly. In a longitudinal model, observations may vary around the modeled mean because of subject-specific effects and measurement error.

Assumptions and a Short Continuity Check

Piecewise polynomials are a form for the mean, not a complete probability model for the observations. For illustration, a Gaussian longitudinal submodel might write \(Y_{ij}=m_i(t_{ij})+\epsilon_{ij}\), where \(Y_{ij}\) is subject \(i\)'s observed biomarker at visit \(j\), and the residuals are assumed to have mean zero conditional on the modeled effects. A particular joint model must also specify its random-effects structure, residual dependence, and event submodel. Normal residuals are not required simply because the mean is piecewise polynomial.

The key mean-shape assumption is that, within each chosen region, the selected polynomial adequately describes the conditional mean over the observed time range. The knots must lie in the intended follow-up range, and there must be enough observations across subjects and time to estimate the regional coefficients. If regional covariate effects or random effects are included, their interpretation and estimation also depend on how those terms are specified.

Continuity can be checked directly by evaluating adjacent formulas at the shared boundary. For a knot \(\kappa\), write the left and right polynomials as \(P_L(t)\) and \(P_R(t)\). The mean is continuous at \(\kappa\) exactly when \(P_L(\kappa)=P_R(\kappa)\). This follows because the left-hand limiting mean is \(P_L(\kappa)\) and the value from the right region at the boundary is \(P_R(\kappa)\). Equality of these values removes a jump; it says nothing by itself about equality of slopes.

Worked Example: Detecting a Jump at a Knot

Suppose a hypothetical biomarker mean, in units, is specified over years 0 to 8 with a knot at year 4:

$$ m_i(t)= \begin{cases} 2+0.5t, & 0\leq t<4,\\ 5+0.1(t-4), & 4\leq t\leq 8. \end{cases} $$

Immediately before year 4, the left formula has limiting value \(2+0.5(4)=4\) units. At year 4, the right formula gives \(5+0.1(0)=5\) units. The difference is \(5-4=1\) unit, so this model has a one-unit jump at the knot. At year 6, \(m_i(6)=5+0.1(6-4)=5.2\) units.

The calculation is not a test of whether a real biomarker can change instantaneously. It reveals what the stated model means mathematically. If an abrupt change is not scientifically plausible, the specification may be unsuitable or may need a continuity condition. If the data represent a genuine abrupt intervention effect, a jump might instead be intentional. The modeling decision must be justified by the scientific setting.

Worked Example: Interpreting Three Time Regions

Consider the following hypothetical mean trajectory, with biomarker units as the response scale and time in years:

$$ m_i(t)= \begin{cases} 4+0.8t, & 0\leq t<2,\\ 5.6+0.3(t-2)-0.1(t-2)^2, & 2\leq t<5,\\ 5.3-0.2(t-5), & 5\leq t\leq 8. \end{cases} $$

The knots at years 2 and 5 divide follow-up into three regions. At year 1, the first formula gives \(4+0.8(1)=4.8\) units. At year 4, the second formula gives \(5.6+0.3(2)-0.1(2^2)=5.6+0.6-0.4=5.8\) units. At year 7, the third formula gives \(5.3-0.2(2)=4.9\) units.

The first region has a constant slope of \(0.8\) units per year. In the middle region, the derivative is \(0.3-0.2(t-2)\) units per year; it equals \(-0.1\) at year 4. In the last region, the slope is \(-0.2\) units per year. This illustrates why coefficients from different regions should not be described as if they all represented one common slope.

The formulas also need boundary checks if continuity is intended. At year 2, the first region approaches \(4+0.8(2)=5.6\), which agrees with the middle-region value \(5.6\). At year 5, the middle-region limit is \(5.6+0.3(3)-0.1(3^2)=5.6+0.9-0.9=5.6\), whereas the last-region value is \(5.3\). Thus the specified mean drops by \(0.3\) units at year 5.

Fitting, Diagnostics, and Alternatives

After specifying the regions and polynomial terms, the model can be estimated as part of the longitudinal component of the joint likelihood. For example, fixed-effect coefficients can be associated with region-specific polynomial terms, while the subject-level structure accounts for repeated measurements. The details depend on the chosen joint model. The piecewise form does not remove the need to examine whether the fitted mean is supported by the observation schedule and whether the rest of the longitudinal model is adequate.

Useful checks include plotting observed measurements and fitted trajectories against time, with the knots marked; inspecting residual patterns within each region; and checking how many observations fall in each region across subjects. A smooth-looking population curve can conceal poor fit for particular subjects or systematic residual trends. Also inspect predictions and slopes near each knot and at the ends of follow-up. Large jumps, implausible reversals, or extreme boundary predictions may indicate a mismatch between the chosen formula and the scientific process.

A single global polynomial is a simpler alternative: it uses one polynomial over the whole follow-up range. It may be adequate when the mean behavior is broadly uniform, but it cannot change its polynomial specification at selected times. Piecewise polynomials permit regional behavior to differ, at the cost of additional coefficients and potentially abrupt boundaries. A lower-degree model with fewer regions may be more stable than a highly flexible specification when data are sparse. The introductory material on longitudinal modeling supplies the broader repeated-measures setting; the main choice here is the form of the time-dependent mean.

Knot placement and polynomial degree should be treated as modeling choices, not as automatic discoveries of biological phases. Too many regions, or high-degree polynomials in regions with little data, can produce unstable estimates. A knot near the edge of observed follow-up can be especially difficult to assess because few observations may inform one side. Compare plausible specifications and assess whether substantive conclusions depend heavily on these choices. The piecewise-polynomial representation also does not by itself specify how a trajectory feature enters the event hazard.

Common Mistakes and Practical Limits

  • Assuming a knot guarantees continuity. It only marks a boundary. Evaluate both regional formulas at the knot to determine whether they match.
  • Calling every coefficient a slope. In a quadratic region, the slope varies with time; use the derivative to describe the instantaneous rate of change.
  • Ignoring the time units. A linear coefficient is measured in biomarker units per time unit, and a quadratic coefficient has units of biomarker units per squared time unit.
  • Over-interpreting a knot. A chosen knot specifies where the mathematical formula changes. It is not, without additional evidence, proof of a biological transition.
  • Trusting a flexible curve without checking support. Sparse regions and boundary areas can lead to unstable estimates and unrealistic fitted behavior.

Piecewise means are useful when regional behavior is scientifically plausible and adequately supported by data. Their limitations are equally important: the regional polynomials may still fit poorly, coefficients can be hard to interpret when the time origin is distant from a region, and an unconstrained specification can produce jumps. These are model properties to evaluate, not details to leave implicit.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A two-region mean has a knot at year 3. The left formula is \(1+2t\), and the right formula is \(7+0.5(t-3)\). Is the mean continuous at the knot?
  2. For the second-region formula \(6+0.4(t-2)-0.05(t-2)^2\), what is the predicted mean at year 4, and what is the slope there?
  3. What does a knot establish, and what additional check is needed to establish continuity?
  4. Name one diagnostic that could reveal inadequate support for a regional polynomial.

Solutions. 1. The left limit is \(1+2(3)=7\), and the right value is \(7+0.5(0)=7\), so it is continuous. 2. At year 4, \(t-2=2\), giving \(6+0.4(2)-0.05(2^2)=6+0.8-0.2=6.6\) units. The derivative is \(0.4-0.1(t-2)\), which equals \(0.2\) units per year at year 4. 3. A knot establishes a boundary between time regions; continuity requires evaluating the neighboring polynomials at that boundary and confirming equal values. 4. For example, count or plot observations by region across subjects; very few observations in a region can signal that its coefficients are weakly supported.

Clinical Biostats