
R Under development (unstable) (2020-06-10 r78681) -- "Unsuffered Consequences"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # Verify the values found in the Royston paper
> library(survival)
> 
> pbc2 <- na.omit(pbc[,-1])  # no id variable, no missings
> 
> pfit1 <- coxph(Surv(time, status==2) ~ . + log(bili) - bili, pbc2,
+                ties="breslow")
> # backwards elimination was used to eliminate all but 8
> pfit2 <- coxph(Surv(time, status==2) ~ age + log(bili) + edema + albumin +
+                    stage + copper, data=pbc2, ties="breslow")
> 
> temp <- rbind(royston(pfit1), royston(pfit1, adjust=TRUE),
+               royston(pfit2), royston(pfit2, adjust=TRUE))
> all.equal(round(temp[,1], 2), c(2.86, 2.56, 2.69, 2.59))
[1] TRUE
> 
> proc.time()
   user  system elapsed 
  0.824   0.052   0.868 
