Tutorials › Marginal Structural Models › Statin Use With Time-Varying Lipid Measurements

Case Studies · Tutorial 472 of 501

Statin Use With Time-Varying Lipid Measurements

Learn how to estimate cardiovascular risks under sustained statin strategies when LDL cholesterol is both affected by prior treatment and predictive of subsequent treatment and events.

Advanced 13 min read

What You'll Learn

  • Define sustained statin strategies and interval-specific cardiovascular risks in a cohort with repeated LDL measurements.
  • Explain why LDL cholesterol creates treatment-confounder feedback.
  • Construct sequential treatment weights for adherent, at-risk person-intervals.
  • Derive interval-specific hazards and cumulative risks without requiring event cases to have later treatment histories.
  • Check positivity, weight stability, and risk-set denominators in a statin analysis.
  • Compare sequential weighting with conventional adjustment and identify its limits.

Why Repeated LDL Measurements Change the Analysis

Consider a cardiovascular cohort in which statin use is recorded repeatedly, LDL cholesterol is measured before treatment decisions, and myocardial infarction or cardiovascular death can occur during follow-up. A plausible sequence is that statin use lowers later LDL cholesterol, while LDL cholesterol predicts both the next statin decision and the event. LDL is therefore a time-varying confounder affected by prior treatment. Adjusting for each LDL measurement as if it were an ordinary baseline confounder can block part of the treatment effect while also failing to handle the later treatment confounding it creates.

The target here is the contrast between risks under two sustained strategies: use a statin at every treatment decision, and do not use a statin at any decision. The focus is the case-specific construction of the risk estimator. As in other target-trial analyses, the strategy, eligibility, outcome, and follow-up must be defined before estimation.

Definition: Let \(C\) denote baseline covariates. At the start of interval \(t\), let \(L_t\) be LDL cholesterol, \(A_t\in\{0,1\}\) indicate statin use, and \(R_t=1\) indicate that the person is alive, event-free, and under observation. Let \(D_{t+1}=1\) indicate a cardiovascular event during interval \(t\). A sustained strategy \(\bar a\) sets \(A_t=a_t\) at every treatment decision. The all-statin and no-statin strategies are \(\bar a=(1,\ldots,1)\) and \(\bar a=(0,\ldots,0)\), respectively.

The timing matters: LDL at \(t\) is measured before \(A_t\), and \(D_{t+1}\) occurs after that decision during the interval. Thus, for example, \(L_1\) may have been changed by \(A_0\), but it is available to predict \(A_1\) and the next event. A person who experiences an event during interval \(t\) contributes that event and has no later at-risk treatment decisions in the analysis.

Assumptions and the Sequential Weight

For identification, assume consistency (the observed outcome and covariate history under the observed treatment sequence equal those under that sequence), no interference between cohort members, and sequential exchangeability: among people with the same observed history and still at risk at \(t\), treatment assignment is independent of the relevant future counterfactual outcomes under the strategies being compared. Write the observed decision history as \(H_t=(C,\bar L_t,\bar A_{t-1})\). Exchangeability is required at each decision time, not merely at baseline.

Also require positivity: for histories that occur among people who would be at risk under a target strategy, the probability of receiving that strategy's next treatment must be positive. In a sustained statin analysis, this means that, wherever the target risk set has support, there are people with the relevant history who both do and do not receive statins as needed by the strategy. For uncensored analyses, assume complete outcome ascertainment through follow-up. With loss to follow-up, additionally assume sequential exchangeability and positivity for remaining observed, conditional on the measured history, and account for censoring with inverse-probability-of-censoring weights.

Definition: For a person who is at risk and has followed \(\bar a\) through time \(t\), define the unstabilized treatment weight $$ W_t^{\bar a}=\prod_{k=0}^{t}\frac{1}{P(A_k=a_k\mid H_k,R_k=1)}. $$ The weight is used only for person-intervals with \(R_t=1\) and \(\bar A_t=\bar a_t\). Here \(\bar A_t=(A_0,\ldots,A_t)\) and \(\bar a_t=(a_0,\ldots,a_t)\).

The weight upweights adherent people whose observed treatment sequence was unlikely given their measured history. For the interval-\(t\) hazard, it uses treatment probabilities only through \(t\): no event case must have a treatment history after the event. If censoring occurs, multiply by the corresponding inverse probability of remaining observed through the interval, conditional on the observed past. Treatment and censoring models should use information available before the decision or censoring event they predict.

Worked Example: Calculating a Sustained-Use Weight

Suppose a cohort member has baseline statin probability \(P(A_0=1\mid H_0)=0.60\). At the next decision, the person's observed LDL and past history give \(P(A_1=1\mid H_1,R_1=1)=0.75\). The person uses statins at both decisions and remains at risk through interval 1. Under the all-statin strategy, the weight through that interval is $$ W_1^{\bar 1}=\frac{1}{0.60}\times\frac{1}{0.75} =\frac{5}{3}\times\frac{4}{3} =\frac{20}{9}\approx 2.222. $$

