Description Usage Arguments Examples
This function estimates the Quantile-optimal Treatment Regime for a given quantile level of interest under the assumption that the distribution of censoring time is independent of the set of potential survival times given a set of baseline covariates and treatment actually received.
More specifically, we do stratification by treatment first and then used kernel smoothing to estimate local survival function of censoring time for each treatment group.
1 2 3 4 |
data |
raw data.frame |
regimeClass |
the class of treatment regimes. e.g., 'txname ~ x1+x2'. |
tau |
the quantile of interest |
Domains |
default is NULL. |
bw |
the bandwidth of local KM model (e.g. see Wang-wang 2008) |
moPropen |
an optional string for the working model of treatment assignment |
DepCens |
an optional vector of baseline variable names that the censoring variable
depends on. Note that
the treatment variable is always treated as dependent with the censoring time.
If unspecified ( |
UseTrueG |
logical. Whether the true survival probability of each patient is provided. |
trueG_value |
default is NULL.
IF |
cluster |
default is FALSE. This can also be an object of the 'cluster' class returned by one of the makeCluster commands in the parallel package or a vector of machine names so rgenoud::genoud can setup the cluster automatically. |
p_level |
print level |
s.tol |
tolerance level |
it.num |
the maximum iteration number |
pop.size |
the initial population size |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | GenerateData <- 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.5 + + runif(n = n, min=0, max=2)
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(n)
fit1 <- IPWE_Qopt_DepCen_general(data = data, regimeClass = a~x1+x2, moPropen = a~x1+x2,
tau = 0.2, bw = 20/n,
pop.size=3000, it.num = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.