File: resid.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 (14 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fit1 <- survreg(Surv(futime, fustat) ~ age + ecog.ps, ovarian)
fit2 <- censorReg(censor(futime, fustat) ~ age + ecog.ps, ovarian)
fit3 <- survreg(Surv(futime, fustat) ~ age + ecog.ps, ovarian,
		iter=0, init=c(fit2$coef,   log(fit2$scale)))
fit4 <- survreg(Surv(log(futime), fustat) ~age + ecog.ps, ovarian,
		dist='extreme',
		iter=0, init=c(fit2$coef,   log(fit2$scale)))
		

aeq(resid(fit2, type='working')[,1], resid(fit3, type='working'))
aeq(resid(fit2, type='response')[,1], resid(fit3, type='response'))

temp <- sign(resid(fit3, type='working'))
aeq(resid(fit2, type='deviance')[,1], temp*abs(resid(fit3, type='deviance')))