# List of all parameters
parameters = list()
# Load the built-in data set with the patient enrollment, event and dropout
# information (EventPredData)
parameters$data_set = EventPredData
# Future time points for computing event predictions
parameters$time_points = seq(from = 12, to = 24, by = 1)
# Prior distribution for the event hazard rate based on the
# expected median time of 15 months and the uncertainty parameter of 0.3
parameters$event_prior_distribution =
EventPredPriorDistribution(expected = log(2) / 15, uncertainty = 0.3)
# Prior distribution for the patient dropout hazard rate based on the
# expected median time of 80 months and the uncertainty parameter of 0.3
parameters$dropout_prior_distribution =
EventPredPriorDistribution(expected = log(2) / 80, uncertainty = 0.3)
# Prior distribution for the patient enrollment rate based on the
# expected enrollment rate of 35 patients per month and the uncertainty
# parameter of 0.3
parameters$enrollment_prior_distribution =
EventPredPriorDistribution(expected = 35, uncertainty = 0.3)
# Number of simulations, you should prefer more
parameters$nsims = 100
# Number of cores for parallel calculations
parameters$ncores = 1
# Remove this parameter in your code:
parameters$withoutCharts = TRUE
# Forecast the number of events at the pre-defined time points
results = EventPred(parameters)
# Generate a simulation report (remove tempfile)
GenerateReport(results,
tempfile("EventPred.docx", fileext=".docx"))
Run the code above in your browser using DataLab