regmedint

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / regmedint

regmedint

v1.0.2
Repository CRANLicense GPL-2Lifecycle activeNeeds compilation no
DOI
10.32614/CRAN.package.regmedint
Task views
Causal Inference

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

1
Task views
Causal Inference

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
1.0.2
License
GPL-2
Lifecycle
active
Needs compilation
no
Last observed
2026-05-30
CRAN
cran.r-project.org/package=regmedint

수집 소스별 패키지 정보

1개 소스
CRAN
1.0.2
2026-05-30
License
GPL-2
Depends
R (>= 2.10)
Imports
Deriv, MASS, Matrix, assertthat, sandwich, survival
Suggests
boot, furrr, future, geepack, knitr, mice, mitools, modelr, purrr, rlang, rmarkdown, stringr, testthat, tidyverse, magic, formattable, kableExtra
Needs compilation
no
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

5개 표시전체 23개
PackageTypeSpec
assertthat
CRAN · 1.0.2 · 2026-05-30
Importsassertthat
Deriv
CRAN · 1.0.2 · 2026-05-30
ImportsDeriv
MASS
CRAN · 1.0.2 · 2026-05-30
ImportsMASS
Matrix
CRAN · 1.0.2 · 2026-05-30
ImportsMatrix
sandwich
CRAN · 1.0.2 · 2026-05-30
Importssandwich
1 / 5

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
63
Repository
CRAN
Version
1.0.2
Collected
2026-05-16 21:34:57
Package page
https://cran.r-project.org/web/packages/regmedint/index.html
DOI
10.32614/CRAN.package.regmedint
CRAN checks
https://cran.r-project.org/web/checks/check_results_regmedint.html
NEWS
https://cran.r-project.org/web/packages/regmedint/news/news.html
Reference HTML
https://cran.r-project.org/web/packages/regmedint/refman/regmedint.html
Reference PDF
https://cran.r-project.org/web/packages/regmedint/regmedint.pdf
Source package
https://cran.r-project.org/src/contrib/regmedint_1.0.2.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/regmedint
In views
CausalInference
Page fields
Author
Kazuki Yoshida [ctb, aut], Yi Li [cre, aut], Maya Mathur [ctb]
BugReports
https://github.com/kaz-yos/regmedint/issues
CRAN Checks
regmedint results
DOI
10.32614/CRAN.package.regmedint
In Views
CausalInference
License
GPL-2
Maintainer
Yi Li <yi.li10 at mail.mcgill.ca>
Materials
NEWS
NeedsCompilation
no
Old Sources
regmedint archive
Package Source
regmedint_1.0.2.tar.gz
Published
2026-03-06
Reference Manual
regmedint.html , regmedint.pdf
URL
https://kaz-yos.github.io/regmedint/
Version
1.0.2
Vignettes
Introduction to user interface functions ( source , R code ) Implementation of formulas ( source , R code ) Using bootstrapping with regemedint ( source , R code ) Using multiple imputation with regmedint ( source , R code ) Implementation of extended formulas when there are effect measure modifiers ( source , R code ) Validation of extended formuals with effect modification using bootstrap ( source , R code )
Windows Binaries
r-devel: regmedint_1.0.2.zip , r-release: regmedint_1.0.2.zip , r-oldrel: regmedint_1.0.2.zip
MacOS Binaries
r-release (arm64): regmedint_1.0.2.tgz , r-oldrel (arm64): regmedint_1.0.2.tgz , r-release (x86_64): regmedint_1.0.2.tgz , r-oldrel (x86_64): regmedint_1.0.2.tgz
Version
1.0.2
Published
2026-03-06
DOI
10.32614/CRAN.package.regmedint
Maintainer
Yi Li <yi.li10 at mail.mcgill.ca>
BugReports
https://github.com/kaz-yos/regmedint/issues
License
GPL-2
URL
https://kaz-yos.github.io/regmedint/
NeedsCompilation
no
Materials
NEWS
In Views
CausalInference
CRAN Checks
regmedint results
Reference Manual
regmedint.html , regmedint.pdf
Vignettes
Introduction to user interface functions ( source , R code ) Implementation of formulas ( source , R code ) Using bootstrapping with regemedint ( source , R code ) Using multiple imputation with regmedint ( source , R code ) Implementation of extended formulas when there are effect measure modifiers ( source , R code ) Validation of extended formuals with effect modification using bootstrap ( source , R code )
Package Source
regmedint_1.0.2.tar.gz
Windows Binaries
r-devel: regmedint_1.0.2.zip , r-release: regmedint_1.0.2.zip , r-oldrel: regmedint_1.0.2.zip
MacOS Binaries
r-release (arm64): regmedint_1.0.2.tgz , r-oldrel (arm64): regmedint_1.0.2.tgz , r-release (x86_64): regmedint_1.0.2.tgz , r-oldrel (x86_64): regmedint_1.0.2.tgz
Old Sources
regmedint archive
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"regmedint.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/refman/regmedint.html"},{"label":"regmedint.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/regmedint.pdf"},{"label":"Introduction to user interface functions","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_01_introduction.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_01_introduction.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_01_introduction.R"},{"label":"Implementation of formulas","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_02_formulas.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_02_formulas.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_02_formulas.R"},{"label":"Using bootstrapping with regemedint","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_03_bootstrap.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_03_bootstrap.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_03_bootstrap.R"},{"label":"Using multiple imputation with regmedint","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_04_mi.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_04_mi.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_04_mi.R"},{"label":"Implementation of extended formulas when there are effect measure modifiers","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_05_emm.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_05_emm.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_05_emm.R"},{"label":"Validation of extended formuals with effect modification using bootstrap","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_06_delta_boot.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_06_delta_boot.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/regmedint/vignettes/vig_06_delta_boot.R"}]
Text
Reference manual: regmedint.html , regmedint.pdf Vignettes: Introduction to user interface functions ( source , R code ) Implementation of formulas ( source , R code ) Using bootstrapping with regemedint ( source , R code ) Using multiple imputation with regmedint ( source , R code ) Implementation of extended formulas when there are effect measure modifiers ( source , R code ) Validation of extended formuals with effect modification using bootstrap ( source , R code )
Downloads
Heading
Downloads
Links
[{"label":"regmedint_1.0.2.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/regmedint_1.0.2.tar.gz"},{"label":"regmedint_1.0.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/regmedint_1.0.2.zip"},{"label":"regmedint_1.0.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/regmedint_1.0.2.zip"},{"label":"regmedint_1.0.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/regmedint_1.0.2.zip"},{"label":"regmedint_1.0.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/regmedint_1.0.2.tgz"},{"label":"regmedint_1.0.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/regmedint_1.0.2.tgz"},{"label":"regmedint_1.0.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/regmedint_1.0.2.tgz"},{"label":"regmedint_1.0.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/regmedint_1.0.2.tgz"},{"label":"regmedint archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/regmedint"}]
Text
Package source: regmedint_1.0.2.tar.gz Windows binaries: r-devel: regmedint_1.0.2.zip , r-release: regmedint_1.0.2.zip , r-oldrel: regmedint_1.0.2.zip macOS binaries: r-release (arm64): regmedint_1.0.2.tgz , r-oldrel (arm64): regmedint_1.0.2.tgz , r-release (x86_64): regmedint_1.0.2.tgz , r-oldrel (x86_64): regmedint_1.0.2.tgz Old sources: regmedint archive
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=regmedint","section":"","type":"","url":"https://CRAN.R-project.org/package=regmedint"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=regmedint to link to this page.
Materials 1
Documentation 20
Vignettes 18
Downloads 9
All page links 63

