Learn R Programming

paths (version 0.1.1)

pred: Obtaining predicted values from fitted models

Description

Generic function that returns predicted outcomes from lm, glm, gbm, wbart, and pbart objects with new data.

Usage

pred(object, newdata, ...)

# S3 method for lm pred(object, newdata, ...)

# S3 method for glm pred(object, newdata, ...)

# S3 method for gbm pred(object, newdata, method = "OOB", ...)

# S3 method for pbart pred(object, newdata, ...)

# S3 method for wbart pred(object, newdata, ...)

Arguments

object

a fitted model object, which can be of class lm, glm, gbm, wbart, or pbart.

newdata

a data frame containing predictor variables.

...

additional arguments passed to the predict methods.

method

Method used to determine the optimal number of boosting iterations for gbm objects.

Value

a vector of expected outcomes for newdata