# NOT RUN {
recruit <- PieceR(matrix(c(rep(1,12),10,15,25,30,45,60,55,50,65,60,55,30),ncol=2),1)
trial_long <- simulate_trials(active_ecurve=Weibull(50,0.8),control_ecurve=Weibull(50,0.8),
rcurve=recruit,fix_events=200, iterations=1,seed=12345,detailed_output=TRUE)
trial_short <- set_assess_time(data=trial_long,time=10,detailed_output = FALSE)
maxtime <- max(ceiling(trial_long[,"Assess"]))
events <- rep(NA,maxtime)
for (i in 1:maxtime){events[i] <- sum(1-set_assess_time(trial_long,i)[,"Censored"])}
predictions <- event_prediction(data=trial_short, Event="Censored", censoringOne=TRUE,
type="Weibull", rcurve=recruit, max_time=60, condition=TRUE, cond_Events=49, cond_NatRisk=451,
cond_Time=10, units="Months")
plot_ep(predictions,trajectory="conditional",which_CI="conditional",max_time=40,observed=events,
target=200,max_E=200)
plot_ep(predictions,trajectory="unconditional",which_CI="unconditional",max_time=40,
observed=events,target=200,max_E=200)
plot_ep(predictions,trajectory="conditional",which_CI="none",observed=events[1:10],max_time=20,
max_E=150)
# }
Run the code above in your browser using DataLab