if (requireNamespace("rstan", quietly = TRUE)) {
dat <- mvmr_format(
rsid = dodata$rsid,
xbeta = cbind(dodata$ldlcbeta,dodata$hdlcbeta,dodata$tgbeta),
ybeta = dodata$chdbeta,
xse = cbind(dodata$ldlcse,dodata$hdlcse,dodata$tgse),
yse = dodata$chdse
)
suppressWarnings(mvivw_fit <- mvmr_ivw_stan(dat, refresh = 0L))
print(mvivw_fit)
rstan::traceplot(mvivw_fit)
}
Run the code above in your browser using DataLab