Package: missingmed 0.10.0

missingmed: Mediation Analysis with Multiple Imputation for Missing Data

Mediation analysis with incomplete data. Fits the mediator and outcome regressions on each dataset imputed with 'mice' (through 'medfit'), pools them with Rubin's rules, and infers the indirect effect with a Monte Carlo confidence interval ('RMediation') or a D4-stacked model-based constrained optimization (MBCO) likelihood-ratio test. Also provides an inverse probability weighting estimator, treatment-by-mediator interaction models, and a delta-adjustment sensitivity analysis for departures from missing at random. Structural equation models, including a latent mediator, are fit with 'lavaan'.

Authors:Davood Tofighi [aut, cre, cph]

missingmed_0.10.0.tar.gz
missingmed_0.10.0.zip(r-4.7-any)missingmed_0.10.0.zip(r-4.6-any)missingmed_0.10.0.zip(r-4.5-any)
missingmed_0.10.0.tgz(r-4.6-any)missingmed_0.10.0.tgz(r-4.5-any)
missingmed_0.10.0.tar.gz(r-4.7-any)missingmed_0.10.0.tar.gz(r-4.6-any)
missingmed_0.10.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
missingmed/json (API)

# Install 'missingmed' in R:
install.packages('missingmed', repos = c('https://data-wise.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/data-wise/missingmed/issues

Pkgdown/docs site:https://data-wise.github.io

On CRAN:

Conda:

4.47 score 21 scripts 15 exports 73 dependencies

Last updated from:ed28304c22 (on main). Checks:7 OK, 2 ERROR. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK218
source / vignettesOK282
linux-releaseOK225
macos-releaseERROR241
macos-oldrelERROR284
windows-develOK208
windows-releaseOK207
windows-oldrelOK146
wasm-releaseOK112

Exports:infermbco_d4MbcoMIResultMDMediationDataMDMediationFitMDMediationResultMDSensitivityResultn_impn_imputationsper_imputation_listpoolrunsensitivity_mnarset_md_mediationtidy

Dependencies:backportsbitbit64bootbroomcheckmateclicliprcodetoolscpp11crayoncubaturedplyrforcatsforeachgenericsglmnetgluehavenhmsiteratorsjomolatticelavaanlifecyclelme4magrittrMASSMatrixmedfitmiceminqamitmlmnormtnlmenloptrnnetnumDerivordinalpanpbivnormpillarpkgconfigprettyunitsprogresspurrrquadprogR6rbibutilsRcppRcppEigenRdpackreadrreformulasrlangRMediationrpartS7sandwichshapestringistringrsurvivaltibbletidyrtidyselecttzdbucminfutf8vctrsvroomwithrzoo

Testing an indirect effect with incomplete data
What you get | Before you impute: the imputation model | Worked example | The interval | The test | The result object | Options and edge cases | ariv = "fixed" or "own" | Without the pipeline: mbco_d4() | A single imputation | When (k) differs across imputations | MBCO on a pooled object | Models with an X:M interaction | Why MBCO does not commute with Rubin's rules | Operating characteristics | Not covered here | References

Last update: 2026-10-14
Started: 2026-06-12

Technical reference: design, contracts, and methodology
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

Last update: 2026-10-10
Started: 2026-06-12

Getting started with missingmed
A worked example | 1. Specify the mediation model | 2. Fit each imputation | 3. Pool with Rubin's rules | 4. Inference on the indirect effect | A binary mediator (or outcome) | Structural equation models and latent mediators | Migrating from the S4 API

Last update: 2026-10-09
Started: 2026-06-12

A worked analysis with a missing mediator
Part 1: the core analysis | The data | Step 1: the complete-data reference | Step 2: make the mediator missing at random | Step 3: impute the mediator | Step 4: a pooled Monte Carlo interval | Step 5: test the indirect effect with D4-MBCO | Step 6: when both paths are weak | Step 7: how much does the conclusion depend on MAR? | Part 2: new since missingmed 0.5.0 | The model is checked before it is fitted | Arguments that do not apply are reported | A treatment-by-mediator interaction | Sensitivity analysis with the MBCO test | Summary

Last update: 2026-10-08
Started: 2026-10-08