IPWE_Qopt_DepCen_trt {QTOCen} | R Documentation |
Estimate the Quantile-opt Treatment Regime under the assumption that the censoring time's distribution only depends on treatment level
Description
Here we assume the censoring variable is independent of covariates and potential outcomes given the treatment assignment. For example, if evidence shows that patients at certain treatment level are prone to experience censoring earlier.
Usage
IPWE_Qopt_DepCen_trt(data, regimeClass, tau, moPropen = "BinaryRandom",
cluster = FALSE, p_level = 1, s.tol = 1e-04, it.num = 8,
pop.size = 6000)
Arguments
data |
raw data.frame |
regimeClass |
a formula specifying the class of treatment regimes to search,
e.g. if
Polynomial arguments are also supported. |
tau |
the quantile of interest |
moPropen |
The propensity score model for the probability of receiving
treatment level 1.
When |
cluster |
default is FALSE, meaning do not use parallel computing for the genetic algorithm(GA). |
p_level |
choose between 0,1,2,3 to indicate different levels of output from the genetic function. Specifically, 0 (minimal printing), 1 (normal), 2 (detailed), and 3 (debug). |
s.tol |
tolerance level for the GA algorithm. This is input for parameter |
it.num |
the maximum GA iteration number |
pop.size |
an integer with the default set to be 3000. This is roughly the
number individuals for the first generation
in the genetic algorithm ( |
Details
data is a dataframe that contains: a(observed treatment assignment), censor_y, and delta
Examples
GenerateData_DepCen_trt <- function(n)
{
x1 <- runif(n, min=-0.5,max=0.5)
x2 <- runif(n, min=-0.5,max=0.5)
error <- rnorm(n, sd= 1)
ph <- exp(-0.5+1*(x1+x2))/(1+exp(-0.5 + 1*(x1+x2)))
a <- rbinom(n = n, size = 1, prob=ph)
c <- 1 + 1*a + runif(n = n, min=0, max=2)
# distribution of `c' depends on treatment level `a'
cmplt_y <- pmin(2+x1+x2 + a*(1 - x1 - x2) + (0.2 + a*(1+x1+x2)) * error, 4.4)
censor_y <- pmin(cmplt_y, c)
delta <- as.numeric(c > cmplt_y)
return(data.frame(x1=x1,x2=x2,a=a, censor_y = censor_y, delta=delta))
}
n <- 400
data <- GenerateData_DepCen_trt(n)
fit1 <- IPWE_Qopt_DepCen_trt(data = data, regimeClass = a~x1+x2, moPropen = a~x1+x2,
tau = 0.2)