Description Usage Arguments Value Author(s) References See Also Examples
predict method for an object of class 'HR'.
1 2 3 |
object |
An object of class HR. |
predictor |
Variable named in the formula or included as a predictor in the |
prob |
Value between 0 and 1. If |
pred.value |
Value from the variable |
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 |
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. |
Returns a matrix with the prediction values.
Artur Araújo and Luís Meira-Machado
Carmen Cadarso-Suarez, Luis Meira-Machado, Thomas Kneib and Francisco Gude. Flexible hazard ratio curves for continuous predictors in multi-state models: a P-spline approach. Statistical Modelling, 2010, 10:291-314.
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.")
|
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.