"type5": is similar to "type2" but with censoring generated from an accelerated failure time model.
generate_causal_survival_data( n, p, Y.max =NULL, y0 =NULL, X =NULL, rho =0, n.mc =10000, dgp = c("simple1","type1","type2","type3","type4","type5"))
Arguments
n: The number of samples.
p: The number of covariates.
Y.max: The maximum follow-up time (optional).
y0: Query time to estimate P(T(1) > y0 | X) - P(T(0) > y0 | X) (optional).
X: The covariates (optional).
rho: The correlation coefficient of the X's covariance matrix V_(ij) = rho^|i-j|. Default is 0.
n.mc: The number of monte carlo draws to estimate the treatment effect with. Default is 10000.
dgp: The type of DGP.
Returns
A list with entries: X: the covariates, Y: the event times, W: the treatment indicator, D: the censoring indicator, cate: the treatment effect (RMST) estimated by monte carlo, cate.prob the difference in survival probability, cate.sign: the true sign of the cate for ITR comparison, dgp: the dgp name, Y.max: the maximum follow-up time, y0: the query time for difference in survival probability.
Examples
# Generate datan <-1000p <-5data <- generate_causal_survival_data(n, p)# Get true CATE on a test setX.test <- matrix(seq(0,1, length.out =5),5, p)cate.test <- generate_causal_survival_data(n, p, X = X.test)$cate