패키지 문서 원문

3 artifacts
field
NEWS
CRAN · 1.0.2 · Materials · text/html · 2,232 · 2026-05-07
Title
NEWS
Label
NEWS
Text content
Text content
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} regmedint 1.0.1 MINOR UPDATE to transition maintainer to Yi Li ( @einsley1993 ). regmedint 1.0.0 MAJOR UPDATE to add effect modification product terms regmedint() now allows the inclusion of the product terms between covariates and the treatment or the mediator terms to include effect modification by covariates in the underlying regression models. Contribution by @einsley1993 doi:10.1097/EDE.0000000000001643 regmedint 0.2.1 BUGFIX for knitr update Add rmarkdown to Suggests to support new knitr regmedint 0.2.0 Improve missingness messaging/handling. The message points to the multiple imputation vignette. regmedint() now has na_omit option for complete case analysis ( @einsley1993 ). regmedint 0.1.0 This is the first CRAN release version. regmedint 0.1.0rc This is the first CRAN release candidate version. All models in Valeri and VanderWeele’s %mediation() SAS macro are supported. regmedint 0.0.0.9000 This is the pre-release developmental version.
reference_manual_html
Reference manual HTML
CRAN · 1.0.2 · Documentation · text/html · 80,930 · 2026-05-07
Title
Help for package regmedint
Label
Reference manual HTML
Text content
Text content
Help for package regmedint const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {regmedint} Contents regmedint-package beta_hat calc_myreg calc_myreg_mreg_linear_yreg_linear calc_myreg_mreg_linear_yreg_logistic calc_myreg_mreg_logistic_yreg_linear calc_myreg_mreg_logistic_yreg_logistic coef.regmedint coef.summary_regmedint confint.regmedint fit_mreg fit_yreg grad_prop_med_yreg_linear grad_prop_med_yreg_logistic new_regmedint print.regmedint print.summary_regmedint prop_med_yreg_linear prop_med_yreg_logistic regmedint report_missing summary.regmedint summary.regmedint_mod_poisson theta_hat validate_args validate_regmedint vcov.regmedint vcov.regmedint_mod_poisson vv2015 Title: Regression-Based Causal Mediation Analysis with Interaction and Effect Modification Terms Version: 1.0.2 Description: 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. License: GPL-2 Encoding: UTF-8 LazyData: true Imports: Deriv, MASS, Matrix, assertthat, sandwich, survival Suggests: boot, furrr, future, geepack, knitr, mice, mitools, modelr, purrr, rlang, rmarkdown, stringr, testthat, tidyverse, magic, formattable, kableExtra RoxygenNote: 7.3.3 VignetteBuilder: knitr URL: https://kaz-yos.github.io/regmedint/ BugReports: https://github.com/kaz-yos/regmedint/issues Depends: R (≥ 2.10) NeedsCompilation: no Packaged: 2026-03-06 05:49:11 UTC; yili Author: Kazuki Yoshida [ctb, aut], Yi Li [cre, aut], Maya Mathur [ctb] Maintainer: Yi Li <yi.li10@mail.mcgill.ca> Repository: CRAN Date/Publication: 2026-03-06 08:00:02 UTC regmedint: A package for regression-based causal mediation analysis Description The package is an R implementation of regression-based closed-form causal mediation as originally described in Valeri & VanderWeele 2013 and Valeri & VanderWeele 2015 https://hsph.harvard.edu/research/vanderweele-group/tools-and-tutorials/ . The earlier version is a sister program of the SAS macro. The current extended version (version 1.0 and later) supports effect modification by covariates (treatment-covariate and mediator-covariate product terms) in mediator and outcome models. Fitting models Use the regmedint function to fit models and set up regression-based causal mediation analysis. Examining results Several methods are available to examine the regmedint object. print summary coef confint Author(s) Maintainer : Yi Li yi.li10@mail.mcgill.ca ( ORCID ) Authors: Kazuki Yoshida kazukiyoshida@mail.harvard.edu ( ORCID ) [contributor] Other contributors: Maya Mathur ( ORCID ) [contributor] See Also Useful links: https://kaz-yos.github.io/regmedint/ Report bugs at https://github.com/kaz-yos/regmedint/issues Create a vector of coefficients from the mediator model (mreg) Description This function extracts coef from mreg_fit and pads with zeros appropriately to create a named vector consistently having the following elements: (Intercept) , avar , cvar (this part is eliminated when cvar = NULL ), emm_ac_mreg (this part is eliminated when emm_ac_mreg = NULL ). Usage beta_hat(mreg, mreg_fit, avar, cvar, emm_ac_mreg = NULL) Arguments mreg A character vector of length 1. Mediator regression type: "linear" or "logistic" . mreg_fit Model fit object for mreg (mediator model). avar A character vector of length 1. Treatment variable name. cvar A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar . emm_ac_mreg A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model. Value A named numeric vector of coefficients. Return mediation analysis functions given mediator and outcome models specifications. Description This function returns functions that can be used to calculate the causal effect measures, given the mediator model fit ( mreg_fit ) and the outcome model fit ( yreg_fit ). Usage calc_myreg( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction ) Arguments mreg A character vector of length 1. Mediator regression type: "linear" or "logistic" . mreg_fit Model fit from fit_mreg yreg A character vector of length 1. Outcome regression type: "linear" , "logistic" , "loglinear" , "poisson" , "negbin" , "survCox" , "survAFT_exp" , or "survAFT_weibull" . yreg_fit Model fit from fit_yreg avar A character vector of length 1. Treatment variable name. mvar A character vector of length 1. Mediator variable name. cvar A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar . emm_ac_mreg A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model. emm_ac_yreg A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model. emm_mc_yreg A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model. interaction A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE. Value A list containing two functions. The first is for calculating point estimates. The second is for calculating the correspoding Create calculators for effects and se (mreg linear / yreg linear) Description Construct functions for the conditional effect estimates and their standard errors in the mreg linear / yreg linear setting. Internally, this function deconstructs model objects and feeds parameter estiamtes to the internal worker functions calc_myreg_mreg_linear_yreg_linear_est and calc_myreg_mreg_linear_yreg_linear_se . Usage calc_myreg_mreg_linear_yreg_linear( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction ) Arguments mreg A character vector of length 1. Mediator regression type: "linear" or "logistic" . mreg_fit Model fit from fit_mreg yreg A character vector of length 1. Outcome regression type: "linear" , "logistic" , "loglinear" , "poisson" , "negbin" , "survCox" , "survAFT_exp" , or "survAFT_weibull" . yreg_fit Model fit from fit_yreg avar A character vector of length 1. Treatment variable name. mvar A character vector of length 1. Mediator variable name. cvar A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar . emm_ac_mreg A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate prod
section
regmedint.pdf
CRAN · 1.0.2 · Documentation · application/pdf · 148,683 · 2026-05-07
Title
regmedint.pdf
Label
regmedint.pdf

