# NOT RUN {
library(riAFTBART)
lp_w_all <-
c(".4*x1 + .1*x2 - .1*x4 + .1*x5", # w = 1
".2 * x1 + .2 * x2 - .2 * x4 - .3 * x5") # w = 2
nlp_w_all <-
c("-.5*x1*x4 - .1*x2*x5", # w = 1
"-.3*x1*x4 + .2*x2*x5")# w = 2
lp_y_all <- rep(".2*x1 + .3*x2 - .1*x3 - .1*x4 - .2*x5", 3)
nlp_y_all <- rep(".7*x1*x1 - .1*x2*x3", 3)
X_all <- c(
"rnorm(1000, 0, 0.5)",# x1
"rbeta(1000, 2, .4)", # x2
"runif(1000, 0, 0.5)",# x3
"rweibull(1000,1,2)", # x4
"rbinom(1000, 1, .4)"# x5
)
set.seed(111111)
data <- dat_sim(
nK = 20,
K = 50,
n_trt = 3,
X = X_all,
eta = 2,
lp_y = lp_y_all,
nlp_y = nlp_y_all,
align = FALSE,
lp_w = lp_w_all,
nlp_w = nlp_w_all,
lambda = c(1000,2000,3000),
delta = c(0.5,0.5),
psi = 1,
sigma_w = 1,
sigma_y = 2,
censor_rate = 0.1
)
# }
Run the code above in your browser using DataLab