File: test1.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 (30 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# Draw a contour map of the test1 data, to show the non SPD area of
#  the loglik
#

x0 <- seq(1, 3, length=20)
x1 <- -.745
sig<- seq(-2, 0, length=20)
lmat <- matrix(0, length(x0), length(sig))
for (i in 1:length(x0)) {
    for (j in 1:length(sig)) {
        fit<- survreg(Surv(time, status)~x, test1, 
		      init=c(x0[i], x1, sig[j]), control=list(maxiter=0))
	lmat[i,j] <- fit$loglik[1]
	}
    }

x1 <- -.735
lmat2 <- matrix(0, length(x0), length(sig))
for (i in 1:length(x0)) {
    for (j in 1:length(sig)) {
        fit<- survreg(Surv(time, status)~x, test1, 
		      init=c(x0[i], x1, sig[j]), control=list(maxiter=0))
	lmat2[i,j] <- fit$loglik[1]
	}
    }

clev <- -1*c(2.5,3:6, 8, 10, 15, 25)
contour(x0, sig, lmat, levels=clev)
contour(x0, sig, lmat2,levels=clev)