#Section 4 library("TPmsm") setThreadsTP(1) seed <- c(2718, 3141, 5436, 6282, 8154, 9423) setPackageSeedTP(seed) sim_data_exp <- dgpTP(n = 1000, corr = 0, dist = "exponential", dist.par = c(1, 1), model.cens = "uniform", cens.par = 3, state2.prob = 0.5) transAJ(object = sim_data_exp, s = 0.5108, t = 0.9163, conf = TRUE, conf.level = 0.95, n.boot = 1000) transPAJ(object = sim_data_exp, s = 0.5108, t = 0.9163, conf = TRUE, conf.level = 0.95, n.boot = 1000) setPackageSeedTP(seed) sim_data_exp2 <- dgpTP(n = 1000, corr = 1, dist = "exponential", dist.par = c(1, 1), model.cens = "uniform", cens.par = 3, state2.prob = 0.5) transKMW(object = sim_data_exp2, s = 0.5108, t = 0.9163, conf = TRUE, conf.level = 0.95, n.boot = 1000) transKMPW(object = sim_data_exp2, s = 0.5108, t = 0.9163, conf = TRUE, conf.level = 0.95, n.boot = 1000) #Section 5 data("colonTP", package = "TPmsm") head(head(colonTP[ , c(1:4, 7)])) colon_obj <- with(colonTP, survTP(time1, event1, Stime, event, age)) colon_obj_TP <- transKMW(object = colon_obj, s = 365, t = 1096, conf = TRUE, conf.level = 0.95) colon_obj_TP colon_obj2_TP <- transKMPW(object = colon_obj, s = 365, t = 1096, conf = TRUE, conf.level = 0.95) colon_obj2_TP #Figure 2 colon_obj_TP <- transKMW(object = colon_obj, s = 365, conf = TRUE, conf.level = 0.95) plot(colon_obj_TP, col = seq_len(5), lty = 1, ylab = "p_hj(365,t)") #Figure 3 plot(colon_obj_TP, tr.choice = "1 2", conf.int = TRUE, ylim = c(0, 0.2), legend = FALSE, ylab = "p12(365,t)") CTP_obj <- transIPCW(colon_obj, s = 365, t = 1096, x = c(40, 68), conf = TRUE, n.boot = 1000, method.boot = "percentile") CTP_obj #Figure 4 plot(CTP_obj, plot.type = "c", tr.choice = "1 1", conf.int = TRUE, xlab = "Age", legend = FALSE, ylab = "p11(365,1096|age)") #Figure 5 plot(CTP_obj, plot.type = "c", tr.choice = "1 2", conf.int = TRUE, xlab = "Age", legend = FALSE, ylab = "p12(365,1096|age)") #Figure 6 plot(CTP_obj, plot.type = "c", col = seq_len(5), lty = 1, xlab = "Age", ylab = "p_hj(365,1096|age)") data("bladderTP", package = "TPmsm") head(bladderTP) bladderTP_obj <- with(bladderTP, survTP(time1, event1, Stime, event)) LS_obj <- transLS(object = bladderTP_obj, s = 3, t = 8, h = c(0.0001, 1), nh = 100, ncv = 100, conf = TRUE) LS_obj LS2_obj <- transLS(object = bladderTP_obj, s = 3, t = 60, h = c(0.0001, 1), nh = 100, ncv = 100, conf = TRUE) #Figure 7 plot(LS2_obj, col = seq_len(5), lty = 1, ylab = "p_hj(3,t)") #Figure 8 plot(LS2_obj, tr.choice = "1 2", conf.int = TRUE, ylab = "p12(3,t)", ylim = c(0, 0.35), legend = FALSE)