predict.rseg {rseg} | R Documentation |
predict
method for objects of class rseg
.
## S3 method for class 'rseg' predict(object, newdata = NULL, type = c("response", "prob", "segment")[1], ...)
object |
an object of class |
newdata |
optional data to use for pediction. If omitted, the fitted values in |
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. |
A list, matrix or vector of predictions.
### 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") }