Tutorials › Population Pharmacokinetics › Worked Example: Selecting a Continuous Covariate Function

Covariate Selection Strategies and Their Statistics · Tutorial 309 of 599

Worked Example: Selecting a Continuous Covariate Function

Learn how to specify and compare continuous covariate functions for clearance, and how likelihood tests and profile likelihood inform model fit and uncertainty.

Advanced 12 min read

What You'll Learn

  • Write linear, power, and restricted cubic spline functions for a continuous clearance covariate.
  • Identify when a likelihood-ratio test is valid and calculate it for nested models.
  • Compare nonnested functional forms without misusing a likelihood-ratio test.
  • Construct and interpret a profile-likelihood interval for a covariate parameter.
  • Recognize diagnostics and limitations of functional-form comparisons.

Why the Covariate Function Matters

A continuous covariate such as renal function can be associated with clearance in several plausible ways. A straight-line change in log clearance, a power relationship, and a smooth curve may all describe the observed data reasonably well over part of the covariate range. Choosing among them matters: a function that is too rigid can miss systematic patterns, while an unnecessarily flexible one can follow noise and produce unstable estimates. The aim here is to compare candidate functions while keeping the pharmacokinetic model and likelihood on a common basis.

Let \(x_i\) be a positive continuous covariate for subject \(i\), such as renal function in mL/min. A useful shared structure is to model the typical clearance at a reference covariate value, then allow the function of \(x_i\) to modify that typical value. For illustration, suppose individual clearance is

$$ CL_i=\theta_{CL}\exp\{f(x_i)+\eta_{CL,i}\},\qquad \eta_{CL,i}\sim N(0,\omega_{CL}^2). $$

Here \(\theta_{CL}\) is typical clearance at the reference value, \(f(x_i)\) is the covariate function scaled so that \(f(x_{\mathrm{ref}})=0\), and \(\eta_{CL,i}\) represents between-subject variability on the log scale. The concentration data likelihood also depends on the structural and residual-error models. In a functional-form comparison, those parts of the model, the analyzed subjects, and the likelihood calculation should be held fixed unless there is a specific reason to change them.

Definition: A continuous covariate function is the specified function \(f(x)\) that maps a subject’s continuous covariate value to its modeled effect on a PK parameter. In this tutorial, \(f(x_{\mathrm{ref}})=0\), so \(\theta_{CL}\) is typical clearance at \(x_{\mathrm{ref}}\). A model comparison asks whether the likelihood supports one function over another, accounting for the number of estimated parameters when required.

Three Candidate Functions

For a linear function on log clearance, define \(z_i=(x_i-x_{\mathrm{ref}})/s_x\), where \(s_x\) is a fixed positive scaling constant with the same units as \(x\). Then

$$ f_{\mathrm{lin}}(x_i)=\beta z_i,\qquad \widetilde{CL}_{\mathrm{lin}}(x_i)=\theta_{CL}\exp(\beta z_i). $$

The scaling makes the coefficient correspond to a change over \(s_x\) units of the covariate. For example, with \(s_x=30\) mL/min, \(z=1\) means an increase of 30 mL/min from the reference value. This is linear in log clearance, not in clearance itself.

A power function is

$$ \widetilde{CL}_{\mathrm{pow}}(x_i) =\theta_{CL}\left(\frac{x_i}{x_{\mathrm{ref}}}\right)^\gamma, \qquad x_i>0,\quad x_{\mathrm{ref}}>0. $$

The positivity conditions ensure the ratio is positive, so the expression is real-valued for any real \(\gamma\). Taking logs shows that this is linear in \(\log(x_i/x_{\mathrm{ref}})\), not in \(x_i\). The exponent \(\gamma\) is estimated from the data.

A spline represents a smooth, potentially nonlinear function using basis functions. One common choice is a restricted cubic spline: it is cubic between knots and constrained to be linear beyond the boundary knots. Write a centered spline function with one linear term and two nonlinear basis terms as

