Description Usage Arguments Value Examples
View source: R/predict.rocTree.R
The function gives predicted values with a rocTree
fit.
1 2 |
object |
is an |
newdata |
is an optional data frame in which to look for variables with which to predict. If omitted, the fitted predictors are used. If the covariate observation time is not supplied, covariates will be treated as at baseline. |
type |
is an optional character string specifying whether to predict the survival probability or the cumulative hazard rate. |
control |
a list of control parameters. See 'details' for important special
features of control parameters. See |
... |
for future developments. |
Returns a data.frame
of the predicted survival probabilities or cumulative hazard.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(simDat)
fit <- rocTree(Surv(Time, death) ~ z1 + z2, id = id, data = simDat, ensemble = FALSE)
## testing data
newdat <- data.frame(Time = sort(unique(simDat$Time)),
z2 = runif(1))
newdat$z1 <- 1 * (newdat$Time < median(newdat$Time))
head(newdat)
## Predict survival
pred <- predict(fit, newdat)
plot(pred)
## Predict hazard
pred <- predict(fit, newdat, type = "hazard")
plot(pred)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.