Tutorials › Pharmacometric Workflows and Reproducible Modeling › Real-World Data For Exposure-Response Analysis

Case Studies · Tutorial 390 of 399

Real-World Data For Exposure-Response Analysis

Build a defensible exposure-response analysis from real-world records by aligning dose histories and outcomes, adjusting for confounding, and checking how data capture affects interpretation.

Advanced 12 min read

What You'll Learn

  • Distinguish medication orders from evidence of actual dosing when defining real-world exposure.
  • Calculate a time-aligned exposure metric from irregularly timed dose records.
  • Explain how confounding by disease severity can reverse a crude exposure-response association.
  • Identify bias from uneven outcome measurement and repeated records.
  • Compare simple exposure group summaries with adjusted analyses and describe their limitations.

From Electronic Records to an Exposure-Response Question

Electronic health records (EHRs) can connect medication histories, laboratory results, clinical outcomes, and patient characteristics across routine care. Their richness does not guarantee that an exposure-response analysis is valid. A medication order is not necessarily a dose taken, a laboratory result is observed only when someone orders and records the test, and patients receiving more treatment may differ systematically from those receiving less. The analysis therefore begins by defining what exposure and outcome mean over a specific time window.

A useful question specifies the population, exposure window, outcome, and time relationship. For example: among eligible patients, how is average predicted concentration during the 30 days before a laboratory assessment associated with the laboratory value at that assessment? This is more precise than asking whether “dose is related to response,” because dose, concentration, timing, and the recorded outcome are distinct quantities.

Definition: A real-world exposure-response analysis relates an exposure measure derived from routine-care records to an outcome recorded in those records. The exposure measure must refer to a defined time window before, or otherwise appropriately aligned with, the outcome. An observed association is not automatically a causal effect.

Define the analysis population and time origin before examining results. Specify the outcome source and unit, the medication and formulation, the exposure window, and whether the target is an association or a causal contrast. In routine records, distinguish prescriptions, dispensing or administration records, and evidence that a patient actually took a dose. These sources have different meanings and error profiles. An order can describe intended treatment; it does not by itself establish the timing or amount of drug received.

Reconstructing and Aligning Exposure

For each patient, assemble dose events with their timestamps, amounts, units, route, and relevant medication changes. Check that timestamps use a consistent time zone and that dose records refer to the intended patient and formulation. A pharmacokinetic model can then translate dose histories into an exposure measure, provided its structural assumptions and parameter values are appropriate for the population and data. When concentration measurements are available, they can inform or check that reconstruction; sparse measurements do not justify pretending that concentrations were continuously observed.

One simple illustration uses a one-compartment model with instantaneous intravenous bolus doses and first-order elimination. Let \(D_j\) be a dose at time \(t_j\), \(V\) the apparent volume of distribution, and \(k\) the elimination rate constant. If the concentration at the start of the window is zero, then for time \(t\) in the window:

$$ C(t)=\sum_{j:t_j\le t}\frac{D_j}{V}\exp[-k(t-t_j)]. $$

This is a deliberately simple model, not a default description of oral dosing or every clinical drug. Its assumptions include the stated one-compartment disposition, instantaneous doses, constant \(V\) and \(k\) over the window, and a known dose history. For a different drug or route, use an appropriate pharmacokinetic model rather than applying this equation mechanically.

A time-aligned metric might be the area under the predicted concentration curve, \(AUC\), over the exposure window. If a dose \(D_j\) occurs within \([0,T]\), its contribution to the area from its dosing time to the end of that window is the integral of its exponential concentration contribution:

$$ \int_{t_j}^{T}\frac{D_j}{V}\exp[-k(t-t_j)]\,dt = \frac{D_j}{Vk}\left(1-\exp[-k(T-t_j)]\right). $$

The equality follows by integrating the exponential and using \(CL=Vk\), where \(CL\) is clearance in this model. Summing the contributions gives the window AUC. AUC divided by window duration is the time-averaged concentration. This derivation assumes that dose history before the window contributes nothing; if residual drug is present at the start, its concentration must also be represented.

Worked Example: Exposure Over an Irregularly Dosed Window

Hypothetical data. Suppose a patient receives two recorded intravenous bolus doses during a 24-hour window: 100 mg at hour 0 and 50 mg at hour 15. Assume \(V=20\) L, \(k=0.10\ \mathrm{h}^{-1}\), no residual concentration at hour 0, and an outcome measurement at hour 24. These assumptions are for illustration, not a clinical dosing recommendation.

First calculate clearance: \(CL=Vk=(20\ \mathrm{L})(0.10\ \mathrm{h}^{-1})=2.0\ \mathrm{L/h}\). The predicted concentration at hour 24 is:

