HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/R/R-4.4.0/library/survival/tests/r_user.Rout.save
R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

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)
Loading required package: splines
> 
> #
> # 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
> 
>