The person represents about 2.222 people with this observed treatment history in the weighted analysis. This calculation does not imply that the person has 2.222 observed events; it is a contribution to a weighted risk-set total. A person who did not use a statin at baseline would not contribute to the all-statin strategy after that decision, and would not be assigned a weight requiring that person to have followed the strategy.

Estimate Interval Hazards, Then Cumulative Risk

For each interval, use the weighted event total divided by the weighted at-risk total among people who followed the strategy up to that interval. In a sample of \(n\) people, the estimator is

$$ \widehat h_t^{\bar a} = \frac{\displaystyle\sum_{i=1}^{n}R_{it}I(\bar A_{it}=\bar a_t)W_{it}^{\bar a}D_{i,t+1}} {\displaystyle\sum_{i=1}^{n}R_{it}I(\bar A_{it}=\bar a_t)W_{it}^{\bar a}}. $$

This is an interval-specific hazard estimator. Define the competing-death hazard \(\widehat m_t^{\bar a}\) using the same weighted risk-set denominator, with \(M_{i,t+1}\) in the numerator: $$ \widehat m_t^{\bar a} = \frac{\displaystyle\sum_{i=1}^{n}R_{it}I(\bar A_{it}=\bar a_t)W_{it}^{\bar a}M_{i,t+1}} {\displaystyle\sum_{i=1}^{n}R_{it}I(\bar A_{it}=\bar a_t)W_{it}^{\bar a}}. $$ Each event is counted in the interval in which it occurs, with the treatment weight through that interval. People who have an event are removed from later risk sets, as they should be; they are not excluded from the earlier interval in which their event occurred. The strategy-specific risk through interval \(K-1\) is then estimated by

$$ \widehat P(Y_K^{\bar a}=1) = \sum_{t=0}^{K-1} \left\{ \prod_{j=0}^{t-1} (1-\widehat h_j^{\bar a}-\widehat m_j^{\bar a}) \right\} \widehat h_t^{\bar a}, $$

where \(Y_K^{\bar a}=1\) denotes an event by the end of follow-up under strategy \(\bar a\). This construction is appropriate for a first-event outcome with interval risk sets. It does not require treatment histories after an event.

Result: Under consistency, no interference, sequential exchangeability, positivity, and complete follow-up (or correctly handled censoring), the population versions of \(\widehat h_t^{\bar a}\) and \(\widehat m_t^{\bar a}\) identify the cardiovascular-event and competing-death hazards in the risk set that would remain under strategy \(\bar a\). The strategy-specific cumulative incidence of the cardiovascular event is obtained by summing each interval's event hazard multiplied by the probability of remaining alive and free of either event through prior intervals.

To justify the hazard result, consider the weighted at-risk total at time \(t\). Its indicator requires observed adherence through \(t\) and survival event-free through \(t\). Consistency makes the observed event and risk status for such adherent people equal to their counterfactual status under \(\bar a_t\). At each decision \(k\le t\), exchangeability permits comparison of people with the same measured history; multiplying by \(1/P(A_k=a_k\mid H_k,R_k=1)\) cancels the selection induced by receiving \(a_k\). Iterating this argument over \(k=0,\ldots,t\) makes the weighted event and risk-set totals proportional to their corresponding counterfactual totals under \(\bar a\). Their ratio is therefore the counterfactual interval hazard. Positivity ensures each denominator probability is nonzero. In a large sample, the empirical weighted ratio converges to that population ratio when the relevant expectations are finite and the denominator limit is positive. \(\square\)

For the cumulative-risk result, let \(h_t^{\bar a}\) and \(m_t^{\bar a}\) be the counterfactual cardiovascular-event and competing-death hazards among people alive and free of the cardiovascular event at the start of interval \(t\) under \(\bar a\). The probability of remaining alive and free of the cardiovascular event through interval \(t\), given that status at its start, is \(1-h_t^{\bar a}-m_t^{\bar a}\). Thus the probability of a cardiovascular event in interval \(t\) is the probability of remaining alive and free of either event through prior intervals, multiplied by \(h_t^{\bar a}\). Summing these interval probabilities gives $$ P(Y_K^{\bar a}=1) = \sum_{t=0}^{K-1} \left\{ \prod_{j=0}^{t-1} (1-h_j^{\bar a}-m_j^{\bar a}) \right\} h_t^{\bar a}. $$ Replacing the hazards by their consistent estimates yields the displayed estimator. \(\square\)

Worked Example: Building Risk From Two Weighted Hazards

Assume there are no competing non-cardiovascular deaths in these two intervals. Suppose the weighted all-statin risk set in interval 0 totals 100 people, with a weighted event total of 10. Then \(\widehat h_0^{\bar 1}=10/100=0.10\). Among people who remain event-free and are adherent to the strategy at interval 1, suppose the weighted risk-set total is 75 and the weighted event total is 6. Then \(\widehat h_1^{\bar 1}=6/75=0.08\).

