Why Covariates Must Be Simulated
A population simulation needs more than a fitted typical parameter value and a method for drawing random effects. It also needs a description of which kinds of individuals make up the simulated population. Age, body weight, genotype, renal function, and other covariates can shift individual parameters systematically. If the covariates are omitted or represented poorly, the simulated parameter and outcome distributions may not reflect the intended population—even when the fitted covariate relationships are applied correctly.
The task here is to generate covariate profiles for simulated individuals and use the fitted model to calculate their individual parameters. This is distinct from drawing random effects: covariates represent measured or specified characteristics of the target population, whereas random effects represent residual between-individual variation under the NLME model. In the workflow, generate a covariate profile, apply the fitted covariate model, and then draw the individual’s random effects according to the model.
The target population must be stated before choosing a distribution. An observed cohort can be used as a practical representation of that population, but it is not automatically representative. A distribution specified from external knowledge can target a population that differs from the fitting cohort, but its assumptions and dependence structure must be defensible. In either case, the covariate generation step should use the same variable definitions, units, transformations, and category coding as the fitted covariate model.
From a Covariate Profile to an Individual Parameter
For illustration, suppose clearance has a log-linear covariate model with body weight and a binary sex indicator. Let \(W_i\) be individual \(i\)’s weight in kilograms, and let \(F_i=1\) for the category coded as female and \(F_i=0\) for the reference category. Let \(\eta_{CL,i}\) be the individual clearance random effect. A possible model is
Here, \(CL_{\mathrm{pop}}\) is the typical clearance for the reference sex at 70 kg, \(\beta_F\) is the fitted sex effect on the log scale, and the exponent 0.75 is a fitted or prespecified allometric exponent. The units of \(CL_i\) are the units of \(CL_{\mathrm{pop}}\), for example liters per hour. A simulated profile supplies \(W_i\) and \(F_i\); the fitted model supplies the covariate relationship. The random effect is drawn separately, unless a specific simulation task supplies its value.
The model form matters. A coefficient on the log scale is not an additive change in clearance: for a binary covariate, the multiplicative change is \(\exp(\beta_F)\). For a continuous covariate, the formula may use a centered value, a ratio to a reference value, a power model, or another fitted transformation. Substituting raw values into a formula with different coding or units changes the meaning of the model.
Two Ways to Generate Covariate Profiles
With empirical resampling, each simulated profile is selected from a row of observed covariate records. For a new population of simulated individuals, sampling rows with replacement is a common choice: the same observed profile can appear more than once, and no individual row is guaranteed to appear. Resampling whole rows preserves observed combinations of covariates, including their empirical associations.
With a specified distribution, profiles are generated from a probability model or a set of probabilities chosen to represent the target population. This can support population definitions beyond the observed cohort, but it requires specifying more than marginal distributions when covariates are related. For example, a conditional distribution for weight within age group preserves a different structure from drawing age group and weight independently.
| Approach | What it represents | Main check |
|---|---|---|
| Resample complete observed records | The empirical distribution of the cohort used as a stand-in for the target population | Does the cohort plausibly represent the intended population? |
| Sample from a specified joint distribution | A population described by the chosen probability model | Are marginal distributions, dependencies, and ranges plausible? |
| Sample each covariate independently | The product of the marginal distributions | Is independence actually a defensible assumption? |
| Use a single typical profile | A population in which every individual has the same chosen covariates | Is a population distribution really unnecessary for the question? |
Worked Example: Resampling Observed Profiles Jointly
Suppose a hypothetical cohort contains the following five observed profiles. Weight is in kilograms; the last column is the binary covariate \(F\).
| Record | Weight \(W\) | \(F\) |
|---|---|---|
| 1 | 55 | 1 |
| 2 | 62 | 1 |
| 3 | 78 | 0 |
| 4 | 84 | 0 |
| 5 | 68 | 1 |
For a hypothetical simulation of four new individuals, suppose the sampled record indices are 2, 5, 2, and 4. The resulting profiles are \((62,1)\), \((68,1)\), \((62,1)\), and \((84,0)\). Record 2 appears twice because sampling is with replacement. Each profile remains an observed weight-sex combination; the simulation has not invented a combination by pairing values from different records.
In this small cohort, all three records with \(F=1\) have weights below 70 kg, whereas the two records with \(F=0\) have weights above 70 kg. Resampling whole rows retains this association in the empirical distribution. Independently resampling weights and \(F\) would allow, for example, the combination \((84,1)\), which is not present in the cohort. That combination may be plausible in the actual target population, but the observed rows alone do not establish that it should be generated.
This procedure represents the cohort’s empirical profile distribution, not automatically the distribution of every population of interest. If the cohort was selected from a narrow clinical setting, the resulting simulated profiles inherit that restriction. The choice is justified only when the cohort is an appropriate stand-in for the simulation target.
Worked Example: Applying Covariate Effects to a Profile
Use the clearance model above with hypothetical fitted values \(CL_{\mathrm{pop}}=5.00\) L/h and \(\beta_F=-0.20\). Consider a simulated individual with \(W_i=84\) kg, \(F_i=1\), and a supplied random-effect value \(\eta_{CL,i}=0.10\). Calculate the individual clearance.
First substitute all values into the fitted model:
The weight ratio is \(84/70=1.20\), and \(1.20^{0.75}\approx1.147\). The total exponent is \(-0.20+0.10=-0.10\), so \(\exp(-0.10)\approx0.9048\). Therefore,
The result is an individual parameter value conditional on this profile and this supplied random effect, under the stated model. It is not obtained by adding \(-0.20\) L/h to clearance: the sex coefficient acts multiplicatively through the exponential. In a simulation that draws random effects, the value of \(\eta_{CL,i}\) would be generated according to the fitted random-effects model rather than chosen to fit the covariate profile.
Worked Example: Sampling From a Specified Joint Distribution
Suppose a hypothetical target population is represented by this discrete joint distribution. The table gives the probability of each weight-sex profile; the probabilities sum to 1. Use the same clearance model, with \(CL_{\mathrm{pop}}=5.00\) L/h and \(\beta_F=-0.20\), and set \(\eta_{CL}=0\) to isolate the covariate effect.
| Weight (kg) | \(F\) | Probability |
|---|---|---|
| 60 | 1 | 0.35 |
| 80 | 1 | 0.25 |
| 70 | 0 | 0.15 |
| 90 | 0 | 0.25 |
For each row, apply the model. At 60 kg with \(F=1\), \(CL=5.00(60/70)^{0.75}\exp(-0.20)\approx3.65\) L/h. At 80 kg with \(F=1\), \(CL=5.00(80/70)^{0.75}\exp(-0.20)\approx4.53\) L/h. At 70 kg with \(F=0\), \(CL=5.00\) L/h. At 90 kg with \(F=0\), \(CL=5.00(90/70)^{0.75}\approx6.04\) L/h.
The population-weighted mean of these covariate-adjusted values is
To simulate individuals, draw a row according to its probability and calculate that individual’s parameter from the row. The weighted calculation summarizes the expected covariate-adjusted clearance for this finite distribution when \(\eta_{CL}=0\); it is not a substitute for generating individual profiles when the goal is a population of simulated individuals. In particular, applying a nonlinear covariate function to a mean profile need not give the same result as averaging parameter values across profiles.
Justification for Empirical Resampling
The reason row resampling reproduces the cohort’s empirical distribution can be written directly. Let \(x_1,\ldots,x_N\) be the observed covariate profiles and let \(g(x)\) be any quantity calculated from a profile, such as its covariate-adjusted typical clearance. Define one resampled profile \(X^*\) to have probability \(1/N\) of equaling each observed row. Then
Thus the expected value of a function of a resampled profile equals its average over the observed records. If \(M\) profiles are independently sampled with replacement, the average of their \(g\)-values has this same conditional expectation. This establishes what resampling does: it targets the empirical distribution. It does not prove that the empirical distribution is representative of an external target population.
State the population the simulated profiles are intended to represent and identify the covariates needed by the fitted model.
Use complete observed rows when the cohort is a defensible empirical stand-in, or specify a joint or conditional distribution when targeting another population.
Sample profiles, check their values, then apply the fitted covariate functions with the original coding and units.
Compare its covariate summaries and combinations with the intended target, and investigate impossible or unexpected profiles before interpreting simulated outcomes.
Diagnostics, Alternatives, and Limitations
At minimum, compare simulated and intended covariate distributions using category proportions, means or quantiles for continuous variables, and ranges. Also inspect joint patterns: marginal summaries can match while combinations are wrong. Check for values outside the fitted model’s support, impossible category combinations, missing-value handling, and inconsistent units. If simulated profiles differ from the target, first determine whether the distribution was specified incorrectly, the observed cohort was an unsuitable stand-in, or the sampling code failed.
Independent marginal sampling is appropriate only when independence is a reasonable assumption for the target population or when the simulation deliberately defines such a population. Otherwise it can distort covariate combinations and, through nonlinear covariate effects, change the distribution of individual parameters. Joint empirical resampling preserves observed dependencies but cannot generate profiles outside the observed combinations. A specified joint or conditional model can represent broader combinations, but the result depends on that model. A single typical profile is simpler, but it removes covariate variation and cannot represent between-profile differences in parameters.
A further limitation is extrapolation. Applying a fitted covariate relationship to values far beyond those represented in the fitting data assumes that the same relationship continues to hold there. The covariate distribution and the fitted covariate model are separate ingredients: a plausible profile generator does not validate the parameter relationship, and a well-fitting relationship does not make the source cohort representative. Population simulations are conditional on both choices.
Common Mistake
Another common error is to use the mean covariate profile for every simulated individual and call the result a population simulation. That can be useful for a typical-profile calculation, but it removes covariate heterogeneity. With nonlinear relationships, the parameter calculated at the mean profile generally differs from the average parameter across profiles, as the discrete distribution example illustrates.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A cohort has linked records of age and body weight. What is preserved by resampling complete rows that may be lost by independently sampling age and weight?
- In the model \(CL_i=5(W_i/70)^{0.75}\exp(-0.20F_i+\eta_{CL,i})\), calculate \(CL_i\) for \(W_i=70\) kg, \(F_i=1\), and \(\eta_{CL,i}=0\).
- A simulated population matches the observed mean weight but includes many weight-sex combinations absent from the source cohort. Name one likely explanation and one diagnostic to perform.
- Why does resampling observed profiles not, by itself, show that the simulated population represents an external target population?
Solutions. (1) Complete-row resampling preserves the observed joint combinations and empirical association between age and weight; independent sampling replaces that joint distribution with the product of the two marginals. (2) Substitute the values: \(CL_i=5(70/70)^{0.75}\exp(-0.20(1)+0)=5\exp(-0.20)\approx4.09\) L/h. (3) Independent marginal sampling is one possible explanation. Compare joint combinations or a cross-tabulation in the simulated profiles with the source data and the intended target. (4) Resampling reproduces the cohort’s empirical distribution, as shown by the expectation of \(g(X^*)\); representativeness requires a separate justification about how the cohort relates to the external population.