plot.HR: Flexible hazard ratio curves taking a specific covariate...

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

Description

Plots 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.

Usage

1
2
3
## S3 method for class 'HR'
plot(x, predictor, prob=NULL, pred.value=NULL, conf.level=0.95, round.x=NULL,
ref.label=NULL, col, main, xlab, ylab, lty, xlim, ylim, xx, ...)

Arguments

x

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%).

round.x

Rounding of numbers in the plot.

ref.label

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

col

Vector of dimension 3 for the colors to plot.

main

These arguments to title have useful defaults here.

xlab

The range of x and y values with sensible defaults.

ylab

The range of x and y values with sensible defaults.

lty

Vector of dimension 2 for the line type.

xlim

The range of x and y values with sensible defaults.

ylim

The range of x and y values with sensible defaults.

xx

Vector of values (from the variable predictor) to be shown in the x axis.

...

Other arguments.

Value

No value is returned.

Author(s)

Artur Araújo and Luís Meira-Machado

References

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

See Also

smoothHR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)
plot(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) )
plot(hr2, predictor="los", pred.value=7, conf.level=0.95, xlim=c(0,30), round.x=1,
ref.label="Ref.", xaxt="n")
xx <- c(0, 5, 10, 15, 20, 25, 30)
axis(1, xx)

Example output

Loading required package: survival
Loading required package: splines

smoothHR documentation built on May 2, 2019, 8:20 a.m.