Reference for regmedint (1.0.2)

29개 topic
beta_hat
Create a vector of coefficients from the mediator model (mreg)
CRAN · 1.0.2 · regmedint/man/beta_hat.Rd · 2026-05-07

This function extracts coef from mreg_fit and pads with zeros appropriately to create a named vector consistently having the following elements: (Intercept), avar, cvar (this part is eliminated when cvar = NULL), emm_ac_mreg (this part is eliminated when emm_ac_mreg = NULL).

Aliases
beta_hat
Usage
beta_hat(mreg, mreg_fit, avar, cvar, emm_ac_mreg = NULL)
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit object for mreg (mediator model).
avar
A character vector of length 1. Treatment variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
Value
A named numeric vector of coefficients.
calc_myreg
Return mediation analysis functions given mediator and outcome models specifications.
CRAN · 1.0.2 · regmedint/man/calc_myreg.Rd · 2026-05-07

This function returns functions that can be used to calculate the causal effect measures, given the mediator model fit (mreg_fit) and the outcome model fit (yreg_fit).

Aliases
calc_myreg
Usage
calc_myreg( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit from fit_mreg
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit from fit_yreg
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A list containing two functions. The first is for calculating point estimates. The second is for calculating the correspoding
calc_myreg_mreg_linear_yreg_linear
Create calculators for effects and se (mreg linear / yreg linear)
CRAN · 1.0.2 · regmedint/man/calc_myreg_mreg_linear_yreg_linear.Rd · 2026-05-07

Construct functions for the conditional effect estimates and their standard errors in the mreg linear / yreg linear setting. Internally, this function deconstructs model objects and feeds parameter estiamtes to the internal worker functions calc_myreg_mreg_linear_yreg_linear_est and calc_myreg_mreg_linear_yreg_linear_se.

Aliases
calc_myreg_mreg_linear_yreg_linear
Usage
calc_myreg_mreg_linear_yreg_linear( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit from fit_mreg
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit from fit_yreg
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A list containing a function for effect estimates and a function for corresponding standard errors.
calc_myreg_mreg_linear_yreg_logistic
Create calculators for effects and se (mreg linear / yreg logistic)
CRAN · 1.0.2 · regmedint/man/calc_myreg_mreg_linear_yreg_logistic.Rd · 2026-05-07

Construct functions for the conditional effect estimates and their standard errors in the mreg linear / yreg logistic setting. Internally, this function deconstructs model objects and feeds parameter estimates to the internal worker functions calc_myreg_mreg_linear_yreg_logistic_est and calc_myreg_mreg_linear_yreg_logistic_se.

Aliases
calc_myreg_mreg_linear_yreg_logistic
Usage
calc_myreg_mreg_linear_yreg_logistic( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit from fit_mreg
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit from fit_yreg
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A list containing a function for effect estimates and a function for corresponding standard errors.
calc_myreg_mreg_logistic_yreg_linear
Create calculators for effects and se (mreg logistic / yreg linear)
CRAN · 1.0.2 · regmedint/man/calc_myreg_mreg_logistic_yreg_linear.Rd · 2026-05-07

Construct functions for the conditional effect estimates and their standard errors in the mreg logistic / yreg linear setting. Internally, this function deconstructs model objects and feeds parameter estimates to the internal worker functions calc_myreg_mreg_logistic_yreg_linear_est and calc_myreg_mreg_logistic_yreg_linear_se.

Aliases
calc_myreg_mreg_logistic_yreg_linear
Usage
calc_myreg_mreg_logistic_yreg_linear( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit from fit_mreg
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit from fit_yreg
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A list containing a function for effect estimates and a function for corresponding standard errors.
calc_myreg_mreg_logistic_yreg_logistic
Create calculators for effects and se (mreg logistic / yreg logistic)
CRAN · 1.0.2 · regmedint/man/calc_myreg_mreg_logistic_yreg_logistic.Rd · 2026-05-07

Construct functions for the conditional effect estimates and their standard errors in the mreg logistic / yreg logistic setting. Internally, this function deconstructs model objects and feeds parameter estimates to the internal worker functions calc_myreg_mreg_logistic_yreg_logistic_est and calc_myreg_mreg_logistic_yreg_logistic_se.

Aliases
calc_myreg_mreg_logistic_yreg_logistic
Usage
calc_myreg_mreg_logistic_yreg_logistic( mreg, mreg_fit, yreg, yreg_fit, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, interaction )
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
mreg_fit
Model fit from fit_mreg
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit from fit_yreg
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A list containing a function for effect estimates and a function for corresponding standard errors.
coef.regmedint
Extract point estimates.
CRAN · 1.0.2 · regmedint/man/coef.regmedint.Rd · 2026-05-07

Extract point estimates evaluated at a0, a1, m_cde, and c_cond.

Aliases
coef.regmedint
Usage
coefregmedint(object, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, ...)
Arguments
object
An object of the regmedint class.
a0
A numeric vector of length 1
a1
A numeric vector of length 1
m_cde
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.
c_cond
A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.
...
For compatibility with the generic. Ignored.
Value
A numeric vector of point estimates.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) coef(regmedint_obj) ## Evaluate at different values coef(regmedint_obj, m_cde = 0, c_cond = 1)
coef.summary_regmedint
Extract the result matrix from a summary_regmedint object.
CRAN · 1.0.2 · regmedint/man/coef.summary_regmedint.Rd · 2026-05-07

Extract the result matrix from a summary_regmedint object.

Aliases
coef.summary_regmedint
Usage
coefsummary_regmedint(object, ...)
Arguments
object
An object with a class of summary_regmedint.
...
For compatibility with the generic.
Value
A matrix populated with results.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) coef(summary(regmedint_obj))
confint.regmedint
Confidence intervals for mediation prameter estimates.
CRAN · 1.0.2 · regmedint/man/confint.regmedint.Rd · 2026-05-07

Construct Wald approximate confidence intervals for the quantities of interest.

Aliases
confint.regmedint
Usage
confintregmedint( object, parm = NULL, level = 0.95, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, ... )
Arguments
object
An object of the regmedint class.
parm
For compatibility with generic. Ignored.
level
A numeric vector of length one. Requested confidence level. Defaults to 0.95.
a0
A numeric vector of length 1
a1
A numeric vector of length 1
m_cde
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.
c_cond
A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.
...
For compatibility with generic.
Value
A numeric matrix of the lower limit and upper limit.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) confint(regmedint_obj) ## Evaluate at different values confint(regmedint_obj, m_cde = 0, c_cond = 1) ## Change confidence level confint(regmedint_obj, m_cde = 0, c_cond = 1, level = 0.99)
fit_mreg
Fit a model for the mediator given the treatment and covariates.
CRAN · 1.0.2 · regmedint/man/fit_mreg.Rd · 2026-05-07

lm is called if mreg = "linear". glm is called with family = binomial() if mreg = "logistic".

Aliases
fit_mreg
Usage
fit_mreg(mreg, data, avar, mvar, cvar, emm_ac_mreg = NULL)
Arguments
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
data
Data frame containing the following relevant variables.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
Value
A regression object of class lm (linear) or glm (logistic)
fit_yreg
Fit a model for the outcome given the treatment, mediator, and covariates.
CRAN · 1.0.2 · regmedint/man/fit_yreg.Rd · 2026-05-07

The outcome model type yreg can be one of the following "linear", "logistic", "loglinear" (implemented as modified Poisson), "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".

Aliases
fit_yreg
Usage
fit_yreg( yreg, data, yvar, avar, mvar, cvar, emm_ac_yreg = NULL, emm_mc_yreg = NULL, eventvar, interaction )
Arguments
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
data
Data frame containing the following relevant variables.
yvar
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
eventvar
An character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Details
The outcome regression functions to be called are the following: "linear" lm "logistic" glm "loglinear" glm (modified Poisson) "poisson" glm "negbin" [MASS]glm.nb "survCox" [survival]coxph "survAFT_exp" [survival]survreg "survAFT_weibull" [survival]survreg
Value
Model fit object from on of the above regression functions.
grad_prop_med_yreg_linear
Calculate the gradient of the proportion mediated for yreg linear.
CRAN · 1.0.2 · regmedint/man/grad_prop_med_yreg_linear.Rd · 2026-05-07

Calculate the gradient of the proportion mediated for yreg linear case.

Aliases
grad_prop_med_yreg_linear
Usage
grad_prop_med_yreg_linear(pnde, tnie)
Arguments
pnde
A numeric vector of length one. Pure natural direct effect.
tnie
A numeric vector of length one. Total natural indirect effect.
Value
A numeric vector of length two. Gradient of the proportion mediated with respect to pnde and tnie.
grad_prop_med_yreg_logistic
Calculate the gradient of the proportion mediated for yreg logistic.
CRAN · 1.0.2 · regmedint/man/grad_prop_med_yreg_logistic.Rd · 2026-05-07

Calculate the gradient of the proportion mediated for yreg logistic case.

Aliases
grad_prop_med_yreg_logistic
Usage
grad_prop_med_yreg_logistic(pnde, tnie)
Arguments
pnde
A numeric vector of length one. Pure natural direct effect.
tnie
A numeric vector of length one. Total natural indirect effect.
Value
A numeric vector of length two. Gradient of the proportion mediated with respect to pnde and tnie.
new_regmedint
Low level constructor for a regmedint S3 class object.
CRAN · 1.0.2 · regmedint/man/new_regmedint.Rd · 2026-05-07

This is not a user function and meant to be executed within the regmedint function after validatingthe arguments.

Aliases
new_regmedint
Usage
new_regmedint( data, yvar, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, eventvar, a0, a1, m_cde, c_cond, yreg, mreg, interaction, casecontrol )
Arguments
data
Data frame containing the following relevant variables.
yvar
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
eventvar
An character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.
a0
A numeric vector of length 1. The reference level of treatment variable that is considered "untreated" or "unexposed".
a1
A numeric vector of length 1.
m_cde
A numeric vector of length 1. Mediator level at which controlled direct effect is evaluated at.
c_cond
A numeric vector of the same length as cvar. Covariate levels at which natural direct and indirect effects are evaluated at.
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
casecontrol
A logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.
Value
A regmedint object.
print.regmedint
print method for regmedint object
CRAN · 1.0.2 · regmedint/man/print.regmedint.Rd · 2026-05-07

Print the mreg_fit, yreg_fit, and the mediation analysis effect estimates.

Aliases
print.regmedint
Usage
printregmedint( x, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, args_mreg_fit = list(), args_yreg_fit = list(), ... )
Arguments
x
An object of the regmedint class.
a0
A numeric vector of length 1
a1
A numeric vector of length 1
m_cde
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.
c_cond
A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.
args_mreg_fit
A named list of argument to be passed to the method for the mreg_fit object.
args_yreg_fit
A named list of argument to be passed to the method for the mreg_fit object.
...
For compatibility with the generic. Ignored.
Value
Invisibly return the regmedint class object as is.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) ## Implicit printing regmedint_obj ## Explicit printing print(regmedint_obj) ## Evaluate at different values print(regmedint_obj, m_cde = 0, c_cond = 1)
print.summary_regmedint
Print method for summary objects from summary.regmedint
CRAN · 1.0.2 · regmedint/man/print.summary_regmedint.Rd · 2026-05-07

