View source: R/mr_radialegger_stan.R
mr_radialegger_stan | R Documentation |
Bayesian inverse variance weighted model with a choice of prior distributions fitted using RStan
mr_radialegger_stan(
data,
prior = 1,
n.chains = 3,
n.burn = 1000,
n.iter = 5000,
rho = 0.5,
seed = 12345,
...
)
data |
A data of class |
prior |
An integer for selecting the prior distributions;
|
n.chains |
Numeric indicating the number of chains used in the HMC estimation in rstan, the default is |
n.burn |
Numeric indicating the burn-in period of the Bayesian HMC estimation. The default is |
n.iter |
Numeric indicating the number of iterations in the Bayesian HMC estimation. The default is |
rho |
Numeric indicating the correlation coefficient input into the joint prior distribution. The default is |
seed |
Numeric indicating the random number seed. The default is |
... |
Additional arguments passed through to |
An object of class rstan::stanfit
.
Bowden, J., et al., Improving the visualization, interpretation and analysis of two-sample summary data Mendelian randomization via the Radial plot and Radial regression. International Journal of Epidemiology, 2018. 47(4): p. 1264-1278. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/ije/dyy101")}.
Stan Development Team (2020). "RStan: the R interface to Stan." R package version 2.19.3, https://mc-stan.org/.
if (requireNamespace("rstan", quietly = TRUE)) {
# Note we recommend setting n.burn and n.iter to larger values
suppressWarnings({
radegger_fit <- mr_radialegger_stan(bmi_insulin, n.burn = 500, n.iter = 1000, refresh = 0L)
})
print(radegger_fit)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.