if (FALSE) {
# Calculate probabilties for a range of time values for a
# piecewise exponential distribution with hazard rates
# 0.025, 0.04, 0.015, and 0.007 in the intervals
# [0, 6), [6, 9), [9, 15), [15, Inf), respectively,
# and re-return the time values:
piecewiseSurvivalTime <- list(
"0 - <6" = 0.025,
"6 - <9" = 0.04,
"9 - <15" = 0.015,
">=15" = 0.01
)
y <- getPiecewiseExponentialDistribution(seq(0, 150, 15),
piecewiseSurvivalTime = piecewiseSurvivalTime
)
getPiecewiseExponentialQuantile(y,
piecewiseSurvivalTime = piecewiseSurvivalTime
)
}
Run the code above in your browser using DataLab