R Under development (unstable) (2024-12-13 r87441 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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) > > # > # A test of NULL models > # > fit1 <- coxph(Surv(stop, event) ~ rx + strata(number), bladder, iter=0) > fit2 <- coxph(Surv(stop, event) ~ strata(number), bladder) > > all.equal(fit1$loglik[2], fit2$loglik) [1] TRUE > all.equal(fit1$resid, fit2$resid) [1] TRUE > > > fit1 <- coxph(Surv(start, stop, event) ~ rx + strata(number), bladder2, iter=0) > fit2 <- coxph(Surv(start, stop, event) ~ strata(number), bladder2) > > all.equal(fit1$loglik[2], fit2$loglik) [1] TRUE > all.equal(fit1$resid, fit2$resid) [1] TRUE > > proc.time() user system elapsed 1.03 0.15 1.17