Call STAN to draw posterior samples for Bayesian HTE models.
bzCallStan(
mdls = c("nse", "fs", "sr", "bs", "srs", "ds", "eds"),
dat.sub,
var.estvar,
var.cov,
par.pri = c(B = 1000, C = 1000, D = 1, MU = 0),
var.nom = NULL,
delta = 0,
prior.sig = 1,
chains = 4,
...
)
A class beanz.stan
list containing
name of the Bayesian HTE model
raw rstan
sampling
results
matrix of the posterior samples
method to return the posterior sample of the subgroup treatment effects
DIC value
leave-one-out cross-validation information criterion
Gelman and Rubin potential scale reduction statistic
option for the informative prior on
parameter for specifying the informative priors of
name of the Bayesian HTE model. The options are:
No subgroup effect model
Full stratification model
Simple regression model
Basic shrinkage model
Simple regression with shrinkage model
Dixon-Simon model
Extended Dixon-Simon model
dataset with subgroup treatment effect summary data
column names in dat.sub that corresponds to treatment effect estimation and the estimated variance
array of column names in dat.sub that corresponds to binary or ordinal baseline covariates
vector of prior parameters for each model. See
beanz-package
for the details of model specification.
B
B
, C
B
, D
B
, C
, D
MU
array of column names in dat.sub that corresponds to nominal baseline covariates
parameter for specifying the informative priors of
option for the informative prior on
STAN options. Number of chains.
options to call STAN sampling. These options include
iter
, warmup
, thin
, algorithm
.
See rstan::sampling
for details.
if (FALSE) {
var.cov <- c("sodium", "lvef", "any.vasodilator.use");
var.resp <- "y";
var.trt <- "trt";
var.censor <- "censor";
resptype <- "survival";
var.estvar <- c("Estimate", "Variance");
subgrp.effect <- bzGetSubgrpRaw(solvd.sub,
var.resp = var.resp,
var.trt = var.trt,
var.cov = var.cov,
var.censor = var.censor,
resptype = resptype);
rst.nse <- bzCallStan("nse", dat.sub=subgrp.effect,
var.estvar = var.estvar, var.cov = var.cov,
par.pri = c(B=1000, MU = 0),
chains=4, iter=600,
warmup=200, thin=2, seed=1000);
rst.sr <- bzCallStan("sr", dat.sub=subgrp.effect,
var.estvar=var.estvar, var.cov = var.cov,
par.pri=c(B=1000, C=1000),
chains=4, iter=600,
warmup=200, thin=2, seed=1000);}
Run the code above in your browser using DataLab