I am trying to use restricted cubic spline to examine the association
between an independent variable and outcome. When I plot the relationship
between HR and the independent variable, I found the HR is not equal to 1
for the specified reference value. For example:

dat <- read.table("mydata.csv")
ddist <- datadist(dat["HBA1C"])
ddist$limits$HBA1C[2] <-  6.5;                  # specify the reference
value for "HBA1C"
options(datadist='ddist');

fit <- cph(Surv(ftime,outcome)~rcs(HBA1C,3), dat);   # fit the cox model
using rcs with 3 knots
pred_HR <- Predict(fit, HBA1C, fun=exp);      # obtain the HR
plot(pred_HR,ylab="HR",abline=list(h=1, v=6.5));

The figure presents that the HR is not equal to 1 for the reference HBA1C
value (say, 6.5). I am not quite familiar with rcs, can somebody help me
explain it? If I want to obtain the HR=1 for the specified value, how
should I do? Thanks.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to