sim_barfield | R Documentation |
Simulate & test mediation methods as in Barfield et al. (2017). If multiple genes are simulated, only 1st
is tested. For each simulation, count proportion of p-values < alpha
, and at end calculate mean proportion.
sim_barfield(
med.fnm,
b1t2.v = c(0, 0.14, 0.39),
t1 = 0.59,
alpha = 0.05,
nsamp = 50,
nsim = 10^4,
ngene = 0,
seed = 0,
verbose = TRUE,
...
)
med.fnm |
Quoted name of mediation function to test. The function must accept parameters and output matrix
with mediation p-value in column |
b1t2.v |
Numeric vector of values that both theta2 ( |
t1 |
Numeric value of theta2 i.e. the effect of the exposure on the outcome. |
alpha |
Alpha level. |
nsamp |
Number of samples. |
nsim |
Number of simulations. |
ngene |
Number of genes other than that of primary interest to simulate. |
seed |
Random seed for reproducibility. |
verbose |
Logical; should the number of simulations be printed every 100 simulations? |
... |
Sent to |
Matrix with proportion of significant calls for every combination of t2
and b1
.
Barfield R, Shen J, Just AC, Vokonas PS, Schwartz J, Baccarelli AA, VanderWeele TJ, Lin X. Testing for the indirect effect under the null for genome-wide mediation analyses. Genet Epidemiol. 2017 Dec;41(8):824-833.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.