predict.TSVC: Prediction from Varying Coefficient Trees

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/predict.TSVC.R

Description

Obtains predictions from a fitted TSVC object.

Usage

1
2
## 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>
http://www.imbie.uni-bonn.de/personen/dr-moritz-berger/

References

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

See Also

TSVC, plot.TSVC, summary.TSVC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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 July 1, 2020, 7:08 p.m.

Related to predict.TSVC in TSVC...