Print results contained in a summary_regmedint object with additional explanation regarding the evaluation settings.

Aliases
print.summary_regmedint
Usage
printsummary_regmedint(x, ...)
Arguments
x
An object of the class summary_regmedint.
...
For compatibility with the generic function.
Value
Invisibly return the first argument.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) ## Implicit printing summary(regmedint_obj) ## Explicit printing print(summary(regmedint_obj))
prop_med_yreg_linear
Calculate the proportion mediated for yreg linear.
CRAN · 1.0.2 · regmedint/man/prop_med_yreg_linear.Rd · 2026-05-07

Calculate the proportion mediated on the mean difference scale.

Aliases
prop_med_yreg_linear
Usage
prop_med_yreg_linear(pnde, tnie)
Arguments
pnde
Pure natural direct effect.
tnie
Total natural indirect effect.
Value
Proportion mediated value.
prop_med_yreg_logistic
Calculate the proportion mediated for yreg logistic.
CRAN · 1.0.2 · regmedint/man/prop_med_yreg_logistic.Rd · 2026-05-07

Calculate the approximate proportion mediated on the risk difference scale.

Aliases
prop_med_yreg_logistic
Usage
prop_med_yreg_logistic(pnde, tnie)
Arguments
pnde
Pure natural direct effect on the log scale.
tnie
Total natural indirect effect on the log scale.
Value
Proportion mediated value.
regmedint
Conduct regression-based causal mediation analysis
CRAN · 1.0.2 · regmedint/man/regmedint.Rd · 2026-05-07

