Estimate the marginal mean response of a linear static treatment regime
Estimate the marginal mean response of a linear static treatment regime
Assume we have binary treatment options for each subject in the target population. This function evaluates a given treatment regime by the estimated marginal mean response. We assume the space of treatment regimes are linear decision functions indexed by parametric coefficients.
This R function is an empirical value function in the literature of optimal treatment regime estimation. Since the goal here is to maximize population's marginal mean response, this function, which estimates the performance of a set of parameters in terms of the marginal mean , is the objective function in a nonparametric policy-search method.
The user facing application which utilizes this function is IPWE_mean_IndCen.
est_mean_ipwe(beta, x, censor_y, delta, ph, a, ghat, check_complete =TRUE)
Arguments
beta: Numeric vector. A set of parameter that indexes the regime.
x: Numeric Matrix. The baseline covariates from all observed data.
censor_y: Numeric vector. The censored survival times from all observed data, i.e. censor_y = min(Y, C)
delta: Numeric vector. The censoring indicators from all observed data. We use 1 for uncensored, 0 for censored.
ph: Numeric vector. The estimated propensity score of being assigned treatment A=1
by the original data generation mechanism for all observed data.
a: Numeric vector. The vector of observed treatment level for all observed data. Treatment levels should be coded as 0/1.
ghat: Numeric vector. The conditional/unconditional probabilities of event that the censoring variable is larger than the observed survival time given covariates for each observation. a.k.a F(T>y0∣x0).
This can be calculated by function LocalKM. Estimation of conditional cumulative function value at y0 is implemented in tauhat_func.
check_complete: logical. Since this value estimation method is purely nonparametric, we need at least one unit in collected data such that the observed treatment assignment is the same what the regime parameter suggests. If check_complete
is TRUE. It will check if any observation satisfies this criterion. When none observation satisfies, a message is printed to console to raise users awareness that the input regime parameter beta does not agree with any observed treatment level assignment. Then a sufficiently small number is returned from this function, to keep the genetic algorithm running smoothly.
Examples
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 <- rep(0.5,n) 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 <-100data <- GenerateData(n)# here the value for argument ghat uses 0.5 vector for brevity.mean_hat <- est_mean_ipwe(c(-1,0,2), x=cbind(1, data$x1, data$x2), censor_y = data$censor_y, delta = data$delta, ph = rep(0.5,n), a = data$a, ghat = rep(0.5,n))