When performing the same cox-regression in SAS and i R (including and interaction with a 3 knot restricted cubic spline), I receive different parameter estimates (i.e on age_spline 2). In my example below I have used the dataset=WHAS500 found on this website (https://stats.idre.ucla.edu/sas/seminars/sas-survival/)
To harmonize the models (and the splines) between SAS and R I have used knots according to Harrell's scheme (https://blogs.sas.com/content/iml/2019/02/18/regression-restricted-cubic-splines-sas.html) and set both TIES to EFRON
SAS-code
proc phreg data = whas500;
effect age_spline = spline(age/ details naturalcubic basis=tpf(noint)
knotmethod=percentilelist(10 50 90));
model lenfol*fstat(0) = gender|age_spline /rl ties=EFRON;
run;
R-code
fit <- cph(Surv(LENFOL, FSTAT) ~ GENDER*rcs(AGE,3), data = whas500)
Output
I would be very thankful if someone can help me explain the observed differences.
R
documentation explains this, so consider comparing the model matrices in both programs. $\endgroup$