This is a user-interface for regression-based causal mediation analysis as described in Valeri & VanderWeele 2013 and Valeri & VanderWeele 2015.

Aliases
regmedint
Usage
regmedint( data, yvar, avar, mvar, cvar, emm_ac_mreg = NULL, emm_ac_yreg = NULL, emm_mc_yreg = NULL, eventvar = NULL, a0, a1, m_cde, c_cond, mreg, yreg, interaction = TRUE, casecontrol = FALSE, na_omit = FALSE )
Arguments
data
Data frame containing the following relevant variables.
yvar
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
eventvar
An character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.
a0
A numeric vector of length 1. The reference level of treatment variable that is considered "untreated" or "unexposed".
a1
A numeric vector of length 1.
m_cde
A numeric vector of length 1. Mediator level at which controlled direct effect is evaluated at.
c_cond
A numeric vector of the same length as cvar. Covariate levels at which natural direct and indirect effects are evaluated at.
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
casecontrol
A logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.
na_omit
A logical vector of length 1. Default to FALSE. Whether to remove NAs in the columns of interest before fitting the models.
Value
regmedint object, which is a list containing the mediator regression object, the outcome regression object, and the regression-based mediation results.
Examples
library(regmedint) data(vv2015) regmedint_obj1 <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 3, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) summary(regmedint_obj1) regmedint_obj2 <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), emm_ac_mreg = c("c"), emm_ac_yreg = c("c"), emm_mc_yreg = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 3, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) summary(regmedint_obj2)
regmedint-package
regmedint: A package for regression-based causal mediation analysis
CRAN · 1.0.2 · package · regmedint/man/regmedint-package.Rd · 2026-05-07

