Open klaus-holst opened 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"))