d <- sampleData(1e2, outcome = "survival")
d$entry <- 0
d$id <- 1:NROW(d)
##
library(survival)
mCox <- coxph(Surv(time, event) ~ X1+X2, data = d)
CoxLP(mCox, data = d, center = FALSE)
CoxLP(mCox, data = d, center = TRUE)
mCoxS <- coxph(Surv(time, event) ~ strata(X1)+X2, data = d)
CoxLP(mCoxS, data = d, center = FALSE)
mCoxS2 <- coxph(Surv(time, event) ~ strata(X1)+strata(X2), data = d)
CoxLP(mCoxS2, data = d, center = FALSE)
##
library(rms)
mCox <- cph(Surv(time, event) ~ X1+X2, data = d, y = TRUE)
CoxLP(mCox, data = d, center = FALSE)
CoxLP(mCox, data = d, center = TRUE)
CoxLP(mCox, data = NULL, center = FALSE)
CoxLP(mCox, data = NULL, center = TRUE)
mCoxS <- cph(Surv(time, event) ~ strat(X1)+X2, data = d)
CoxLP(mCoxS, data = d, center = FALSE)
mCoxS2 <- cph(Surv(time, event) ~ strat(X1)+strat(X2), data = d, y = TRUE)
CoxLP(mCoxS2, data = d, center = FALSE)
##
library(mets)
mCox <- phreg(Surv(entry, time, event) ~ X1+X2, data = d)
CoxLP(mCox, data = NULL, center = FALSE)
CoxLP(mCox, data = d, center = TRUE)
mCoxS <- phreg(Surv(entry, time, event) ~ strata(X1)+X2+cluster(id), data = d)
CoxLP(mCoxS, data = d, center = FALSE)
mCoxS2 <- phreg(Surv(entry, time, event) ~ X1*X2, data = d)
CoxLP(mCoxS2, data = d, center = FALSE)
Run the code above in your browser using DataLab