Description Usage Arguments Value Examples
hmodelBUGS
returns posterior samples of treatment effect
1 2 | hmodelBUGS(hData, hForm, file.dir, file.name, file.rm = F, OpenBUGS.dir,
OpenBUGS.seed = 1, family, nchain, niter, nburnin, nthin)
|
hData |
historical trial data. It should be in a data frame. |
hForm |
model for historical trial data. It should be a formula object. |
file.dir |
directory to save model BUGS file and input and output files of OpenBUGS. |
file.name |
the name of the model BUGS file. |
file.rm |
whether to remove all files after Bayesian computations are done. |
OpenBUGS.dir |
directory to install OpenBUGS package. |
OpenBUGS.seed |
the random number generator state of OpenBUGS. |
family |
outcome distribution. |
nchain |
number of MCMC chains. |
niter |
length of MCMC chain. |
nburnin |
burnin period of MCMC chain. |
nthin |
thinning rate of MCMC chain. |
The posterior samples of treatment effect
1 2 3 4 5 6 7 8 9 | ## Not run:
#' my historical data;
my.hData <- data.frame(y=rbinom(3,50,0.5),n=rep(50,3),x=c(1,2,3))
my.hsample <- hmodelBUGS(hData=my.hData,hForm=y|n ~ x,
file.dir=tempdir(),file.name='hmodelfile',file.rm=T, OpenBUGS.dir=NULL,
OpenBUGS.seed=14, family="binomial",nchain=2,niter=5000,nburnin=2500,nthin=5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.