EYdopt | R Documentation |
Given a W, A, Y dataset, this function will compute the estimated ODTR using SuperLearner. If a Qbar function is provided that computes the true E[Y|A,W] (e.g., if simulating), the function will also return the true treatment under the optimal rule and other metrics of evaluating the estimated optimal rule's performance. Then, it will estimate E[Ydopt] using g-computation, IPTW, IPTW-DR, TMLE, and CV-TMLE. Follows the framework of Luedtke and van der laan, 2015 and 2016.
EYdopt(
W,
V,
A,
Y,
g.SL.library = "SL.mean",
QAW.SL.library,
blip.SL.library,
dopt.SL.library = NULL,
metalearner = "blip",
risk.type = "CV TMLE",
grid.size = 100,
VFolds = 10,
QAW.fun = NULL,
family = NULL,
contrast = NULL
)
W |
Data frame of observed baseline covariates |
V |
Data frame of observed baseline covariates (subset of W) used to design the ODTR |
A |
Vector of treatment |
Y |
Vector of outcome (continuous or binary) |
g.SL.library |
SuperLearner library for estimating txt mechanism |
QAW.SL.library |
SuperLearner library for estimating outcome regression |
blip.SL.library |
SuperLearner library for estimating the blip |
dopt.SL.library |
SuperLearner library for estimating dopt directly. Default is |
metalearner |
Discrete ("discrete"), blip-based ("blip"), vote-based SuperLearner ("vote"). Note that if metalearner is "vote" then cannot put in kappa. |
risk.type |
Risk type in order to pick optimal combination of coefficients to combine the candidate algorithms. For (1) MSE risk use "CV MSE"; for (2) -E[Ydopt] risk use "CV IPCWDR" (for -E[Ydopt] estimated using double-robust IPTW) or "CV TMLE" (for -E[Ydopt] estimates using TMLE); (3) For the upper bound of the CI of -E[Ydopt] use "CV TMLE CI" |
grid.size |
Grid size for |
VFolds |
Number of folds to use in cross-validation. Default is 10. |
QAW.fun |
True outcome regression E[Y|A,W]. Useful for simulations. Default is |
family |
either "gaussian" or "binomial". Default is null, if outcome is between 0 and 1 it will change to binomial, otherwise gaussian |
contrast |
A dim = (n, num contrasts) matrix or dataframe (with columns preferably named) to contrast Psi = E[Ydopt]-E[Ycontrast] for CV-TMLE. For example, contrast = data.frame("EY0" = rep(0,n)) will contrast Psi = E[Ydopt]-E[Y0]. Default is |
odtr.obj |
An object from the odtr function that estimates the odtr. |
If the true Qbar function is specified, the output will be a vector of point estimates of E[Ydopt] and their respective confidence intervals. This will be for both the estimated optimal rule and the true optimal rule. Performance results on the optimal rule will also be output: proportion of people treated under ODTR, proportion of times the estimated rule matches the optimal rule, the mean outcome under the estimated optimal rule under the true mean outcome function, and the mean outcome under the estimated optimal rule under the sample-specific true mean outcome.
If the true Qbar is not specified, return:
Point estimates and confidence intervals for E[Ydopt], using the unadjusted mean outcome for the people who received the optimal rule, g-computation, IPTW, IPTW-DR, TMLE
SuperLearner list. See SL.blip
or SL.vote
documentation.
van der Laan, Mark J., and Alexander R. Luedtke. "Targeted learning of the mean outcome under an optimal dynamic treatment rule." Journal of causal inference 3.1 (2015): 61-95.
Luedtke, Alexander R., and Mark J. van der Laan. "Super-learning of an optimal dynamic treatment rule." The international journal of biostatistics 12.1 (2016): 305-332.
Luedtke, Alexander R., and Mark J. van der Laan. "Optimal individualized treatments in resource-limited settings." The international journal of biostatistics 12.1 (2016): 283-303.
Coyle, J.R. (2017). Jeremy Coyle, “Computational Considerations for Targeted Learning” PhD diss., University of California, Berkeley 2017 https://escholarship.org/uc/item/9kh0b9vm.
## Example
library(SuperLearner)
library(hitandrun)
ObsData = subset(DGP_bin_simple(1000), select = -c(A_star, Y_star))
W = subset(ObsData, select = -c(A,Y))
V = W
A = ObsData$A
Y = ObsData$Y
# E[Ydopt] using blip-based estimate of ODTR with risk function CV-TMLE
EYdopt(W = W, A = A, Y = Y, V = W, blip.SL.library = "SL.blip.HTEepi", g.SL.library = "SL.mean", QAW.SL.library = "SL.QAW.HTEepi", risk.type = "CV TMLE", metalearner = 'blip')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.