Technical reference: design, contracts, and methodology4 days ago
1. Architecture (S7, four verbs, three classes) | 2. Ecosystem contracts | 2.1 medfit::MediationData (the fitting contract) | 2.2 RMediation (the inference contract) | 2.3 Dependency direction (no cycle) | 3. The MI estimator and Rubin's rules | Worked example: pooling three imputations | 3A. Treatment-by-mediator interaction (X:M) | 3A.1 Estimand | 3A.2 The four-way decomposition, pooled | 3A.3 What stays refused | 4. MBCO under MI: D4-stacking (and why it is hosted here) | 4.1 Why MBCO does not commute with Rubin's rules | 4.2 D4 combination | Worked example: pooling three MBCO statistics | 4.3 Hosting decision | 5. The IPW estimator | 5.1 Pipeline | 5.2 Weight estimation | Worked example: four weights, stabilized and trimmed | 5.3 Variance: sandwich vs model | 5A. Non-gaussian models (family_y, family_m) and the scale of a*b | 5A.1 The scale caveat | 5A.2 IPW plus a binomial family: the non-integer-successes warning | 5B. MNAR sensitivity (sensitivity_mnar()) | 5B.1 Method | 5B.2 What delta actually is — read before choosing a value | 5B.3 Reading a tipping point | 5B.4 Binary targets: when is a log-odds delta of 1 plausible? | 5B.5 Limitations | 6. Cross-package engineering decisions | 7. Design-choice summary | 7A. Self-check | 7A.1 Three common confusions | 8. References