$$ f_{\mathrm{spline}}(x_i)=\beta_1 z_i+\beta_2 B_2(z_i)+\beta_3 B_3(z_i). $$

The basis functions \(B_2\) and \(B_3\) are constructed from prespecified knots and centered so that the function is zero at the reference value. This particular specification has two additional nonlinear coefficients relative to the linear model. Other knot choices and spline bases are possible; the basis and knot locations must be stated because they determine the fitted function and its flexibility.

Worked Example: Translating Covariate Values Into Predictions

Suppose \(x_{\mathrm{ref}}=90\) mL/min, \(s_x=30\) mL/min, and \(\theta_{CL}=5.00\) L/h. For illustration, consider fitted linear and power coefficients \(\beta=0.240\) and \(\gamma=0.550\). These are hypothetical estimates, not results from a real study. Calculate the typical clearances predicted at 60 and 120 mL/min.

At 60 mL/min, \(z=(60-90)/30=-1\). The linear prediction is

$$ 5.00\exp\{0.240(-1)\} =5.00\exp(-0.240) =3.933\ \mathrm{L/h}. $$

The power prediction is

$$ 5.00\left(\frac{60}{90}\right)^{0.550} =5.00(0.6667)^{0.550} \approx 4.001\ \mathrm{L/h}. $$

At 120 mL/min, \(z=1\). The linear prediction is \(5.00\exp(0.240)=6.356\) L/h, and the power prediction is \(5.00(120/90)^{0.550}\approx5.857\) L/h. The different values illustrate that the functions impose different shapes away from the reference value. They do not, by themselves, show which function fits the concentration data better.

Likelihood Comparison and Its Conditions

Let \(\ell\) denote the maximized log likelihood for a candidate model, with all its parameters estimated from the same data. For nested models, the likelihood-ratio statistic is

$$ D=2(\ell_{\mathrm{larger}}-\ell_{\mathrm{smaller}}) =(-2\ell_{\mathrm{smaller}})-(-2\ell_{\mathrm{larger}}). $$

Under the null hypothesis that the additional parameters in the larger model are zero, and under regularity conditions, \(D\) has approximately a chi-square distribution with degrees of freedom equal to the number of additional freely estimated parameters. The null model must be obtainable by imposing parameter restrictions on the larger model. The models should use the same observations and compatible likelihoods, and the null parameter values should not lie on a problematic boundary. For population PK models, the approximation can also be unreliable with weak identification, small samples, or difficult estimation.

A spline containing the linear function when its nonlinear coefficients are zero is nested within that spline. Thus, testing the linear model against the three-coefficient spline above tests \(H_0:\beta_2=\beta_3=0\), using \(df=2\), provided the model is regular and the spline basis and knots are fixed for the comparison. A linear function of \(x\) and a power function of \(x\) are generally not nested in one another: neither is generally obtained from the other by fixing a subset of its parameters. An ordinary likelihood-ratio test between them is therefore not justified. Their likelihoods can still be compared descriptively, or through criteria such as AIC, or with predictive assessment methods.

Worked Example: Testing Whether a Spline Improves on a Linear Function

Suppose a hypothetical population PK analysis gives \(-2\ell=812.4\) for the linear model and \(-2\ell=806.8\) for the spline model. The spline adds two nonlinear coefficients, while all other model components and the analyzed data are unchanged. Test the linear model against the spline using a likelihood-ratio test at \(\alpha=0.05\).

The linear model is nested in this spline by setting both nonlinear coefficients to zero. Therefore the statistic is

$$ D=812.4-806.8=5.6. $$

Under \(H_0:\beta_2=\beta_3=0\), the reference distribution is approximately chi-square with \(df=2\). For two degrees of freedom, the upper-tail p-value is \(\exp(-D/2)\), giving \(\exp(-2.8)=0.0608\). Since \(0.0608>0.05\), this comparison does not reject the linear model at the stated significance level. It does not establish that the linear function is true or that the two functions are equivalent; it says that this test did not find sufficient evidence of improved likelihood from those two spline terms at \(\alpha=0.05\).

