predict.DTR.KernSmooth {DTRKernSmooth} | R Documentation |
Predict the optimal treatments given a 'DTR.KernSmooth' object
Description
This function predicts the optimal treatments for new subjects from a fitted DTR.KernSmooth model.
Usage
## S3 method for class 'DTR.KernSmooth'
predict(object, newX, ...)
Arguments
object |
Fitted "DTR.KernSmooth" model object. |
newX |
Matrix of new values for X at which predictions are to be made. |
... |
Not used. Other arguments to predict. |
Details
All the predicted optimal treatments are labeled as {0,1}.
Value
A vector of predicted optimal treatments for the new subjects given the fitted DTR.KernSmooth model.
Author(s)
Yunan Wu and Lan Wang
Maintainer:
Yunan Wu <yunan.wu@utdallas.edu>
References
Wu, Y. and Wang, L. (2021), Resampling-based Confidence Intervals for Model-free Robust Inference on Optimal Treatment Regimes, Biometrics, 77: 465– 476, doi:10.1111/biom.13337.
See Also
predict.DTR.Boots.KernSmooth
, DTR.KernSmooth
,
DTR.Boots.KernSmooth
Examples
n <- 500; p <- 3
beta <- c(0.2,1,-0.5,-0.8)*0.7
beta1 <- c(1,-0.5,-0.5,0.5)
set.seed(12345)
X <- matrix(rnorm(n*p),n)
a <- rbinom(n,1,0.7)
mean1 <- exp(cbind(1,X) %*% beta1)
mean2 <- 8/(1 + exp(-cbind(1,X) %*% beta)) - 4
y <- mean1 + a * mean2 + rnorm(n)
smooth_model <- DTR.KernSmooth(X, y, a, prob = 0.3 + 0.4*a)
newn <- 10
newX <- matrix(rnorm(newn*p),newn)
predict(smooth_model, newX)
[Package DTRKernSmooth version 1.1.0 Index]