bzCallStan: Call STAN models

Description Usage Arguments Value Examples

Description

Call STAN to draw posterior samples for Bayesian HTE models.

Usage

1
2
3
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),
  var.nom = NULL, delta = 0, prior.sig = 1, chains = 4, ...)

Arguments

mdls

name of the Bayesian HTE model. The options are:

nse

No subgroup effect model

fs

Full stratification model

sr

Simple regression model

bs

Basic shrinkage model

srs

Simple regression with shrinkage model

ds

Dixon-Simon model

eds

Extended Dixon-Simon model

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 beanz-package for the details of model specification.

nse, fs

B

sr

B, C

bs, ds, eds

B, D

srs

B, C, D

var.nom

array of column names in dat.sub that corresponds to nominal baseline covariates

delta

parameter for specifying the informative priors of σ_g

prior.sig

option for the informative prior on σ_g. 0: uniform prior and 1: log-normal prior

chains

STAN options. Number of chains.

...

options to call STAN sampling. These options include iter, warmup, thin, algorithm. See rstan::sampling for details.

Value

A class beanz.stan list containing

mdl

name of the Bayesian HTE model

stan.rst

raw rstan sampling results

smps

matrix of the posterior samples

get.mus

method to return the posterior sample of the subgroup treatment effects

DIC

DIC value

looic

leave-one-out cross-validation information criterion

rhat

Gelman and Rubin potential scale reduction statistic

prior.sig

option for the informative prior on σ_g

delta

parameter for specifying the informative priors of σ_g

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## 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),
                         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)

beanz documentation built on May 2, 2019, 4:01 a.m.