predict.TSVC: Prediction from Varying Coefficient Trees

View source: R/predict.TSVC.R

predict.TSVCR Documentation

Prediction from Varying Coefficient Trees

Description

Obtains predictions from a fitted TSVC object.

Usage

## S3 method for class 'TSVC'
predict(object, X_new = NULL, ...)

Arguments

object

a fitted object of class TSVC.

X_new

optionally, data frame of class data.frame which contains the variables with which to predict. If NULL, the fitted linear predictors are use.

...

further arguments passed to predict.glm.

Details

predict.TSVC is a wrapper function of predict.glm, which obtains predictions for objects of class glm. Further arguments can be passed to predict.glm via the '...'-argument.

Author(s)

Moritz Berger <moritz.berger@imbie.uni-bonn.de>
https://www.imbie.uni-bonn.de/people/dr-moritz-berger/

References

Berger, M., G. Tutz and M. Schmid (2019). Tree-Structured Modelling of Varying Coefficients. Statistics and Computing 29, 217-229, https://doi.org/10.1007/s11222-018-9804-8.

See Also

TSVC, plot.TSVC, summary.TSVC

Examples

# Swiss Labour Market 
library(AER)
data("SwissLabor")

# recode factors
sl <- SwissLabor
sl$participation <- as.numeric(sl$participation)-1
sl$foreign       <- as.numeric(sl$foreign)-1

X_new <- data.frame("income"=c(10,12), "age"=c(4.5,5.8))

## Not run: 
fit1 <- TSVC(participation~income+age, data=sl, family=binomial(link="logit"), 
             nperm=1000, trace=TRUE)
predict(fit1, X_new, type="response")

## End(Not run)



TSVC documentation built on Oct. 17, 2023, 5:12 p.m.