Skip to content

geodalib / core/src / excessRisk

Function: excessRisk()

excessRisk(baseValues, eventValues): number[]

Defined in: core/src/mapping/rates.ts:101

Description

Compute excess risk (relative risk), the ratio of the observed rate at a location to some reference rate.

The reference risk (π¯) is estimated from the aggregate of all observations as: π¯=OiPi where Oi is the observed number of events and Pi is the population/denominator. This is not a simple average of rates, but rather a population-weighted average that properly assigns the contribution of each area to the overall total.

The expected value (Ei) for each observation is then calculated as: Ei=π¯×Pi

The relative risk (RRi) then follows as: RRi=riπi¯=Oi/PiEi/Pi=OiEi

If an area matches the (regional) reference rate, the corresponding relative risk is one. Values greater than one suggest an excess, whereas values smaller than one suggest a shortfall. The interpretation depends on the context. For example, in disease analysis, a relative risk larger than one would indicate an area where the prevalence of the disease is greater than would be expected. In regional economics, a location quotient greater than one, suggests employment in a sector that exceeds the local needs, implying an export sector.

In public health, this ratio is known as standardized mortality rate (SMR). In regional economics, when applied to employment sectors, it's called a location quotient (LQ).

Parameters

baseValues

number[]

The values of base variable.

eventValues

number[]

The values of event variable.

Returns

number[]

The rates values.

Example

ts
import { excessRisk } from 'geoda-lib';
const baseValues = [100, 200, 300, 400, 500];
const eventValues = [10, 20, 30, 40, 50];
const rates = excessRisk(baseValues, eventValues);