The estimated event-free probability through both intervals is $$ (1-0.10)(1-0.08)=0.90\times0.92=0.828. $$ Therefore, the estimated cumulative risk under sustained statin use is \(1-0.828=0.172\), or 17.2%. The interval-1 denominator is the weighted risk set at the start of interval 1, not the original cohort size. The weighted totals are illustrative aggregates of the person-interval contributions in the estimator.

Worked Example: Why an Early Event Must Stay in the Analysis

Consider a person who starts a statin, remains event-free through the first decision, and experiences a cardiovascular event during interval 1. Suppose the treatment probabilities for the observed statin decisions through interval 1 are 0.50 and 0.80. The person's weight for the event interval under sustained statin use is \(1/(0.50\times0.80)=2.5\). That weighted event contributes 2.5 to the interval-1 numerator and 2.5 to its weighted risk-set denominator.

There is no \(A_2\) for this person after the event, and none is needed. The person contributes to the hazard for the interval in which the event occurred, then is absent from later risk sets. Requiring a complete treatment history through the end of follow-up would discard this event case and select on survival. The sequential estimator avoids that error by using adherence only through the event interval.

What to Check in a Statin Analysis

The design and models must reflect the clinical timing. Check that LDL was measured before the treatment decision it is used to predict, that the cardiovascular event definition is applied consistently, and that each event is attributed to the correct interval. Review the estimated treatment probabilities within clinically relevant histories: near-zero probabilities can produce very large weights, while probabilities of zero violate positivity outright. Also inspect weighted risk-set totals and event counts at each time. A hazard with a zero or extremely small denominator is not reliably estimated merely because software returns a number.

Useful diagnostics include distributions and upper quantiles of the weights, the fraction of person-intervals with extreme weights, and whether weighting improves balance in measured prior LDL and other treatment predictors. Weight truncation may reduce variance but changes the estimator and can introduce bias; report the rule and assess sensitivity to it. Model misspecification in the treatment probabilities can leave confounding, and weight diagnostics cannot verify exchangeability for unmeasured factors.

ApproachHow it handles LDL feedbackMain concern
Sequential inverse-probability weightingWeights treatment decisions using measured history, including prior LDLRequires correct treatment models, positivity, and adequate weight behavior
Conventional outcome regression adjusting for current LDLIncludes LDL as a covariate in the outcome modelCan adjust away pathways from prior statin use through LDL and does not by itself resolve treatment-confounder feedback
Outcome regression with a full longitudinal g-formulaModels the evolving covariate and outcome distributions under specified strategiesRequires correct models for the relevant longitudinal distributions

These approaches target related causal quantities only when their assumptions and estimands align. Weighting is particularly transparent about how observed treatment histories are reweighted, but it does not eliminate the need for good measurement, adequate overlap, or a defensible causal design. LDL measurement error, unmeasured adherence or clinical indications, changes in treatment versions, and informative loss to follow-up can all undermine interpretation. The estimated contrast is a marginal comparison of strategy-specific risks in the target cohort, not automatically the effect for every clinical subgroup.

Common Pitfall

  • Wrong reasoning: “To estimate risk under sustained statin use, keep only people with a complete statin history through the end of follow-up and compare their event proportions.”
  • Why it fails: People who experience early events cannot have later treatment histories. Requiring complete histories excludes them and conditions on surviving long enough to provide those histories.
  • Correction: At each interval, include people who are at risk and adherent through that interval, weight their event and risk-set contributions using treatment probabilities through that interval, and combine the estimated hazards into cumulative risk.
Key takeaway: In the statin–LDL feedback setting, prior statin use can change LDL, and LDL can guide later treatment and predict events. Estimate risk using weighted, interval-specific risk sets; never require an event case to have treatment decisions recorded after the event.

Check Your Understanding

Answer each question, then check the short solutions below.

  1. Why can LDL cholesterol at time \(t\) be both a confounder for \(A_t\) and an effect of earlier statin use?
  2. For an event during interval 2, through which treatment decision does the treatment weight extend?
  3. If the weighted event and risk-set totals for a strategy are 12 and 120 in an interval, what is the estimated interval hazard?
  4. If there are no competing deaths and the hazards under a strategy are 0.05 and 0.10 in two intervals, what is its cumulative risk?
  5. What does a near-zero estimated probability of receiving a required treatment indicate, and why is it consequential?

Solutions. (1) Earlier statin use can alter LDL, and LDL measured before the current decision can predict both current treatment and the event. (2) Through the treatment decision at the start of interval 2; later decisions are unnecessary. (3) \(12/120=0.10\). (4) \(1-(1-0.05)(1-0.10)=1-(0.95)(0.90)=0.145\), or 14.5%. (5) It signals weak practical positivity and potentially extreme inverse-probability weights, so the estimate may be unstable and sensitive to a few observations.

Clinical Biostats