File: surv_test.R

package info (click to toggle)
rpart 3.1.41-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 776 kB
  • ctags: 255
  • sloc: ansic: 2,541; asm: 1,672; makefile: 1
file content (9 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
## example from coxph: gave error in rpart 3.1-31
## due to missing drop = FALSE
test1 <- list(time=  c(4, 3,1,1,2,2,3),
               status=c(1,NA,1,0,1,1,0),
               x=     c(0, 2,1,1,1,0,0),
               sex=   c(0, 0,0,0,1,1,1))
library(survival)
library(rpart)
rpart(Surv(time, status) ~ x + sex, test1)