Signature
h = -log(1 - p) / Delta
| Inputs | Definition | Unit |
|---|---|---|
p | Probability of the event over the interval in which it was observed | probability from 0 to 1, excluding 1 |
Delta | Length of the interval over which p was observed | time, for example years |
h | Constant hazard of the event implied by the observed probability | events per person per unit of time |
|---|
Function
Rate and transition probability conversion function
Maps an event rate and a time interval to the probability that the event occurs within that interval, and back again. Rates are converted rather than probabilities divided, because a probability is tied to the length of the interval over which it was observed. The converted probability then enters a transition matrix used in the cohort update s_(t+1) = s_t P described on the Markov Model page.
Computational function
Computational function: annual probability to a model-cycle transition probability
Takes an annual probability, the form in which many sources report risk, and a cycle length in months, and returns the cycle probability in two steps. It first recovers the implied constant rate with HE-FM-TP-002 and then converts that rate to the cycle probability with HE-FM-TP-001, so two formulae are chained inside one function and the second step uses the result of the first. The answer equals the single-step rescaling formula HE-FM-TP-003, which gives a cross-check.
Inputs and outputs:
p_annual: Probability that the event occurs within one year, as reported by the source; required, from 0 up to but not including 1. Unit: probability from 0 to 1.;L_months: Length of one model cycle in months; required, above zero. Unit: months.;r_annual: Constant annual rate implied by the annual probability, returned as an intermediate output. Unit: events per person-year.;p_cycle: Probability that the event occurs within one model cycle. Unit: probability from 0 to 1.Assumption: The annual probability arises from a constant rate within the year, and only one event leads out of the starting state. With competing exits the cause-specific rates are separated first, as in HE-FM-TP-004.
Worked example (Annual risk of 0.20 in a monthly model): An annual probability of 0.20 implies a rate of about 0.2231 a year and a monthly probability of about 0.0184, the same value as HE-EX-TP-005 and the transition probability article.
p_annual = 0.20; L_months = 1; r_annual = 0.223144; p_cycle = 0.018423Worked example (Twelve-month cycle returns the annual probability): With a 12-month cycle the two steps return the original annual probability of 0.20, a limiting case that checks the implementation.
p_annual = 0.20; L_months = 12; r_annual = 0.223144; p_cycle = 0.20Excel:
=1-EXP(LN(1-AnnualProb)*CycleMonths/12)Both steps in one cell, with the annual probability in AnnualProb and the cycle length in months in CycleMonths. The equivalent form =1-(1-AnnualProb)^(CycleMonths/12) gives the same result.R:
cycle_prob_from_annual <- function(annual_prob, cycle_months) { annual_rate <- -log(1-annual_prob); 1-exp(-annual_rate * cycle_months / 12) }Two steps that return the cycle probability; the intermediate rate can be kept for reporting.Python:
def cycle_prob_from_annual(annual_prob, cycle_months): annual_rate = -math.log(1-annual_prob); return 1-math.exp(-annual_rate * cycle_months / 12)Two steps with the math module, where math.log is the natural logarithm.Test (Two-step result matches the single-step rescaling formula): The two-step function and the rescaling formula HE-FM-TP-003 return the same cycle probability. Expected result: TRUE. Excel check:
=ABS((1-EXP(LN(1-AnnualProb)*CycleMonths/12))-(1-(1-AnnualProb)^(CycleMonths/12)))<1E-9Common error (Passing an annual probability into the rate function): Entering an annual probability of 0.20 as if it were a rate gives a monthly probability of about 0.0165 instead of 0.0184, because the probability understates the underlying rate. The input has to go through the probability to rate step first.
Source: Chhatwal J, Jayasuriya S, Elbasha EH. Changing cycle lengths in state-transition models: challenges and solutions. Medical Decision Making. 2016;36(8):952-964. Section on the traditional approach, which converts the probability to a rate and back for the new cycle length and gives the equivalent rescaling formula.
r_annual = -log(1 - p_annual); p_cycle = 1 - exp(-r_annual * L_months / 12)
Try this function
Implementations
Excel
Rate from a probability in one cell
Excel uses LN, the natural logarithm, on named cells holding the probability and the length of its observation interval.
=-LN(1-Probability)/Interval
Assumptions
Constant hazard over the observation period
The implied rate is an average constant hazard. If the hazard rose or fell during the observation period, the rate describes neither the start nor the end of the period.
Worked examples
One-year probability of 0.20
A one-year probability of 0.20 implies a constant rate of about 0.2231 per year, as in the article's rate conversion example.
p = 0.20; Delta = 1; h = 0.2231
Five-year probability of 0.10
A study reports that 10% of people had the event over five years. The implied constant rate is about 0.0211 per year, slightly above 0.10 divided by 5.
p = 0.10; Delta = 5; h = 0.0211
Common errors
Using Excel LOG instead of LN
Excel LOG uses base 10 by default. The formula with LOG gives about 0.0969 per year for a one-year probability of 0.20 instead of 0.2231, understating the rate by a factor of about 2.3.
Sources
Probability to rate conversion in a transition probability tutorial
Gidwani R, Russell LB. Estimating transition probabilities from published evidence: a tutorial for decision modelers. PharmacoEconomics. 2020;38(11):1153-1164. Equation 8 and the worked 12-month to 3-month example.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
