Description Usage Arguments Value See Also Examples
This function predicts a subject's overall hazard rates at given time points
based on this subject's covariate values. The prediction function is an additive
hazards model fitted using ah
.
1 2 |
object |
an object of class inhering from |
newdata |
a dataframe of an individual's predictors. |
newtime |
a given sequence of time points at which the prediction is performed.
The time should be on the same scale as the survival time in |
... |
further arguments passed to or from other methods. |
A dataframe including the time points for prediction, predicted values and their standard errors.
ah
for fitting the additive hazards model, nwtsco
for
the description of nwtsco dataset
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(survival)
### fit the additive hazards model to the data
nwts<- nwtsco[1:100,]
fit <- ah(Surv(trel,relaps) ~ age + instit, data = nwts, ties = FALSE, robust = FALSE)
### see the covariate names in the prediction function
fit$call
### the newdata should be a dataframe
### the variable names are the same as the covariate names in
### the prediction function
newdata <- data.frame(age=60, instit =1)
### an alternative way to give the newdata
newdata <- nwtsco[101,]
### based on this subject's covariate values, the function predicts individual specific
### hazard rates at time points 3 and 5
predict(fit, newdata, newtime = c(3,5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.