The package is an R implementation of regression-based closed-form causal mediation as originally described in Valeri & VanderWeele 2013 and Valeri & VanderWeele 2015 https://hsph.harvard.edu/research/vanderweele-group/tools-and-tutorials/. The earlier version is a sister program of the SAS macro. The current extended version (version 1.0 and later) supports effect modification by covariates (treatment-covariate and mediator-covariate product terms) in mediator and outcome models.

Aliases
regmedint-package
Keywords
internal
See also
Useful links: https://kaz-yos.github.io/regmedint/ Report bugs at https://github.com/kaz-yos/regmedint/issues
Custom sections
Fitting models
Use the regmedint function to fit models and set up regression-based causal mediation analysis.
Examining results
Several methods are available to examine the regmedint object. print summary coef confint
Author
Maintainer: Yi Li yi.li10@mail.mcgill.ca (https://orcid.org/0000-0002-9359-210XORCID) Authors: Kazuki Yoshida kazukiyoshida@mail.harvard.edu (https://orcid.org/0000-0002-2030-3549ORCID) [contributor] Other contributors: Maya Mathur (https://orcid.org/0000-0001-6698-2607ORCID) [contributor]
report_missing
Report variables with missing data
CRAN · 1.0.2 · regmedint/man/report_missing.Rd · 2026-05-07

Report the number of missing observations for each variables of interest relevant for the analysis

Aliases
report_missing
Usage
report_missing(data, yvar, avar, mvar, cvar, eventvar)
Arguments
data
Data frame containing the following relevant variables.
yvar
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
eventvar
An character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.
Value
No return value, called for side effects.
summary.regmedint
summary method for regmedint object
CRAN · 1.0.2 · regmedint/man/summary.regmedint.Rd · 2026-05-07

Summarize the mreg_fit, yreg_fit, and the mediation analysis effect estimates.

Aliases
summary.regmedint
Usage
summaryregmedint( object, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, args_mreg_fit = list(), args_yreg_fit = list(), exponentiate = FALSE, level = 0.95, ... )
Arguments
object
An object of the regmedint class.
a0
A numeric vector of length 1
a1
A numeric vector of length 1
m_cde
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.
c_cond
A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.
args_mreg_fit
A named list of argument to be passed to the method for the mreg_fit object.
args_yreg_fit
A named list of argument to be passed to the method for the mreg_fit object.
exponentiate
Whether to add exponentiated point and confidence limit estimates. When yreg = "linear", it is ignored.
level
Confidence level for the confidence intervals.
...
For compatibility with the generic. Ignored.
Value
A summary_regmedint object, which is a list containing the summary objects of the mreg_fit and the yreg_fit as well as the mediation analysis results.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) ## Detailed result with summary summary(regmedint_obj) ## Add exponentiate results for non-linear outcome models summary(regmedint_obj, exponentiate = TRUE) ## Evaluate at different values summary(regmedint_obj, m_cde = 0, c_cond = 1) ## Change confidence level summary(regmedint_obj, m_cde = 0, c_cond = 1, level = 0.99)
summary.regmedint_mod_poisson
Summary with robust sandwich variance estimator for modified Poisson
CRAN · 1.0.2 · regmedint/man/summary.regmedint_mod_poisson.Rd · 2026-05-07

