PieceMCMC {Phase123} | R Documentation |
Returns posterior distribution for key mixture model parameters
Description
This function performs MCMC with Metropolis-Hastings-Green steps for the baseline hazard function and is used in the functions Reoptimize, SimPhase123 and SimPhase3.
Usage
PieceMCMC(Y, I, YE, YT, Doses, Dose, B, prob, MaxObs)
Arguments
Y |
Patient survival or followup times. |
I |
Patient event indicators. |
YE |
Vector of indicators for patient efficacy. |
YT |
Vector of indicators for patient toxicity. |
Doses |
Vector of standardized doses given to patients. |
Dose |
Vector of standardized doses considered in trial. |
B |
Number of iterations to perform in MCMC. |
prob |
length(Doses) X 4 matrix containing the estimated posterior probabilities for each dose and each (Efficacy, Toxicity) outcomes. |
MaxObs |
length(Doses) X 4 matrix containing the maximum observed survival time we want to evaluate the means to. |
Value
Returns a list containing a matrix of posterior means for each dose, regression coefficients in the cox models, locations of the split points, log hazard heights on each interval, and the number of intervals in the baseline hazard.
Examples
n=100
Y=rexp(n,1)
I = rbinom(n,1,.9)
YE = rbinom(n,1,.5)
YT = rbinom(n,1,.5)
Dose = c(1,2,3,3.5,5)
Dose=(Dose-mean(Dose))/sd(Dose)
Doses = sample(1:5,n,replace=TRUE)
Doses=Dose[Doses]
B=2000
MaxObs = matrix(rep(0,length(Dose)*4),nrow=4)
prob=matrix(rep(0,length(Dose)*4),ncol=4)
prob=prob+1/4
MaxObs=MaxObs+max(Y)
G=PieceMCMC(Y,I,YE,YT,Doses,Dose,B,prob,MaxObs)