# NOT RUN {
library(survival)
set.seed(10)
n <- 250
tau <- 1:5
d <- sampleData(n, outcome = "competing.risks")
d$Y <- (d$event == 1)*(d$time <= tau[3])
d0 <- d[event!=0] ## remove censoring
## no censoring
e0.wglm <- wglm(regressor.event = ~ X1, formula.censor = Surv(time,event==0) ~ X1,
times = tau, data = d0)
e0.glm <- glm(Y ~ X1, family = binomial, data = d0)
## censoring
e.wglm <- wglm(regressor.event = ~ X1, formula.censor = Surv(time,event==0) ~ X1,
times = tau, data = d)
# }
Run the code above in your browser using DataLab