$$ C(24)=\frac{100}{20}\exp[-0.10(24-0)] +\frac{50}{20}\exp[-0.10(24-15)] $$

Substitution gives \(C(24)=5\exp(-2.4)+2.5\exp(-0.9)=5(0.09072)+2.5(0.40657)=0.4536+1.0164=1.470\ \mathrm{mg/L}\). Thus, under the stated model, predicted concentration at the outcome time is about \(1.470\ \mathrm{mg/L}\).

The AUC contributions are \(100/2.0[1-\exp(-2.4)]=50(0.90928)=45.46\ \mathrm{mg\cdot h/L}\) and \(50/2.0[1-\exp(-0.9)]=25(0.59343)=14.84\ \mathrm{mg\cdot h/L}\). Total \(AUC_{0-24}=45.46+14.84=60.30\ \mathrm{mg\cdot h/L}\), giving an average concentration of \(60.30/24=2.512\ \mathrm{mg/L}\). The AUC describes the entire window; the predicted concentration at hour 24 describes one time point. They are not interchangeable exposure measures.

Confounding and the Meaning of an Association

A confounder is a variable related to both exposure and outcome that can distort their observed association. In EHR data, disease severity is a common concern: more severely ill patients may receive higher doses and may also have poorer outcomes regardless of treatment. Adjustment can reduce this distortion only if relevant confounders are measured adequately, the analysis handles them appropriately, and there is sufficient exposure overlap across their levels.

For a binary outcome, direct standardization illustrates the issue. Within each confounder stratum, estimate the outcome probability for each exposure group. Then average those stratum-specific probabilities using the same chosen stratum weights for both groups. The common weights remove differences in the stratum mix from this particular comparison; they do not remove unmeasured confounding.

Worked Example: A Crude Association Reverses After Standardization

Hypothetical data. Consider response (Yes/No) among patients classified as receiving high or low exposure. Disease severity is grouped as mild or severe.

SeverityHigh exposure: responded / totalLow exposure: responded / total
Mild9 / 1080 / 100
Severe18 / 901 / 10

Crude response proportions are \(27/100=0.270\) for high exposure and \(81/110=0.7364\) for low exposure. The crude risk difference, high minus low, is \(0.270-0.7364=-0.4664\), or about 46.6 percentage points lower response in the high-exposure group.

But the severity-specific proportions differ: among mild patients, high exposure has \(9/10=0.90\) response versus \(80/100=0.80\); among severe patients, the values are \(18/90=0.20\) versus \(1/10=0.10\). Standardize to a hypothetical population with equal proportions of mild and severe patients. The high-exposure response is \(0.5(0.90)+0.5(0.20)=0.55\); the low-exposure response is \(0.5(0.80)+0.5(0.10)=0.45\). The standardized difference is \(0.55-0.45=0.10\), or 10 percentage points higher response for high exposure.

Here, high exposure is much more common among severe patients, whose response is lower in both exposure groups. The crude comparison mixes exposure differences with severity composition. Standardization demonstrates how adjustment can change the descriptive association; it does not prove that increasing exposure causes a 10-point response increase. The example is small and hypothetical, and each stratum must contain enough patients to support its estimates.

A causal interpretation additionally requires assumptions such as adequate measurement and adjustment of common causes, comparable treatment definitions, positivity (patients with relevant covariate patterns could plausibly receive either exposure level), and correct analysis of the time ordering. If worsening disease changes treatment during the exposure window, ordinary adjustment for a single baseline severity value may not suffice. In all cases, state whether the result is an adjusted association or a causal estimate and identify the assumptions needed for the latter.

Uneven Observation and Data Capture

EHR measurements are usually irregular: patients have different numbers of visits, tests occur at different times, and records may be absent for reasons related to health or care. A row in the database is not necessarily an independent patient. If a patient with frequent tests contributes many rows, a simple row-level average gives that patient greater weight. Whether that weighting is appropriate depends on the intended estimand; it is not automatically the average patient experience.

Worked Example: How Visit Frequency Changes a Summary

Hypothetical data. In the same 30-day analysis period, two high-exposure patients have outcome measurements as follows: patient H1 has values 4, 5, 6, and 5; patient H2 has one value, 8. Two low-exposure patients have one measurement each: 6 and 7. Treat the outcome as a generic measurement scale.

The row-level high-exposure mean is \((4+5+6+5+8)/5=28/5=5.6\). The low-exposure row-level mean is \((6+7)/2=13/2=6.5\). This summary suggests a high-minus-low difference of \(5.6-6.5=-0.9\) units.