The conclusion depends on the stated assumptions: the spline really contains the linear model, the two added terms are identifiable, the likelihoods are comparable, and the chi-square approximation is adequate. If knot locations were selected after searching many alternatives, the nominal p-value would not account for that search.

Comparing Candidate Shapes and Checking Uncertainty

For nonnested candidates, likelihood values alone reward flexibility: a more flexible model cannot have a lower maximized likelihood when it includes the other model, but independently specified nonnested functions need not have that ordering. AIC makes an explicit complexity adjustment, \(AIC=-2\ell+2k\), where \(k\) is the number of estimated parameters under the chosen likelihood convention. AIC is a relative comparison, not a significance test; lower AIC indicates the preferred trade-off among the specified candidates, not proof that a model is correct. Predictive checks or cross-validation can address prediction-oriented questions, but they answer a different question from a nested likelihood-ratio test.

Worked Example: Comparing Linear, Power, and Spline Fits

Continue with hypothetical fits to the same data and common PK model. Suppose the linear model has \(-2\ell=812.4\) and \(k=8\), the power model has \(-2\ell=811.0\) and \(k=8\), and the spline has \(-2\ell=806.8\) and \(k=10\). The counts include the same nuisance parameters in each model; the spline has two additional coefficients.

The AIC values are

$$ \begin{aligned} AIC_{\mathrm{lin}}&=812.4+2(8)=828.4,\\ AIC_{\mathrm{pow}}&=811.0+2(8)=827.0,\\ AIC_{\mathrm{spline}}&=806.8+2(10)=826.8. \end{aligned} $$

The spline has the lowest AIC, but its advantage over the power model is only \(827.0-826.8=0.2\), a very small difference. The linear model has an AIC 1.6 units higher than the spline. These results do not support a strong claim that the spline is decisively better. The linear-versus-spline nested test from the prior example also did not reject at 0.05. Those statements are compatible: an AIC ranking and a hypothesis test use different criteria and should not be treated as interchangeable.

A fair comparison also requires checking that every candidate converged successfully and used the same observations, structural model, random-effects structure, and residual-error specification. If one fit omits subjects or changes the likelihood approximation, the numerical comparison can reflect those changes rather than the covariate function.

Uncertainty in a coefficient is not always well summarized by a symmetric standard-error interval. Profile likelihood examines how well the model can fit when a parameter is fixed at successive values and all other parameters are re-estimated. For a scalar parameter \(\gamma\), let \(\ell_{\mathrm{profile}}(\gamma)\) be the maximized log likelihood subject to that fixed value, and let \(\hat{\gamma}\) be its unrestricted maximum-likelihood estimate. The profile deviance is

$$ D_{\mathrm{profile}}(\gamma) =2\{\ell(\hat{\gamma})-\ell_{\mathrm{profile}}(\gamma)\}. $$

For a regular scalar parameter, an approximate 95% likelihood-ratio confidence set contains values satisfying \(D_{\mathrm{profile}}(\gamma)\leq 3.841\), the 95th percentile of a chi-square distribution with one degree of freedom. This approximation relies on the same large-sample and regularity considerations as other likelihood-ratio inferences. A profile can reveal asymmetry, flat regions, or boundaries that a local standard error may conceal.

Worked Example: Reading a Profile-Likelihood Interval

Suppose a hypothetical power-model fit estimates \(\hat{\gamma}=0.55\), with maximized log likelihood \(-401.20\). When \(\gamma\) is fixed at 0.24 and all other parameters are re-estimated, suppose the profile log likelihood is \(-403.12\). The same value is obtained at \(\gamma=0.86\). Find the profile deviance at each endpoint and interpret the resulting approximate interval.

At either endpoint,

