Implementation of formulas

## knitr configuration: http://yihui.name/knitr/options#chunk_options
library(knitr)
showMessage <- FALSE
showWarning <- TRUE
set_alias(w = "fig.width", h = "fig.height", res = "results")
opts_chunk$set(comment = "##", error= TRUE, warning = showWarning, message = showMessage,
               tidy = FALSE, cache = FALSE, echo = TRUE,
               fig.width = 7, fig.height = 7,
               fig.path = "man/figures")

The bodies of the following functions contain the R implementation of the formulas in V2015. Although many models are covered, there are only four patterns. See the package top page for further references. The code seen here is compacted and lacks the comments. For more redable code, please refer to the Github repo and search for the function names without the preceding regmedint:::. For the type-set mathematical expressions and LaTeX source, please see the supplement.

mreg linear yreg linear (V2015 p466 Proposition 2.3)

These functions are only used in the setting where both the mediator model and the outcome model are linear regression.

Point estimates

regmedint:::calc_myreg_mreg_linear_yreg_linear_est

Standard error estimates

regmedint:::calc_myreg_mreg_linear_yreg_linear_se

mreg linear yreg non-linear (V2015 p468 Proposition 2.4)

These functions are used in all cases where the mediator model is linear regression and the outcome model is any one of the non-linear models.

Point estimates

regmedint:::calc_myreg_mreg_linear_yreg_logistic_est

Standard error estimates

regmedint:::calc_myreg_mreg_linear_yreg_logistic_se

mreg logistic yreg linear (V2015 p471 Proposition 2.5)

These functions are only used in the setting where the mediator model is logistic regression and the outcome model is non-linear regression.

Point estimates

regmedint:::calc_myreg_mreg_logistic_yreg_linear_est

Standard error estimates

regmedint:::calc_myreg_mreg_logistic_yreg_linear_se

mreg logistic yreg non-linear (V2015 p473 Proposition 2.6)

These functions are used in all cases where the mediator model is logistic regression and the outcome model is any one of the non-linear models.

Point estimates

regmedint:::calc_myreg_mreg_logistic_yreg_logistic_est

Standard error estimates

regmedint:::calc_myreg_mreg_logistic_yreg_logistic_se

Bibliography



Try the regmedint package in your browser

Any scripts or data that you put into this service are public.

regmedint documentation built on April 7, 2022, 1:17 a.m.