35.2 Probability/rate conversion functions

The following functions are used to convert between rates and probabilities (or odds).

They generally employ one or both of the arguments rate (or prob) and time. In each case, it is essential that the values for these parameters are based on the same scale. For example, if a rate being converted is in terms of years (such as yearly mortality), the time parameter must also be in years.

Function Explanation

DEALE(rate; time)

DEALE is an acronym for “declining exponential approximation of life expectancy.”

DEALE() function is cumulative, so the time parameter means “over the course of this amount of time.”

OddsToProb(odds)

Converts odds into a probability.

ProbFactor(prob; fac)

First converts the probability to odds, then multiplies it by the given factor, then converts it back to a probability. See OddsToProb and ProbToOdds.

ProbToOdds(prob)

Converts a probability into odds.

ProbToProb(prob; multiplier)

Converts a probability into a rate, multiplies the rate by the given multiplier, and converts back to a probability.

ProbToRate(prob; time)

Converts a probability into a rate, and divides the rate by time.

RateToProb(rate; time)

Multiplies a rate by time, and converts it into a probability.

HazardByRate(prob; hazard_ratio)

Applies a hazard ratio to a probability.

1 - (1 - value)^hazard_ratio

Refer to Healthcare Example model HazardByRate Function.trex.

These functions are sensitive to user errors; you are urged to exercise great care when using them in your models. It is recommended that you use the Calculator/Evaluator to test expressions using these functions.

RateToProb(), as the name suggests, is used to convert a rate into a probability, either for the same time period (in which case you use time=1) or a different time period. For example, if a disease being modeled has a yearly mortality rate of .05, you could convert this to a probability using the formula:

RateToProb(0.05; 1)

This converts the yearly mortality rate to an annual probability of 0.04877 (rounded to 5 d.p.).

ProbToRate provides the reverse function to RateToProb, converting a probability for a given time period to a rate. That means ProbToRate(0.04877;1) equals 0.05 (rounded to 5 d.p.) for the same time period.

Using the additive property of rates, rates for two events can be added together and converted back to a probability to get the probability of two events both occurring.

In both RateToProb and ProbToRate, the time parameter (the second argument) will allow you to convert between a rate with time interval of one length and a probability with time interval of a different length. For example converting between daily, weekly, monthly or annual time intervals.

Consider converting an annual probability of 0.5 to a monthly rate. This could be done via:

probtorate(0.5;1)*(1/12)

This gives a monthly rate of 0.05776. Then, if we wanted the monthly probability from this, we would convert the monthly rate back to a monthly probaility:

ratetoprob(0.05776;1)

to give the monthly probability of 0.05613 (rounded to 5 d.p.).

TreeAge Pro has the ProbToProb function to convert a probability for one cycle length to an equivalent probability for a different cycle length. (You cannot simply multiply the original probability by a factor. Instead, use the ProbToProb function.) The following expression changes an annual probability of 0.5 to a monthly probability:

ProbToProb(0.5; 1/12)

to give the monthly probability of 0.05613 (rounded to 5 d.p.).

Other common probability examples are:

  • Conversion from Annual to Monthly: probtoprob(0.5; 1/12) = 0.05612568731830647

  • Conversion from Annual to Daily: probtoprob(0.5; 1/365.25) = 0.0018959339961140964

  • Conversion from Monthly to Daily: probtoprob(0.05612568731830647 ; ( 1 / (365.25/12) ) ) = 0.0018959339961140964

TreeAge Pro has the HazardByRate function to apply a given Hazard Rate to a probability. If the Hazard Rate is 1, it has no impact on the probability. If the Hazard Rate is greater than 1, then the probability is larger. And if the Hazard Rates is less then one, the probability is smaller.

HazardByRate(prob; hazard_ratio)

An easy example would be: a population taking Tx2 may die at twice the rate compared to those taking Tx1. If the probability of death for Tx2 is pDie_Tx2, then we can calculate the probability of death for Tx1 as:

  • pDie_Tx1 = HazardByRate(pDie_Tx2 ; 2)

Also refer to Healthcare Example model HazardByRate Function.trex for a further example of usage.