$$ D_{\mathrm{profile}} =2\{-401.20-(-403.12)\} =2(1.92)=3.84. $$

The profile-likelihood confidence set is the full set of values satisfying \(D_{\mathrm{profile}}(\gamma)\leq 3.841\). It is approximately the interval \(0.24\) to \(0.86\) only if these are the relevant cutoff crossings and the profile deviance remains below the cutoff between them. Under the model and regularity assumptions, this is an approximate 95% confidence set for the power exponent \(\gamma\). It is not a 95% probability statement about the fixed parameter after observing these data. The resulting set indicates substantial uncertainty in the exponent; the profile itself should be inspected for asymmetry or irregularity rather than assuming the interval is symmetric around 0.55.

Diagnostics, Limitations, and a Common Pitfall

A likelihood comparison does not replace checking whether the fitted relationship is credible. Plot the estimated typical clearance function over the observed covariate range, with uncertainty where available, and inspect covariate-stratified goodness-of-fit patterns. Examine whether residual or prediction discrepancies show a systematic trend with the covariate. Check the covariate distribution: sparse observations at the extremes provide little information about tail shape, and spline estimates near boundaries may be especially uncertain. Confirm that estimates, gradients, and objective-function values are stable across reasonable initial values and that the added terms are estimable.

Splines can reduce functional-form bias within the data range, but they do not guarantee a biologically plausible relationship. A restricted cubic spline has linear tails by construction, yet predictions beyond the observed range still rely on extrapolation and should be treated cautiously. A power function requires positive covariate values and reference value; it may be inappropriate if zero or negative values are possible. A linear-on-log-clearance model can also predict implausible changes when extrapolated far from the data. No model-selection statistic can compensate for poor covariate measurement, confounding, an unsuitable structural PK model, or inadequate individual information.

Common mistake: “The spline has the largest likelihood, so it must be the right function; I can use a likelihood-ratio p-value to compare it with the power model.” This reasoning is wrong for two reasons. First, a better maximized likelihood does not establish that the function is correct, especially when a model has extra flexibility. Second, the ordinary likelihood-ratio chi-square test requires nested models; a power model and a spline are generally nonnested. Instead, use a valid nested test for linear versus spline when its assumptions hold, and compare nonnested candidates with a clearly stated criterion such as AIC or predictive performance. Then consider diagnostics, uncertainty, and the covariate range before selecting a function.

Key takeaway: Choose the comparison to match the model relationship. Use a likelihood-ratio test for suitably regular nested functions, and use penalized or predictive criteria for nonnested alternatives. Treat uncertainty and diagnostics as essential evidence, not optional additions to a ranking.

Check Your Understanding

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

  1. A spline adds three freely estimated terms to a nested linear model. What degrees of freedom does the ordinary likelihood-ratio test use, assuming regularity conditions hold?
  2. A power model has a lower AIC than a linear model by 0.4. Does this establish that the power model is true or statistically significant?
  3. Why must both \(x_i\) and \(x_{\mathrm{ref}}\) be positive in the stated real-valued power function when \(\gamma\) can be any real number?
  4. A profile deviance is 5.0 for a candidate value of a scalar parameter. Is that value inside the approximate 95% profile-likelihood confidence set under the usual regularity conditions?
  5. What is one reason to be cautious about a spline’s estimated shape at the edge of the observed covariate range?

Solutions. (1) The test uses \(df=3\), the number of added parameters constrained to zero under the linear null. (2) No. AIC is a relative complexity-adjusted criterion, not a hypothesis test and not proof that either model is true; a difference of 0.4 is small. (3) Their ratio must be positive so that an arbitrary real power is real-valued. (4) No. The approximate 95% cutoff is 3.841, and \(5.0>3.841\), so the candidate value is outside that set. (5) There may be few observations near the boundary, leaving the shape weakly informed; uncertainty can be high, and extrapolation beyond the observed range is not supported by the fit alone.

Clinical Biostats