# -----------------------------
# Example inputs
# -----------------------------
# Event time vectors
TIME_1 <- c(256,44,29,186,29,80,11,380,102,33)
TIME_2 <- c(128,44,95,186,69,66,153,380,117,33)
TIME_3 <- c(435,44,95,186,69,270,1063,380,117,33)
# Event time matrix
Time <- rbind(TIME_1, TIME_2, TIME_3)
# Event indicator vectors
DELTA_1 <- c(1,0,1,0,1,1,1,0,1,0)
DELTA_2 <- c(1,0,0,0,0,1,1,0,0,0)
DELTA_3 <- c(0,0,0,0,0,0,0,0,0,0)
# Event indicator matrix
Delta <- rbind(DELTA_1, DELTA_2, DELTA_3)
# Treatment arm indicator vector
trt <- c(1,1,1,1,1,0,0,0,0,0)
# Number of control arm patients
n0 <- sum(trt == 0)
# Number of treatment arm patients
n1 <- sum(trt == 1)
# Number of events in the hierarchy
m <- nrow(Time)
# -------------------------
# markov Examples
# -------------------------
z <- markov(n0, n1, m, Time, Delta)
print(z)
Run the code above in your browser using DataLab