predict.SL.npreg {drtmle} | R Documentation |
Predict method for SL.npreg
Description
Method for predicting SL.npreg objects.
Usage
## S3 method for class 'SL.npreg'
predict(object, newdata, ...)
Arguments
object |
An object of class |
newdata |
The new data used to obtain predictions. |
... |
Other arguments passed to predict. |
Examples
# simulate data
set.seed(1234)
n <- 100
X <- data.frame(X1 = rnorm(n))
Y <- X$X1 + rnorm(n)
# fit npreg
fit <- SL.npreg(Y = Y, X = X, newX = X)
# predict on fit
newX <- data.frame(X1 = c(-1, 0, 1))
pred <- predict(fit$fit, newdata = newX)
#
[Package drtmle version 1.1.2 Index]