add.mcmc {bipd} | R Documentation |
Convenient function to add results (i.e. combine mcmc.list)
Description
This is a convenient function to add results (i.e. combine mcmc.list). This can be useful when combining results obtained from multiple imputation
Usage
add.mcmc(x, y)
Arguments
x |
first result in a format of mcmc.list |
y |
second result in a format of mcmc.list |
Examples
ds <- generate_ipdma_example(type = "continuous")
ds2 <- generate_ipdma_example(type = "continuous")
ipd <- with(ds, ipdma.model.onestage(y = y, study = studyid, treat = treat, X = cbind(z1, z2),
response = "normal", shrinkage = "none"))
ipd2 <- with(ds2, ipdma.model.onestage(y = y, study = studyid, treat = treat, X = cbind(z1, z2),
response = "normal", shrinkage = "none"))
samples <- ipd.run(ipd, pars.save = c("beta", "gamma", "delta"), n.chains = 3, n.burnin = 500,
n.iter = 5000)
samples2 <- ipd.run(ipd2, pars.save = c("beta", "gamma", "delta"), n.chains = 3, n.burnin = 500,
n.iter = 5000)
combined <- add.mcmc(samples, samples2)
[Package bipd version 0.3 Index]