Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. # Create the simplest test data set
  2. test1 <- list(time=c(4,3,1,1,2,2,3),
  3. status=c(1,1,1,0,1,1,0),
  4. x=c(0,2,1,1,1,0,0),
  5. sex=c(0,0,0,0,1,1,1))
  6. # Fit a stratified model
  7. m=coxph(Surv(time, status) ~ x + sex, test1)
  8.  
  9. y=predict(m,type="survival",by="sex")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement