pred: Obtaining predicted values from fitted models

Description Usage Arguments Value

View source: R/pred.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
pred(object, newdata, ...)

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

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

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

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

## S3 method for class '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


paths documentation built on June 18, 2021, 9:07 a.m.