Marginal Structural Model (Time-Varying Treatment)
A marginal structural model estimates the causal effect of a time-varying treatment by weighting each person-period with the inverse probability of the observed treatment history given past confounders.
주변 구조 모형은 과거 교란변수가 주어졌을 때 관찰된 처치 이력의 역확률로 각 개인-시점을 가중하여 시간에 따라 변하는 처치의 인과 효과를 추정하는 방법입니다.
Treatment changes over follow-up and is influenced by a confounder that the earlier treatment also affects; how can I estimate the effect of treatment history?
추적 기간 중 처치가 바뀌고, 이전 처치의 영향을 받은 교란변수가 다음 처치에 영향을 주는데, 처치 이력의 효과를 어떻게 추정하나요?
Inverse probability of treatment weights are built as the product over time of the probability of the received treatment given treatment history and baseline covariates, divided by the same probability that also conditions on time-varying confounders. A weighted pooled regression of the outcome on a treatment-history summary then estimates the marginal effect, with standard errors clustered by unit.
When to use Marginal Structural Model (Time-Varying Treatment)
- Treatment is binary and can change between measurement occasions.
- A time-varying confounder is itself affected by earlier treatment, so ordinary adjustment would block part of the effect.
- Data are in long format with one row per unit and period.
When to use something else
- Treatment is fixed at baseline; use propensity-score weighting or matching instead.
- Drop-out depends strongly on prognosis; this implementation has no censoring weights, so use g-computation or add inverse probability of censoring weights elsewhere.
Assumptions and requirements
- Sequential exchangeability given measured treatment history, time-varying and baseline covariates.
- Positivity: every covariate history has a non-zero probability of each treatment level.
- Correctly specified pooled logistic treatment models.
- Treatment before the first observed period is taken as 0.
What the analysis reports
- Effect of the treatment-history term (cumulative, current, or current plus lag) with cluster-robust SE and CI
- Odds ratio when the outcome model is pooled logistic
- Weight summary: mean, SD, minimum, maximum and truncation bounds
- Full outcome-model coefficient table
How to report it
A marginal structural linear model with stabilised inverse probability of treatment weights ([value] units, [value] person-periods) estimated b = [value] per additional treated period (cluster-robust SE = [value], 95% CI [[value], [value]]; mean weight = [value]).
Related methods
- Inverse Probability of Treatment Weighting
- G-computation
- Propensity Score Matching
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with NumPy and scikit-learn.
독립 계산. NumPy·scikit-learn 대조 참조 시험 1건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Marginal Structural Model (Time-Varying Treatment) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable, a treatment indicator, predictor (feature) columns, a unit (entity) ID and a time variable
- Price
- 1300 credits for one analysis up to 10,000 rows (complexity level 6); larger or wider data costs more. Optional methodologist review: 4500 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.