predict.rseg: Predictions by recursive segmentation

Description Usage Arguments Value Examples

Description

predict method for objects of class rseg.

Usage

1
2
3
## S3 method for class 'rseg'
predict(object, newdata = NULL, type = c("response",
  "prob", "segment")[1], ...)

Arguments

object

an object of class rseg fit by cseg, eseg or rseg.

newdata

optional data to use for pediction. If omitted, the fitted values in object are used.

type

the type of prediction to be returned. For "response", this is the mean of a numeric response, the predicted class for a categorical response or the median survival time for a censored response. For "prob", there are two options: 1) in case of a categorical response this is a matrix of conditional class probabilities or a list with the conditional class probabilities for each observation. 2) In case of numeric and censored responses, this is a list with the empirical cumulative distribution functions and empirical survivor functions (Kaplan-Meier estimate). For "segment", this is an integer vector of terminal node identifiers.

...

not used.

Value

A list, matrix or vector of predictions.

Examples

1
2
3
4
5
6
7
8
9
### survival analysis
if (require("TH.data")) {
data("GBSG2", package = "TH.data")
GBSG2seg <- cseg(Surv(time, cens) ~ ., data = GBSG2)
print(GBSG2seg)
predict(GBSG2seg, type = "response")
predict(GBSG2seg, type = "prob")
predict(GBSG2seg, type = "segment")
}

rseg documentation built on May 2, 2019, 6:38 p.m.

Related to predict.rseg in rseg...