predict.gamtree: Predictions from fitted GAM tree

Description Usage Arguments Value

View source: R/gamtree.R

Description

Takes a fitted GAM tree (of class "gamtree") and produces predictions given a new set of values for the model covariates, or for the original covariate values used for fitting the GAM tree.

Usage

1
2
## S3 method for class 'gamtree'
predict(object, newdata = NULL, type = "link", ...)

Arguments

object

an object of class gamtree.

newdata

a data.frame containing the values of the model covariates for which predictions should be returned. The default (NULL) returns predictions for the original training data.

type

character vector of length 1, specifying the type of prediction to be returned. "link" (the default) returns values on the scale of the linear predictor. Alternatively, "response" returns predictions on the scale of the response variable; "node" returns an integer vector of node identifiers.

...

further arguments to be passed to mgcvpredict.gam.

Value

Returns a vector of predicted values.


marjoleinF/gamtree documentation built on Sept. 17, 2021, 5:46 a.m.