kkholst / mets

Analysis of Multivariate Event Times https://kkholst.github.io/mets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

predict.phreg hardening

klaus-holst opened this issue · comments

library("mets")
n <- 1e2

t <- rexp(n)
cat <- sample(c("A", "B"), replace = TRUE, size = n)
d <- data.frame(t = t, cat = cat)
model <- phreg(Surv(t)~cat, data = d)
predict(model, newdata = data.frame(cat = c("A", "B")))
predict(model, newdata = data.frame(cat = "A"))