bzPredSubgrp: Predictive Distribution

Description Usage Arguments Value Examples

Description

Get the predictive distribution of the subgroup treatment effects

Usage

1
bzPredSubgrp(stan.rst, dat.sub, var.estvar)

Arguments

stan.rst

a class beanz.stan object generated by bzCallStan

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

Value

A dataframe of predicted subgroup treament effects. That is, the distribution of

θ_g | \widehat{θ}_1, \widehat{σ}^2_1, …, \widehat{θ}_G, \widehat{σ}^2_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
## 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 <- bzGetSubgrp(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=4000,
                         warmup=2000, thin=2, seed=1000);

pred.effect <- bzPredSubgrp(rst.nes,
                            dat.sub = solvd.sub,
                            var.estvar = var.estvar);
## End(Not run)

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