kkholst / mets

Analysis of Multivariate Event Times https://kkholst.github.io/mets/
15 stars 3 forks source link

predict.phreg hardening #4

Open klaus-holst opened 1 year ago

klaus-holst commented 1 year ago
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"))