File: lung.s

package info (click to toggle)
survival 2.29-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,204 kB
  • ctags: 1,077
  • sloc: asm: 8,713; ansic: 6,928; sh: 22; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#lfit1 <- censorReg(censor(time, status) ~ age + ph.ecog + strata(sex),lung)
lfit2 <- survreg(Surv(time, status) ~ age + ph.ecog + strata(sex), lung)
lfit3 <- survreg(Surv(time, status) ~ sex + (age+ph.ecog)*strata(sex), lung)

lfit4 <-  survreg(Surv(time, status) ~ age + ph.ecog , lung,
		  subset=(sex==1))
lfit5 <- survreg(Surv(time, status) ~ age + ph.ecog , lung,
		  subset=(sex==2))

aeq <- function(x,y) all.equal(as.vector(x), as.vector(y))
#aeq(lfit4$coef, lfit1[[1]]$coef)
#aeq(lfit4$scale, lfit1[[1]]$scale)
aeq(c(lfit4$scale, lfit5$scale), lfit3$scale )
aeq(c(lfit4$scale, lfit5$scale), sapply(lfit1, function(x) x$scale))