Why cumulative exposure needs careful construction
A time-varying exposure is often recorded as a sequence of values over follow-up. A cumulative exposure combines those values with the amount of time for which each applied. For example, a concentration of a medication or environmental agent held constant for a longer period contributes more to the total exposure than the same concentration held for a short period. The calculation is simple once the time intervals and units are explicit; mistakes at interval boundaries or after imputation can, however, create derived variables that do not represent the intended exposure history.
In multiple imputation by chained equations (MICE), cumulative exposure may be used as a predictor or included in a later analysis. When it is calculated from a time-varying covariate, it is not an independent piece of information: it is determined by that covariate’s values and the interval durations. Therefore, when an input value is imputed or updated, its cumulative exposure must be recalculated from the updated input.
Assumptions and a boundary-safe calculation
This construction assumes the intervals for a person are ordered, do not overlap, and describe the follow-up period of interest. The recorded \(X_{ij}\) must represent the exposure rate during interval \(j\); treating it as constant is a piecewise-constant exposure assumption. If there is a gap, its contribution must be defined from the data or study design rather than silently omitted. If exposure is known to be zero in the gap, include that duration with value zero. If the exposure changes continuously within an interval, this formula is only an approximation unless the constant-value assumption is reasonable.
At a shared boundary, the cumulative total is continuous. The previous interval’s full contribution is included once, and the next interval contributes zero at its start. To see why, if interval \(j+1\) starts at \(b_{ij}\), then at that time its partial contribution is \(X_{i,j+1}(b_{ij}-a_{i,j+1})=0\). Its earlier-interval sum already includes the completed contribution from interval \(j\). This convention avoids counting the current interval both in a completed-interval sum and in a partial-interval term.
The equation also gives a useful update check: over an interval, the increase in cumulative exposure must equal the exposure rate multiplied by elapsed time. In particular, \(C_i(t_2)-C_i(t_1)=X_{ij}(t_2-t_1)\) whenever \(t_1\) and \(t_2\) lie within the same interval. For nonnegative exposure rates, cumulative exposure cannot decrease.
Worked Example: Cumulative Exposure at Boundaries and Within Intervals
Consider hypothetical measurements for one person. Exposure is measured in milligrams per litre, and time is measured in days. Assume the value recorded in each interval is constant throughout that interval.
| Interval | Exposure \(X_{ij}\) (mg/L) | Duration (days) |
|---|---|---|
| [0, 2) | 3 | 2 |
| [2, 5) | 1 | 3 |
| [5, 7) | 4 | 2 |
At day 2, the first interval has contributed \(3\text{ mg/L}\times2\text{ days}=6\text{ mg·day/L}\). At day 4, the current interval is the second one, so its partial contribution is \(1\times(4-2)=2\text{ mg·day/L}\). Thus
At day 5, use the first two intervals as completed contributions and do not add a partial contribution from the third interval: \(C_i(5)=3(2)+1(5-2)=6+3=9\text{ mg·day/L}\). Equivalently, day 5 is the start of the third interval, whose partial contribution is \(4(5-5)=0\).
At day 6, the third interval has contributed \(4(6-5)=4\text{ mg·day/L}\), so \(C_i(6)=3(2)+1(3)+4(1)=13\text{ mg·day/L}\). At day 7, the total is \(3(2)+1(3)+4(2)=17\text{ mg·day/L}\). The increments are consistent with the rates: from day 5 to day 6, cumulative exposure rises by \(4\text{ mg·day/L}\), exactly \(4\text{ mg/L}\times1\text{ day}\).
Deriving the interval formula
Under the piecewise-constant assumption, the exposure rate for person \(i\) equals \(X_{ik}\) within each completed interval \(k\). The contribution from such an interval is its rate multiplied by its duration. In the current interval \(j\), only the time from its start \(a_{ij}\) through \(t\) has elapsed. Adding these contributions gives the integral from the start of follow-up to \(t\):
The integration limits express the time represented by each contribution. In particular, the current interval is excluded from the completed-interval sum. This is essential at \(t=b_{ij}\): the last term then supplies the full contribution from interval \(j\), exactly once.
Constructing and refreshing cumulative exposure in MICE
For each imputed data set, calculate cumulative exposure using the covariate values in that data set. If an interval-specific input is missing and receives a new imputed value during a MICE iteration, every cumulative value at or after that interval can change. Cumulative values before that interval do not change, provided the preceding input values and interval boundaries are unchanged.
This is a deterministic relationship, so the derived cumulative variable should be refreshed from its inputs rather than separately imputed as if it were an unrelated measurement. Keeping a cumulative variable fixed while its input is redrawn breaks the defining relationship. The result may combine one imputed exposure history with cumulative totals calculated from another. This guidance concerns the arithmetic consistency of the derived quantity; the imputation model and analysis still require appropriate substantive choices.
For each person, check interval boundaries, durations, units, and any gaps. Confirm that each input value describes the intended interval.
Within each imputed data set, multiply each interval value by its duration and accumulate the contributions in time order. For a time within an interval, add only that interval’s elapsed-time contribution.
Whenever MICE changes an input covariate value, recalculate the affected cumulative exposure values from the updated history. Repeat separately for each imputed data set.
Verify that each increment equals the corresponding exposure rate multiplied by elapsed time, and that the cumulative values agree with the inputs at all interval boundaries.
Worked Example: A Switched Binary Exposure
Suppose a hypothetical person is unexposed during days [0, 1.5), exposed during [1.5, 4), and unexposed again during [4, 6). Let \(X_{ij}=1\) when exposed and \(X_{ij}=0\) otherwise. Here cumulative exposure is time exposed, measured in days.
At day 1.5, \(C_i(1.5)=0(1.5)=0\) days. At day 3, the current interval is [1.5, 4), so \(C_i(3)=0(1.5)+1(3-1.5)=1.5\) days. At day 4, the full exposed interval contributes \(1(4-1.5)=2.5\) days, and the next interval has contributed nothing yet. Thus \(C_i(4)=2.5\) days.
At day 5, the current interval is unexposed, so its contribution is \(0(5-4)=0\). Therefore \(C_i(5)=0(1.5)+1(2.5)+0(1)=2.5\) days. The cumulative time exposed remains constant during the unexposed period, as it should.
Worked Example: Refreshing a Cumulative Total After Imputation
Suppose a hypothetical person has an observed exposure of 2 units per day on [0, 2), followed by a missing exposure on [2, 5). In one completed imputed data set, the missing value is imputed as 5 units per day. The cumulative exposure at day 2 is \(2(2)=4\) unit-days, and at day 5 it is
Now suppose a later MICE update replaces the second interval’s imputed value with 3 units per day. Recalculate the cumulative exposure through day 5: \(C_i(5)=2(2)+3(5-2)=4+9=13\text{ unit-days}\). The cumulative value at day 2 remains 4 unit-days because the updated input applies only after day 2. The value at day 5 must change from 19 to 13 unit-days. Retaining 19 after the input changed would make the derived variable inconsistent with the current imputed history.
If multiple imputed data sets have different draws for the missing interval, each has its own corresponding cumulative total. For example, an imputed value of 4 units per day would give \(2(2)+4(3)=16\) unit-days through day 5. These totals differ because the imputed exposure histories differ, not because the cumulative calculation is stochastic once the inputs are fixed.
Diagnostics, alternatives, and limitations
A few simple checks catch many errors. Confirm that every interval duration \(b_{ij}-a_{ij}\) is positive, that the person’s intervals are in time order, and that units are consistent. At adjacent interval boundaries, the cumulative total should be the same whether evaluated as the end of the earlier interval or the start of the next. For nonnegative inputs, cumulative exposure should be nondecreasing. If an input changes, compare cumulative totals before and after its interval: earlier totals should be unchanged, while later totals should reflect the altered contribution.
Common signs of failure include a jump at a boundary that is too large, a decreasing total despite nonnegative inputs, an increment that does not equal rate times duration, or a cumulative variable that remains unchanged after an input is updated. Repeated or overlapping intervals can cause double counting; unaccounted gaps can omit exposure. Units also matter: multiplying a daily rate by hours without converting units produces an incorrect total.
Cumulative exposure is not the same as the current exposure value or a lagged exposure value. A current value describes the rate at a particular interval; a lagged value describes an earlier rate; a cumulative value combines rates over elapsed time. It may be useful when total duration-weighted exposure is the intended summary, but it discards the order and timing of exposure patterns. Two histories can have the same cumulative total while having different exposure peaks or timing. It also relies on the interval values adequately representing exposure between measurements. If values are believed to change within intervals, a different within-interval model or integration rule may be needed.
A tempting alternative is to impute the cumulative exposure independently. That may produce totals inconsistent with the imputed interval inputs. Another alternative is to calculate the cumulative variable once before imputation and leave it fixed; this is also incorrect when an input covariate is subsequently imputed or updated. The defining arithmetic should be enforced by recalculation, while the imputation model itself must be chosen to suit the substantive analysis and data.
Check Your Understanding
Work through the calculations, then compare your answers with the solutions below.
- Exposure is 2 units per day on [0, 3) and 4 units per day on [3, 5). Calculate cumulative exposure at days 3 and 4.
- A person is exposed at rate 1.5 units per day on [0, 2), then at rate 0 on [2, 6). What is the cumulative exposure at day 5, and why?
- A missing interval value on [4, 7) is imputed first as 2 units per day and later as 6 units per day. By how much does cumulative exposure at day 7 change? Does cumulative exposure at day 4 change?
- Name two checks that can detect a cumulative-exposure calculation error, and explain what pattern would indicate a problem.
Solutions. (1) At day 3, \(C_i(3)=2(3)=6\) unit-days. At day 4, \(C_i(4)=2(3)+4(4-3)=6+4=10\) unit-days. The second interval is included only through one elapsed day at day 4. (2) At day 5, \(C_i(5)=1.5(2)+0(5-2)=3\) unit-days. No additional exposure accumulates after day 2 because the rate is zero. (3) The new draw adds \( (6-2)(7-4)=12\) unit-days to the total through day 7. The cumulative value at day 4 does not change because the updated interval begins at day 4 and has contributed zero time at that boundary. (4) For example, check that a within-interval increment equals rate times elapsed time, and check that the total is continuous across adjacent boundaries. A mismatched increment or a boundary jump indicates a likely calculation, duration, or indexing error.