Important
For more details, please refer to our preprint Speeding up interval estimation for R2-based mediation effect of high-dimensional mediators via cross-fitting (Xu et al). For the code used to perform simulations or real data analysis in the paper, please refer to CFR2M-paper.
The CFR2M R
package constructs confidence intervals based on the newly-derived closed-form asymptotic distribution of the R-squared measure.
To avoid potential bias, we perform iterative Sure Independence Screening (iSIS) and False Discovery Rate (FDR) control in two subsamples to exclude the non-mediators, followed by ordinary least squares (OLS) regressions for the variance estimation.
- Download CFR2M package from Github using:
git clone https://github.com/zhichaoxu04/CFR2M.git
-
Or, install CFR2M package in R directly
-
Make sure that all the required packages have been installed or updated. Here are some of the required packages:
- RsqMed: An implementation of calculating the R-squared measure as a total mediation effect size measure and its confidence interval for moderate- or high-dimensional mediator models. It gives an option to filter out non-mediators using variable selection methods. The original R package is directly related to the paper Yang et al (2021).
- SIS: Variable selection techniques are essential tools for model selection and estimation in high-dimensional statistical models. Through this publicly available package, they provide a unified environment to carry out variable selection using iterative sure independence screening (SIS) (Fan and Lv (2008)) and all of its variants in generalized linear models (Fan and Song (2009)) and the Cox proportional hazards model (Fan, Feng and Wu (2010)).
- HDMT: A multiple-testing procedure for high-dimensional mediation hypotheses. Mediation analysis is of rising interest in epidemiology and clinical trials. Methods used in the package refer to James Y. Dai, Janet L. Stanford & Michael LeBlanc (2020).
- dplyr: A Grammar of Data Manipulation: a fast, consistent tool for working with data frame like objects, both in memory and out of memory.