predict.HR: predict method for an object of class 'HR'.

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

View source: R/predict.HR.R

Description

predict method for an object of class 'HR'.

Usage

1
2
3
## S3 method for class 'HR'
predict(object, predictor, prob=NULL, pred.value=NULL, conf.level=0.95,
prediction.values=NULL, round.x=NULL, ref.label=NULL, ...)

Arguments

object

An object of class HR.

predictor

Variable named in the formula or included as a predictor in the coxfit. Usually a continuous predictor of survival for which the results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference.

prob

Value between 0 and 1. If prob=0 the reference value will be the minimum of the hazard ratio curve. If prob=1 the reference value will be the maximum of the hazard ratio curve. For values between 0 and 1 the reference value will be the corresponding quantile of the variable predictor.

pred.value

Value from the variable predictor to be taken as the reference value.

conf.level

Level of confidence. Defaults to 0.95 (corresponding to 95%).

prediction.values

Vector of values ranging between minimum and maximum of the variable predictor.

round.x

Rounding of numbers in the predict.

ref.label

Label for the reference covariate. By default is the name of the covariate.

...

Other arguments.

Value

Returns a matrix with the prediction values.

Author(s)

Artur Araújo and Luís Meira-Machado

References

Cadarso-Suarez, C. and Meira-Machado, L. and Kneib, T. and Gude, F. (2010). Flexible hazard ratio curves for continuous predictors in multi-state models: an application to breast cancer data. Statistical Modelling, 10(3), 291-314. doi: 10.1177/1471082X0801000303

Meira-Machado, L. and Cadarso-Suárez, C. and Gude, F. and Araújo, A. (2013). smoothHR: An R Package for Pointwise Nonparametric Estimation of Hazard Ratio Curves of Continuous Predictors, Computational and Mathematical Methods in Medicine, 2013, Article ID 745742, 11 pages. doi: 10.1155/2013/745742

See Also

smoothHR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Example 1
library(survival)
data(whas500)
fit <- coxph(Surv(lenfol, fstat)~age+hr+gender+diasbp+pspline(bmi)+pspline(los),
data=whas500, x=TRUE)
hr1 <- smoothHR(data=whas500, coxfit=fit)
predict(hr1, predictor="bmi", prob=0, conf.level=0.95)

# Example 2
hr2 <- smoothHR( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+
pspline(bmi)+pspline(los) )
pdval <- c(1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 18, 22, 25)
predict(hr2, predictor="los", pred.value=7, conf.level=0.95, prediction.values=pdval,
ref.label="Ref.")

Example output

Loading required package: survival
Loading required package: splines
      bmi       LnHR  lower .95 upper .95
 13.04546 1.26624009  0.1015945 2.4308856
 18.60004 0.79522426  0.2601568 1.3302917
 23.22377 0.32722547 -0.1670588 0.8215097
 25.94593 0.15487865 -0.3343962 0.6441535
 29.39196 0.08437564 -0.3271063 0.4958576
 36.77345 0.10139527 -0.2230930 0.4258835
 44.83886 1.63447099 -0.1676770 3.4366190
 Ref.       LnHR    lower .95  upper .95
    1 0.63958931  0.145839773 1.13333885
    2 0.41367315  0.068048050 0.75929825
    3 0.22510720 -0.003935894 0.45415030
    4 0.08661449 -0.054745149 0.22797412
    5 0.01078601 -0.061928441 0.08350045
    6 0.00000000  0.000000000 0.00000000
    7 0.03932336 -0.042984549 0.12163127
    8 0.11214610 -0.051764356 0.27605656
   10 0.29242784  0.016151585 0.56870410
   12 0.45326680  0.087874077 0.81865951
   15 0.63423058  0.142267338 1.12619381
   18 0.69915019  0.090171452 1.30812892
   22 0.46793267 -0.268804381 1.20466972
   25 0.07027577 -0.877691297 1.01824284

smoothHR documentation built on Oct. 7, 2021, 9:21 a.m.