# NOT RUN {
data(transplant)
delta <- (as.numeric(transplant$event)-1)
delta[delta==1] <- 4
delta[delta==2] <- 1
delta[delta>1] <- 2
table(delta, transplant$event)
table(1+floor(transplant$futime/30.5)) ## months
times <- 1+floor(transplant$futime/30.5)
typeO <- 1*(transplant$abo=='O')
typeA <- 1*(transplant$abo=='A')
typeB <- 1*(transplant$abo=='B')
typeAB <- 1*(transplant$abo=='AB')
table(typeA, typeO)
x.train <- cbind(typeO, typeA, typeB, typeAB)
N <- nrow(x.train)
x.test <- x.train
x.test[1:N, 1:4] <- matrix(c(1, 0, 0, 0), nrow=N, ncol=4, byrow=TRUE)
pre <- crisk.pre.bart(x.train=x.train, times=times, delta=delta, x.test=x.test)
# }
Run the code above in your browser using DataLab