This is a version of summary.glm modified to use the robust variance estimator [sandwich]sandwich.

Aliases
summary.regmedint_mod_poisson
Usage
summaryregmedint_mod_poisson(object, ...)
Arguments
object
A model object of the class regmedint_mod_poisson
...
For compatibility with the generic.
Value
An object of the class summary.glm
theta_hat
Create a vector of coefficients from the outcome model (yreg)
CRAN · 1.0.2 · regmedint/man/theta_hat.Rd · 2026-05-07

This function extracts coef from yreg_fit and 3s with zeros appropriately to create a named vector consistently having the following elements: (Intercept) (a zero element is added for yreg = "survCox" for which no intercept is estimated (the baseline hazard is left unspecified)), avar, mvar, avar:mvar (a zero element is added when interaction = FALSE). cvar (this part is eliminated when cvar = NULL), emm_ac_yreg (this part is eliminated when emm_ac_yreg = NULL), emm_mc_yreg (this part is eliminated when emm_mc_yreg = NULL).

Aliases
theta_hat
Usage
theta_hat( yreg, yreg_fit, avar, mvar, cvar, emm_ac_yreg = NULL, emm_mc_yreg = NULL, interaction )
Arguments
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
yreg_fit
Model fit object for yreg (outcome model).
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
Value
A named numeric vector of coefficients.
validate_args
Validate arguments to regmedint before passing to other functions
CRAN · 1.0.2 · regmedint/man/validate_args.Rd · 2026-05-07