If the target is instead an equally weighted average of patients’ within-period means, H1's mean is \(20/4=5\), H2's mean is 8, and the high-exposure patient-weighted mean is \((5+8)/2=6.5\). The low-exposure patient-weighted mean is also \((6+7)/2=6.5\), so this comparison has a difference of zero. The contrast changes because the row-level calculation gives the more frequently measured high-exposure patient more weight. Neither summary resolves confounding or proves an exposure effect; the example shows why the target and observation process must be explicit.

For longitudinal outcomes, use actual measurement times and a model suited to the question, such as a repeated-measures model with patient-level dependence represented. A model that includes time can distinguish a changing outcome trajectory from a difference in measurement timing. If observation frequency itself depends on health status or treatment, simply adding more rows does not fix the problem; describe the capture process and consider sensitivity analyses or methods that explicitly address observation or selection.

Diagnostics, Alternatives, and Limitations

Before interpreting an estimate, check the data pathway and the model, not just the final coefficient. Useful checks include:

  • Compare medication orders with available dispensing or administration records, and quantify how often dose timestamps, amounts, or formulations are missing or inconsistent.
  • Plot dose histories, predicted concentrations, and outcome timestamps for a sample of patients. Check that exposure windows precede the outcomes they are meant to explain.
  • Inspect exposure distributions across key covariates. If one severity group has almost no patients at a particular exposure, adjustment relies on extrapolation rather than direct comparison.
  • Compare observed concentrations with model predictions when measurements exist, and investigate systematic deviations rather than assuming the model is calibrated.
  • Summarize outcome measurement frequency and timing by exposure and health status. Large differences can indicate that the analyzed records represent different observation processes.
  • Check whether results change under reasonable alternative exposure windows, definitions, and adjustment sets. Such checks reveal sensitivity; they do not identify a uniquely correct analysis by themselves.

A single dose category or the latest recorded concentration can be easier to calculate than a time-aligned model-based exposure, but may misrepresent exposure over the response window. Conversely, a detailed pharmacokinetic reconstruction uses more information but depends on model structure, parameter transportability, and the quality of dose records. Regression adjustment or standardization can address measured confounders; weighting approaches can also reweight observed patients, but require well-estimated probabilities and adequate overlap. No method repairs inaccurate timestamps, unmeasured confounding, or an outcome that is selectively recorded without additional assumptions.

Common pitfall: “Patients with higher prescribed doses had worse outcomes, so the drug worsened the outcome.” This reasoning treats prescribed dose as received exposure, ignores the timing of exposure and outcome, and overlooks confounding by indication. A defensible conclusion first reconstructs a time-aligned exposure, adjusts or stratifies for measured prognostic differences, assesses overlap and data capture, and describes the result as an association unless the assumptions for a causal interpretation are justified.

Real-world exposure-response analyses can be valuable for checking whether clinical patterns are consistent with prior pharmacology, identifying data gaps, and generating hypotheses. Their limitations should remain visible: routine records are created for care rather than a prespecified analysis, key covariates may be absent, exposure and outcomes may be misclassified, and observation may depend on patient condition. Present the population, window, exposure definition, adjustment variables, missingness and capture checks, and uncertainty alongside the estimate. A precise number cannot compensate for an unclear estimand or weak data provenance.

Check Your Understanding

Use the definitions and calculations above to answer the questions. Solutions follow the questions.

  1. Why is an EHR medication order alone insufficient evidence that a patient received a particular exposure?
  2. Under the one-compartment assumptions in the first worked example, what is the contribution of the 50 mg dose at hour 15 to the 24-hour AUC?
  3. In the standardization example, why does using the same mild/severe weights for both exposure groups change the crude comparison?
  4. What problem arises if one patient contributes many more outcome records than another, and what must be specified before choosing a summary?
  5. Name two checks that could reveal problems in a real-world exposure-response analysis.

Solutions. (1) An order records intended treatment; it does not establish that a dose was taken or administered, or its actual timing. (2) The contribution is \(50/2.0[1-\exp(-0.10(24-15))]=25(1-\exp(-0.9))=25(0.59343)=14.84\ \mathrm{mg\cdot h/L}\). (3) The high- and low-exposure groups have different severity mixes; common weights compare their stratum-specific proportions under the same severity distribution, rather than carrying forward that imbalance. (4) A row-level mean overweights the frequently measured patient. Specify whether the target weights records or patients, and account for within-patient dependence and measurement timing. (5) Examples include auditing dose timestamps and source records, checking exposure overlap across severity, comparing predicted with observed concentrations, and comparing outcome measurement frequency across groups.

Clinical Biostats