Package: regmedint 1.0.1

Yi Li

regmedint: Regression-Based Causal Mediation Analysis with Interaction and Effect Modification Terms

This is an extension of the regression-based causal mediation analysis first proposed by Valeri and VanderWeele (2013) <doi:10.1037/a0031034> and Valeri and VanderWeele (2015) <doi:10.1097/EDE.0000000000000253>). It supports including effect measure modification by covariates(treatment-covariate and mediator-covariate product terms in mediator and outcome regression models) as proposed by Li et al (2023) <doi:10.1097/EDE.0000000000001643>. It also accommodates the original 'SAS' macro and 'PROC CAUSALMED' procedure in 'SAS' when there is no effect measure modification. Linear and logistic models are supported for the mediator model. Linear, logistic, loglinear, Poisson, negative binomial, Cox, and accelerated failure time (exponential and Weibull) models are supported for the outcome model.

Authors:Kazuki Yoshida [ctb, aut], Yi Li [cre, aut], Maya Mathur [ctb]

regmedint_1.0.1.tar.gz
regmedint_1.0.1.zip(r-4.7)regmedint_1.0.1.zip(r-4.6)regmedint_1.0.1.zip(r-4.5)
regmedint_1.0.1.tgz(r-4.6-any)regmedint_1.0.1.tgz(r-4.5-any)
regmedint_1.0.1.tar.gz(r-4.7-any)regmedint_1.0.1.tar.gz(r-4.6-any)
regmedint_1.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
regmedint/json (API)

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

Bug tracker:https://github.com/kaz-yos/regmedint/issues

Pkgdown/docs site:https://kaz-yos.github.io

Datasets:
  • vv2015 - Example dataset from Valeri and VanderWeele 2015.

On CRAN:

Conda:

causal-inferencemediation-analysis

7.68 score 36 stars 56 scripts 887 downloads 2 mentions 2 exports 8 dependencies

Last updated from:78a14701a4. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK185
source / vignettesOK307
linux-release-x86_64OK183
macos-release-arm64OK103
macos-oldrel-arm64OK101
windows-develOK130
windows-releaseOK143
windows-oldrelOK147
wasm-releaseOK163

Exports:fit_mregregmedint

Dependencies:assertthatDerivlatticeMASSMatrixsandwichsurvivalzoo

Validation of extended formuals with effect modification using bootstrap
About this document | Parallel computing setup | Simulated data generating process | Generate datasets | Model fit | 1. Linear mediator model, linear outcome model | 2. Logistic mediator model, linear outcome model | 3. Linear mediator model, logistic outcome model | 4. Logistic mediator model, logistic outcome model | Results comparison

Last update: 2022-03-11
Started: 2022-02-03

Implementation of extended formulas when there are effect measure modifiers
No EMM by covariates | EMM by covariates | There is $A\times C$ term in mediator model | There is $A\times C$ term in both mediator and outcome models | There are $A\times C$ term in both mediator and outcome models, and $M\times C$ term in outcome model

Last update: 2022-02-18
Started: 2022-02-03

Introduction to user interface functions
Data preparation | regmedint object | regemedint() object constructor | summary() for regmedint | coef() for regmedint | vcov() for regmedint | confint() for regmedint | print() for regmedint | Methods for summary_regmedint | coef() for summary_regmedint | print() for summary_regmedint

Last update: 2022-02-03
Started: 2020-04-26

Implementation of formulas
mreg linear yreg linear (V2015 p466 Proposition 2.3) | Point estimates | Standard error estimates | mreg linear yreg non-linear (V2015 p468 Proposition 2.4) | mreg logistic yreg linear (V2015 p471 Proposition 2.5) | mreg logistic yreg non-linear (V2015 p473 Proposition 2.6) | Bibliography

Last update: 2021-05-11
Started: 2020-04-26

Using bootstrapping with regemedint
Bootstrapping support | boot package | modelr package | Comparison to the delta method confidence intervals

Last update: 2021-05-11
Started: 2020-04-26

Using multiple imputation with regmedint
Missing data generation | Truth fit | Naive complete case analysis | Multiple imputation | Comparison

Last update: 2021-05-11
Started: 2020-04-26

Readme and manuals

Help Manual

Help pageTopics
Create a vector of coefficients from the mediator model (mreg)beta_hat
Return mediation analysis functions given mediator and outcome models specifications.calc_myreg
Create calculators for effects and se (mreg linear / yreg linear)calc_myreg_mreg_linear_yreg_linear
Create calculators for effects and se (mreg linear / yreg logistic)calc_myreg_mreg_linear_yreg_logistic
Create calculators for effects and se (mreg logistic / yreg linear)calc_myreg_mreg_logistic_yreg_linear
Create calculators for effects and se (mreg logistic / yreg logistic)calc_myreg_mreg_logistic_yreg_logistic
Extract point estimates.coef.regmedint
Extract the result matrix from a summary_regmedint object.coef.summary_regmedint
Confidence intervals for mediation prameter estimates.confint.regmedint
Fit a model for the mediator given the treatment and covariates.fit_mreg
Fit a model for the outcome given the treatment, mediator, and covariates.fit_yreg
Calculate the gradient of the proportion mediated for yreg linear.grad_prop_med_yreg_linear
Calculate the gradient of the proportion mediated for yreg logistic.grad_prop_med_yreg_logistic
Low level constructor for a regmedint S3 class object.new_regmedint
print method for regmedint objectprint.regmedint
Print method for summary objects from 'summary.regmedint'print.summary_regmedint
Calculate the proportion mediated for yreg linear.prop_med_yreg_linear
Calculate the proportion mediated for yreg logistic.prop_med_yreg_logistic
Conduct regression-based causal mediation analysisregmedint
Report variables with missing datareport_missing
summary method for regmedint objectsummary.regmedint
Summary with robust sandwich variance estimator for modified Poissonsummary.regmedint_mod_poisson
Create a vector of coefficients from the outcome model (yreg)theta_hat
Validate arguments to regmedint before passing to other functionsvalidate_args
Validate soundness of a regmedint object.validate_regmedint
Extract variance estimates in the vcov form.vcov.regmedint
Robust sandwich variance estimator for modified Poissonvcov.regmedint_mod_poisson
Example dataset from Valeri and VanderWeele 2015.vv2015