Internal functions (usually) do not validate arguments, thus, we need to make sure informative errors are raised when the arguments are not safe for subsequent computation.

Aliases
validate_args
Usage
validate_args( data, yvar, avar, mvar, cvar, emm_ac_mreg, emm_ac_yreg, emm_mc_yreg, eventvar, a0, a1, m_cde, c_cond, mreg, yreg, interaction, casecontrol )
Arguments
data
Data frame containing the following relevant variables.
yvar
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
avar
A character vector of length 1. Treatment variable name.
mvar
A character vector of length 1. Mediator variable name.
cvar
A character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there are usually some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.
emm_ac_mreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
emm_ac_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
emm_mc_yreg
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
eventvar
An character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.
a0
A numeric vector of length 1. The reference level of treatment variable that is considered "untreated" or "unexposed".
a1
A numeric vector of length 1.
m_cde
A numeric vector of length 1. Mediator level at which controlled direct effect is evaluated at.
c_cond
A numeric vector of the same length as cvar. Covariate levels at which natural direct and indirect effects are evaluated at.
mreg
A character vector of length 1. Mediator regression type: "linear" or "logistic".
yreg
A character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
interaction
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
casecontrol
A logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.
Value
No return value, called for side effects.
validate_regmedint
Validate soundness of a regmedint object.
CRAN · 1.0.2 · regmedint/man/validate_regmedint.Rd · 2026-05-07

Check the structure of a proposed regmedint object for soundness.

Aliases
validate_regmedint
Usage
validate_regmedint(x)
Arguments
x
A regmedint object.
Value
No return value, called for side effects.
vcov.regmedint
Extract variance estimates in the vcov form.
CRAN · 1.0.2 · regmedint/man/vcov.regmedint.Rd · 2026-05-07

Extract variance estimates evaluated at a0, a1, m_cde, and c_cond.

Aliases
vcov.regmedint
Usage
vcovregmedint(object, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, ...)
Arguments
object
An object of the regmedint class.
a0
A numeric vector of length 1
a1
A numeric vector of length 1
m_cde
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint will be used. Only the CDE is affected.
c_cond
A numeric vector of the same length as cvar. A set of covariate values at which the conditional natural effects are evaluated.
...
For compatibility with the generic. Ignored.
Value
A numeric matrix with the diagonals populated with variance estimates. Off-diagnonals are NA since these are not estimated.
Examples
library(regmedint) data(vv2015) regmedint_obj <- regmedint(data = vv2015, ## Variables yvar = "y", avar = "x", mvar = "m", cvar = c("c"), eventvar = "event", ## Values at which effects are evaluated a0 = 0, a1 = 1, m_cde = 1, c_cond = 0.5, ## Model types mreg = "logistic", yreg = "survAFT_weibull", ## Additional specification interaction = TRUE, casecontrol = FALSE) vcov(regmedint_obj) ## Evaluate at different values vcov(regmedint_obj, m_cde = 0, c_cond = 1)
vcov.regmedint_mod_poisson
Robust sandwich variance estimator for modified Poisson
CRAN · 1.0.2 · regmedint/man/vcov.regmedint_mod_poisson.Rd · 2026-05-07

Provide robust sandwich variance-covariance estimate using [sandwich]sandwich.

Aliases
vcov.regmedint_mod_poisson
Usage
vcovregmedint_mod_poisson(object, ...)
Arguments
object
A model object of the class regmedint_mod_poisson
...
For compatibility with the generic.
Value
A variance-covariance matrix using the [sandwich]sandwich.
vv2015
Example dataset from Valeri and VanderWeele 2015.
CRAN · 1.0.2 · data · regmedint/man/vv2015.Rd · 2026-05-07

An example dataset from Valeri and VanderWeele (2015) <doi:10.1097/EDE.0000000000000253>.

Aliases
vv2015
Keywords
datasets
Usage
vv2015
Format
A tibble with 100 rows and 7 variables: idPositive integer id. xBinary treatment assignment variable. mBinary mediator variable. yTime to event outcome variable. censBinary censoring indicator. Censored is 1. cContinuous confounder variable. eventBinary event indicator. Event is 1.
Source
https://hsph.harvard.edu/research/vanderweele-group/tools-and-tutorials/

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN1.0.22026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.