stan.logisticmodeltrans {BayesianPlatformDesignTimeTrend}R Documentation

stan.logisticmodeltrans

Description

This function transform the data in trial simulation to the data required for stan modelling

Usage

stan.logisticmodeltrans(
  z,
  y,
  randomprob,
  group_indicator,
  armleft,
  group,
  variable.inf,
  reg.inf
)

Arguments

z

A vector of all treatment index data from the beginning of a trial

y

A vector of all outcome data from the beginning of a trial

randomprob

A named vector of randomisation probability to each arm

group_indicator

A vector for the stage at which each patient was treated

armleft

The number of treatment left in the platform (>2)

group

The current stage

variable.inf

Fixeffect/Mixeffect for logistic model parameter

reg.inf

The information of how much accumulated information will be used

Value

A list of information require for the stan model including: zdropped: The vector of treatment index for each patient whose treatment arm is active at current stage. ydropped: The vector of outcome index for each patient whose treatment arm is active at current stage. Ndropped: The total number of patients that are treated with active treatment arms at current stage. group_indicator_dropped: The vector of stage index for each patient whose treatment arm is active at current stage. zlevel: The active treatment arm index at current stage xdummy: A design matrix transformed from zdropped and group_indicator_dropped for modelling

Author(s)

Ziyan Wang

Examples

stan.logisticmodeltrans(
z = c(1,2,1,2,2,1,2,1),
y = c(0,0,0,0,1,1,1,1),
randomprob = matrix(c( 0.5, 0.5), ncol = 2, dimnames = list(c("Stage1"), c("1", "2"))),
group_indicator = c(1,1,1,1,1,1,1,1),
armleft = 2,
group = 1,
variable.inf = "Fixeffect",
reg.inf = "main")

[Package BayesianPlatformDesignTimeTrend version 1.2.3 Index]