if (FALSE) {
## fitting copula model
test <- timeroc_obj(dist = 'gompertz-gompertz-copula', copula = "gumbel90")
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=500,
params.t = c(shape=3,rate=1),
params.x = c(shape=1,rate=2),
params.copula=-5) # name of parameter must follow standard
plot(t~x, rr)
start.t <- Sys.time()
cc <- timeroc_fit(rr$x, rr$t, rr$event, obj = test)
print(Sys.time()-start.t)
## fitting PH model
test <- timeroc_obj(dist = 'weibull-lognormal-PH')
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=100,
params.t = c(meanlog=0, sdlog=1),
params.x = c(shape=2, scale=1),
params.ph=0.5) # name of parameter must follow standard
plot(t~x, rr)
start.t <- Sys.time()
cc <- timeroc_fit(rr$x, rr$t, rr$event, obj = test)
print(Sys.time()-start.t)
}
Run the code above in your browser using DataLab