hmodelBUGS: Bayesian general linear regression analysis of current trial...

Description Usage Arguments Value Examples

Description

hmodelBUGS returns posterior samples of treatment effect

Usage

1
2
hmodelBUGS(hData, hForm, file.dir, file.name, file.rm = F, OpenBUGS.dir,
  OpenBUGS.seed = 1, family, nchain, niter, nburnin, nthin)

Arguments

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.

Value

The posterior samples of treatment effect

Examples

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)

shanRpackage/pprincrt documentation built on May 23, 2019, 1:11 p.m.