smoothHR | R Documentation |
Provides flexible hazard ratio curves allowing non-linear relationships between continuous predictors and survival. To better understand the effects that each continuous covariate has on the outcome, results are expressed in terms of hazard ratio curves, taking a specific covariate value as reference. Confidence bands for these curves are also derived.
smoothHR(data, time=NULL, time2=NULL, status=NULL, formula=NULL, coxfit, status.event=NULL)
data |
A data.frame in which to interpret the variables named in the formula or in the arguments |
time |
For right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval. |
time2 |
Ending time of the interval for interval censored or counting process data only. Intervals are assumed to be open on the left and closed on the right, (start, end]. For counting process data, event indicates whether an event occurred at the end of the interval. |
status |
The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event. |
formula |
A formula object, with the terms on the right after the ~ operator. |
coxfit |
An object of class coxph. This argument is optional, being an alternative to the arguments |
status.event |
The status indicator is a qualitative variable where usually the highest value is left for the event of interest (usually 0=alive, 1=dead).
If that is not the case the |
An object of class HR
. There are methods for print
, predict
and plot
.
HR
objects are implemented as a list with elements:
dataset |
Dataset used. |
coxfit |
The object of class 'coxph' used. |
phtest |
Result from testing the proportional hazards assumption. |
Artur Araújo and Luís Meira-Machado
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, 11 pages. doi: 10.1155/2013/745742
# 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) print(hr1) # Example 2 hr2 <- smoothHR( data=whas500, time="lenfol", status="fstat", formula=~age+hr+gender+diasbp+ pspline(bmi)+pspline(los) ) print(hr2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.