Version: 1.0.0
Copyrights reserved by:
First author (creator): Zhou Tianbao (Michael Zhou) michaelzhou\@buaa.edu.cn{.email}, \<ORCID: 0000-0001-6782-626X>;
Second author (advisor): Li Xinghao lixinghao\@bjfu.edu.cn{.email};
Corresponding author (supervisor): Liu Lin*, liulin\@pku.edu.cn{.email}
Institution: School of Government, Peking University, Beijing, China.
This package realizes a universal estimation approach that accommodates multi-category variables and effect scales, making up for the deficiencies of the existing approaches when dealing with non-binary exposures and complex models. The estimation via bootstrapping can simultaneously provide results of causal mediation on RD, OR and RR scales with tests of the effects' difference. The estimation is also applicable to many other settings, e.g., moderated mediation, inconsistent covariates, panel data, etc. The high flexibility and compatibility make it possible to apply for any type of model, greatly meeting the needs of current empirical researches.
Users can install the development version of package "unvs.med" through R code:
install.packages("unvs.med")
This is an example based on the test data which shows you how to estimate causal mediation effects through this package:
library(unvs.med)
data(testdata)
# Fitting mediator's model
med_model=glm(med~exp+C1+C2+C3, data=testdata, family=binomial)
# Fitting outcome's model
out_model=lm(out~med*exp+C1+C2+C3, data=testdata)
# Running formal estimation via bootstrapping
r11 = FormalEstmed (med_model=med_model, out_model=out_model,
data=testdata, exposure = "exp")
# Viewing results in short form and on RD scales
summary(r11)
## Plot of PNED and TNDE on RD scales
plot(r11)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.