R Under development (unstable) (2023-08-12 r84939 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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. > options(na.action=na.exclude) # preserve missings > options(contrasts=c('contr.treatment', 'contr.poly')) #ensure constrast type > library(survival) > > # > # Here is a test case with multiple smoothing terms > # > > fit0 <- coxph(Surv(time, status) ~ ph.ecog + age, lung) > fit1 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,3), lung) > fit2 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,4), lung) > fit3 <- coxph(Surv(time, status) ~ ph.ecog + pspline(age,8), lung) > > > > fit4 <- coxph(Surv(time, status) ~ ph.ecog + pspline(wt.loss,3), lung) > > fit5 <-coxph(Surv(time, status) ~ ph.ecog + pspline(age,3) + + pspline(wt.loss,3), lung) > > fit1 Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age, 3), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.44802 0.11707 0.11678 14.64453 1.00 0.00013 pspline(age, 3), linear 0.01126 0.00928 0.00928 1.47231 1.00 0.22498 pspline(age, 3), nonlin 2.07924 2.08 0.37143 Iterations: 4 outer, 12 Newton-Raphson Theta= 0.861 Degrees of freedom for terms= 1.0 3.1 Likelihood ratio test=21.9 on 4.08 df, p=2e-04 n= 227, number of events= 164 (1 observation deleted due to missingness) > fit2 Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age, 4), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.45047 0.11766 0.11723 14.65751 1.00 0.00013 pspline(age, 4), linear 0.01117 0.00927 0.00927 1.45195 1.00 0.22822 pspline(age, 4), nonlin 2.95816 3.08 0.41197 Iterations: 4 outer, 11 Newton-Raphson Theta= 0.797 Degrees of freedom for terms= 1.0 4.1 Likelihood ratio test=22.7 on 5.07 df, p=4e-04 n= 227, number of events= 164 (1 observation deleted due to missingness) > fit3 Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age, 8), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.47640 0.12024 0.11925 15.69732 1.00 7.4e-05 pspline(age, 8), linear 0.01172 0.00923 0.00923 1.61161 1.00 0.20 pspline(age, 8), nonlin 6.93188 6.99 0.43 Iterations: 5 outer, 15 Newton-Raphson Theta= 0.691 Degrees of freedom for terms= 1 8 Likelihood ratio test=27.6 on 8.97 df, p=0.001 n= 227, number of events= 164 (1 observation deleted due to missingness) > fit4 Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(wt.loss, 3), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.51545 0.12960 0.12737 15.81939 1.00 7e-05 pspline(wt.loss, 3), line -0.00702 0.00655 0.00655 1.14638 1.00 0.28 pspline(wt.loss, 3), nonl 2.44612 2.09 0.31 Iterations: 3 outer, 10 Newton-Raphson Theta= 0.776 Degrees of freedom for terms= 1.0 3.1 Likelihood ratio test=21.1 on 4.06 df, p=3e-04 n= 213, number of events= 151 (15 observations deleted due to missingness) > fit5 Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age, 3) + pspline(wt.loss, 3), data = lung) coef se(coef) se2 Chisq DF p ph.ecog 0.47422 0.13495 0.13206 12.34842 1.00 0.00044 pspline(age, 3), linear 0.01368 0.00976 0.00974 1.96406 1.00 0.16108 pspline(age, 3), nonlin 1.90116 2.07 0.40284 pspline(wt.loss, 3), line -0.00717 0.00661 0.00660 1.17529 1.00 0.27832 pspline(wt.loss, 3), nonl 2.07729 2.03 0.35929 Iterations: 4 outer, 12 Newton-Raphson Theta= 0.85 Theta= 0.779 Degrees of freedom for terms= 1.0 3.1 3.0 Likelihood ratio test=25.2 on 7.06 df, p=7e-04 n= 213, number of events= 151 (15 observations deleted due to missingness) > > rm(fit1, fit2, fit3, fit4, fit5) > > proc.time() user system elapsed 1.31 0.10 1.40