HR of a continuous variable and manipulation of its interval I am a medical intern trying to understand Cox regression modelling using R.
I am using the pbc data of the survival package with the following code:
library(survival)
data(pbc)
s <- Surv(pbc$time, pbc$status==2)
cfit.age <- coxph(s ~ age, data=pbc)
summary(cfit.age)

The summary result is:
Call:
coxph(formula = s ~ age, data = pbc)

  n= 418, number of events= 161 

        coef exp(coef) se(coef)     z Pr(>|z|)    
age 0.039185  1.039963 0.007847 4.994 5.92e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    exp(coef) exp(-coef) lower .95 upper .95
age      1.04     0.9616     1.024     1.056

Concordance= 0.616  (se = 0.025 )
Rsquare= 0.058   (max possible= 0.985 )
Likelihood ratio test= 25.19  on 1 df,   p=5.205e-07
Wald test            = 24.94  on 1 df,   p=5.922e-07
Score (logrank) test = 25.3  on 1 df,   p=4.918e-07

As I understand it, the HR per year is 1.04. But I am not sure about:


*

*How can I calculate how much the HR is per 5, 10, or 20 years?

*How can I modify the data frame to get the HR for age per 10 years
    by default?
I am looking Forward to your replies!
 A: Don't change the data; just do the after-fit computations you need.  Making the incredibly strong assumption that age is linearly related to log relative hazard as you are doing, you estimate the hazard ratio per 5-year change in age by taking the anti-log of 5 times the age coefficient, or exp(coef(cfit.age) * 5) and you can easily get a confidence interval for this hazard ratio.  A more general approach not assuming linearity may be had by
require(rms)
dd <- datadist(age); options(datadist='dd')
s <- ... # as you did
# Allow age to be nonlinear by using a restricted cubic spline with 4 default knots
f <- cph(s ~ rcs(age,4), data=pbc)
summary(f, age=c(30, 35))  # age 35 : age 30 hazard ratio & 0.95 C.I.
summary(f, age=c(35, 40))  # these 2 will disagree unless exactly linear

cph is a front-end for Therneau's survival package's coxph.
A: Here is a corrected code sample:
require(rms)
data(pbc)
dd <- datadist(pbc); options(datadist='dd')
s <- with(pbc, Surv(time, status==2))
cfit.age <- coxph(s ~ age, data=pbc)
summary(cfit.age)

# Allow age to be nonlinear by using a restricted cubic spline with 4 default knots
f <- cph(s ~ rcs(age,4), data=pbc)
summary(f, age=c(30, 35))  # age 35 : age 30 hazard ratio & 0.95 C.I.
summary(f, age=c(35, 40))
anova(f)  # test linearity of age  (why? distorts inference to refit model)

