# \donttest{
# Single HR value
prob <- compute_detection_probability(
theta = 1.5,
n_sg = 60,
prop_cens = 0.2,
hr_threshold = 1.25
)
# Vector of HR values for power curve
hr_values <- seq(1.0, 2.5, by = 0.1)
results <- compute_detection_probability(
theta = hr_values,
n_sg = 60,
prop_cens = 0.2,
hr_threshold = 1.25,
verbose = TRUE
)
# Plot detection probability curve
plot(results$theta, results$probability, type = "l",
xlab = "True HR", ylab = "P(detect)")
# }
Run the code above in your browser using DataLab