bzCallStan | R Documentation |
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,
...
)
mdls |
name of the Bayesian HTE model. The options are:
|
dat.sub |
dataset with subgroup treatment effect summary data |
var.estvar |
column names in dat.sub that corresponds to treatment effect estimation and the estimated variance |
var.cov |
array of column names in dat.sub that corresponds to binary or ordinal baseline covariates |
par.pri |
vector of prior parameters for each model. See
|
var.nom |
array of column names in dat.sub that corresponds to nominal baseline covariates |
delta |
parameter for specifying the informative priors of |
prior.sig |
option for the informative prior on |
chains |
STAN options. Number of chains. |
... |
options to call STAN sampling. These options include
|
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 \sigma_g
parameter for specifying the informative priors of \sigma_g
## Not run:
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);
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.