Infrastructure for Mediation Model Fitting and Extraction

Provides S7-based infrastructure for fitting mediation models, extracting path coefficients, and performing bootstrap inference. Designed as a foundation package for the mediation analysis ecosystem, supporting 'probmed', 'RMediation', and 'medrobust' packages. Implements unified interfaces for model fitting across different engines (generalized linear models, linear mixed models for cluster-randomized designs, and a maximum-likelihood structural equation engine; Bayesian methods are planned), standardized extraction of mediation paths from various model types, and robust bootstrap inference methods. Mediation methods are described in MacKinnon, Lockwood and Williams (2004) , Preacher and Hayes (2008) , Tofighi and MacKinnon (2011) , and VanderWeele (2014) .


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("medfit")

0.21.3 by Davood Tofighi, 4 days ago


https://data-wise.github.io/medfit/, https://github.com/data-wise/medfit


Report a bug at https://github.com/data-wise/medfit/issues


Browse source code at https://github.com/cran/medfit


Authors: Davood Tofighi [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


GPL (>= 3) license


Imports S7, stats, methods, checkmate, generics, lifecycle, MASS, nloptr, rlang

Suggests knitr, lavaan, lme4, numDeriv, OpenMx, pbkrtest, regmedint, RMediation, sandwich, testthat, tibble, withr, yaml


Suggested by RMediation.


See at CRAN