[R] Fractional Polynomials - Hazard Ratios and Relative Hazard Plots
Laura Bonnett
l.j.bonnett at gmail.com
Wed Jul 21 14:37:39 CEST 2010
Dear All,
I am using Windows and R version 2.9.2 with libraries cmprsk, mfp and
Design.
I have a dataset with approximately 1700 patients (1 row per patient) and I
have 12 outcomes, three of which are continuous. I have performed
univariate analyses to see if any factors are associated with a higher
likelihood of the event of interest (achieving 12 month remission from
epileptic seizures) and also an analysis adjusted for multiple variables.
I have tried log and fractional polynomial (FP) transformations of each
continuous variable. In the case of age, used for the example below, the FP
transformation led to the best model fit according to the AIC. I have
therefore applied this transformation for all analyses.
To begin with I have fitted a Cox model stratified by randomisation period,
rpa, (either before or after a certain date).
fit1 <- mfp(Surv(Remtime,Rcens) ~ fp(age) + strata(rpa), family=cox,
data=nearma, select=0.05, verbose=TRUE)
I would like two things from this model, hazard ratios and and an associated
hazard ratio plot. I am aware that the hazard ratios produced from a
fractional polynomial transformation are not to be used directly (i.e. those
obtained from summary(coxfitf1)). Instead the derived functional form of
the variable should be used to estimate hazard ratios post hoc. I have
attached a word document explaining how hazard ratios and confidence
interval can be derived and given a worked example for the variable, age.
The univariate results are:
Age (years)
≤10
(10 to 25]
(25 to 37]
(37 to 50]
(50 to 71]
>71
1.00
1.00 (1.00 to 1.00)
0.99 (0.99 to 1.00)
0.99 (0.99 to 0.99)
0.99 (0.98 to 0.99)
0.98 (0.97 to 0.99)
To create a plot of the relative hazard I have used the code:
plot(nearma$age,predict(fit1,type="risk"),xlab="Age",ylab="Relative Hazard")
The produced plot is attached.
As you can clearly see, the hazard ratios above and the relative hazard plot
do not agree.
This is also the case for the other two continuous variables that have been
transformed via the FP approach.
The hazard ratios for age using the model adjusted for multiple variables
are as follows, which do coincide with the plot:
Age (years)
≤10
(10 to 25]
(25 to 37]
(37 to 50]
(50 to 71]
>71
1.00
0.86 (0.77 to 0.95)
0.78 (0.65 to 0.94)
0.80 (0.64 to 1.00)
1.01 (0.81 to 1.25)
1.61 (1.27 to 2.05)
Can anyone therefore explain why the univariate hazard ratios do not
coincide with the relative hazard plot and yet the hazard ratios from the
multivariable model do? I know that the calculations are correct for both
sets of hazard ratios.
Thank you for any help you can provide as I am at a loss to explain the
difference in the plot fo the calculations - they should, after all, be
saying the same thing!
Thank you,
Laura
More information about the R-help
mailing list