predict.SL.npreg: Predict method for SL.npreg

Description Usage Arguments Examples

View source: R/sl_npreg.R

Description

Method for predicting SL.npreg objects.

Usage

1
2
## S3 method for class 'SL.npreg'
predict(object, newdata, ...)

Arguments

object

An object of class "SL.npreg".

newdata

The new data used to obtain predictions.

...

Other arguments passed to predict.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)
#

benkeser/drtmle documentation built on Jan. 11, 2020, 8:38 a.m.