R version 4.4.0 RC (2024-04-16 r86458 ucrt) -- "Puppy Cup" 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 length of missings > library(survival) > > # > # Check out using a "user specified" distribution > # > mydist <- c(survreg.distributions$extreme, survreg.distributions$weibull[-1]) > mydist$name <- "Weibull2" > mydist$dist <- NULL > > fit1 <- survreg(Surv(time, status) ~ age + ph.ecog, lung) > fit2 <- survreg(Surv(time, status) ~ age + ph.ecog, lung, dist=mydist) > > all.equal(fit1$coef, fit2$coef) [1] TRUE > all.equal(fit1$var, fit2$var) [1] TRUE > > # > # And with an data set containing interval censoring > # > idat <- read.table('data.interval', skip=3, header=T, sep=',') > > fit1 <- survreg(Surv(ltime, rtime, type='interval2') ~ age + ecog.ps, idat) > fit2 <- survreg(Surv(ltime, rtime, type='interval2') ~ age + ecog.ps, + data=idat, dist=mydist) > > all.equal(fit1$coef, fit2$coef) [1] TRUE > all.equal(fit1$var, fit2$var) [1] TRUE > all.equal(fit1$log, fit2$log) [1] TRUE > > > proc.time() user system elapsed 0.73 0.12 0.84