From deaths to life expectancy

BE
Latest release: 2026-02-10Next release: 2027-02-09

Introduction

The consolidated population accounts are compiled for the whole country and for defined geographical divisions. The tables of the population accounts contain stock and events by, among other things, year of birth, gender and place of birth and thereby give a reproducible basis for mortality calculations.

The demographic events can be broken down by birth cohort and calendar year. In addition, the Lexis triangle indicates whether the event occurs before or after the birthday in the calendar year. The events can therefore be compiled as:

  1. age and calendar year at the event,
  2. birth cohort and calendar year at the event or
  3. birth cohort through the first year of life.

When mortality is calculated for a small population, the annual observations at many ages are few. Calculations are therefore shown for 1, 2 and 5 years, while the 5-year basis is used as the standard in the published interpretation.

In the code behind this document, gender, age, place of birth and calculation period can be adjusted. By default, men aged 67, born in Greenland, are shown here for the period 2021-2025.

The document describes the calculation method behind the Statbank table BEELTALL.

Death rate and probability of death

Two related but different measures are used when calculating mortality: the death rate (central death rate), \(m_x\), and the probability of death, \(q_x\).

\[ m_x = \frac{D_x}{E_x} \]

where \(D_x\) is the number of deaths and \(E_x\) is the time at risk lived through, here approximated by the mean population.

\[ q_x = P(\text{death before age }x+1 \mid \text{alive at exact age }x) \]

\(D_x/E_x\) is thus a rate \(m_x\) and not directly a probability \(q_x\).

The life table is calculated directly from the age-specific death rates \(m_x\). For the closed one-year age intervals 0-98, a constant force of mortality within the interval is assumed:

\[ q_x = 1 - e^{-m_x}. \]

With \(p_x = 1-q_x\) and a radix of \(l_0=1000\), the survivors are calculated recursively as

\[ l_{x+1}=l_xp_x, \]

and the number of deaths as \(d_x=l_xq_x\). The person-years lived in the interval are calculated as

\[ L_x=\frac{d_x}{m_x}, \]

with \(L_x=l_x\) when \(m_x=0\). \(T_x\) is then calculated as the sum of the remaining person-years from age \(x\) and the remaining life expectancy as

\[ e_x=\frac{T_x}{l_x}. \]

For 0-year-olds in the B calculation the complete birth cohort is used: \(q_0\) is calculated as deaths before the 1st birthday divided by live births. This probability is first converted to the equivalent death rate

\[ m_0 = -\log(1-q_0), \]

so that the same calculation procedure can be used for all ages.

The life table is calculated internally to age 99. It is noted that very few persons born in Greenland have reached the age of 100. Age 99 is treated as an open 99+ interval with \(q_{99}=1\) and \(L_{99}=l_{99}/m_{99}\), while the Statbank output is still limited to ages 0-95. The calculation method is thus fully explicit in the R code without dependence on an external life table function.

A period must not disappear from the result because a single age-specific death rate is missing. Before the life table is calculated, all combinations are therefore completed to ages 0-99. Missing or invalid death rates are filled in according to a fixed fallback order: first from the same age in an available period, then from the total for gender or place of birth, and finally by interpolation between ages within the same period. For the open 99+ interval \(m_{99}=0\) cannot be used, because \(L_{99}=l_{99}/m_{99}\); an observed zero rate is therefore treated as missing and replaced according to the same fallback order. If it is still zero or missing, the nearest lower age in the same table with a positive death rate is used as the final closure. All replacements are logged internally. If a death rate still cannot be determined, the calculation stops instead of leaving out the period.

A period life table describes a synthetic generation which is assumed to be exposed throughout life to the age-specific mortality conditions of the selected period. It therefore does not describe the actual length of life of a given birth cohort.

Calculation results are saved in a PX file, ready for the Statbank or PxWin. The PX file is created with the R package of Statistics Greenland pxmake .

Calculation method

When mortality is calculated in a small population, the number of events at individual ages is often modest. To be able to assess the effect, mortality is calculated on the basis of 1, 2 and 5 years respectively.

Three Lexis-based compilations are shown here: A groups by age and calendar year, B groups by birth cohort and calendar year, and a separate C calculation for the first year of life.

In A groups, persons of different birth cohorts are gathered within the same age and calendar year. In B groups the same birth cohort is followed through the calendar year. For 0-year-olds the probability of death is calculated directly from birth to the 1st birthday.

Method (A): age and calendar year, Lexis squares (a groups)

Lexis squares (age at death and calendar year) are the least data-demanding calculation method and are often used in calculations for larger populations.

The death rate, mx, is calculated as the number of deaths at age x divided by the mean population in the same period.

These figures can be found in the ordinary population statistics: Age 67 at the beginning of the year and age 67 at the end of the year = age 68 at the beginning of the following year.

Death rate, mx (age 67) = 42 / 1,230.0 = 0.0341
Emigration rate (age 67) = 14 / 1,230.0 = 0.0114

Figure 2. Lexis squares, Case: mænd, født i Grønland (2021 - 2025)

Method (B): birth cohort and calendar year, Lexis vertical parallelograms (b groups)

With Lexis vertical parallelograms, death rates are calculated for the same birth cohort within a calendar year; the parallelogram therefore spans two ages. The correction item is here approximately equal to zero and will primarily be due to delayed reports to the administrative population register, which even out over time.

For each parallelogram the death rate is calculated as the sum of deaths divided by the sum of the mean population. The death rate for age x is then calculated as the average of the two adjacent parallelogram rates that cover age x.

Death rate, mx (age 67) = 0.0583 / 2 = 0.0292
Emigration rate (age 67) = 0.0278 / 2 = 0.0139

Figure 3. Lexis, vertical parallelograms, Case: mænd, født i Grønland (2021 - 2025)

Method (C): birth cohort, first year of life, Lexis horizontal parallelograms

In the first year of life the probability of death is calculated directly from birth to the 1st birthday as the number of deaths before age 1 divided by the number of live births in the same birth cohort. Births and deaths are classified by the place of birth of the child in the consolidated population accounts.

Figure 4. Lexis, horizontal parallelograms, Case: mænd, født i Grønland (2021 - 2025)

Mortality

The figures show the probability of death, qx, by age for men and women for the selected 5-year period, 2021 - 2025. Method A is based on Lexis squares, while method B is based on birth cohorts in vertical parallelograms. The calculation does not allow a period to disappear silently because of a missing age-specific rate.

Men, født i Grønland, 2021 - 2025

Women, født i Grønland, 2021 - 2025

Statbank table

Datagrundlaget til BEXLTALL.px dannes i tre trin. Først beregnes overlevelsestavlerne direkte i R og samles i lt_all. Derefter omformes lt_all til px_data_lt, og til sidst dannes selve PX-filen med pxmake. De tre kodeblokke nedenfor kan foldes ud hver for sig.

Ved denne kørsel er PX-dannelse deaktiveret. Sæt make_px <- TRUE i setup for at danne BEXLTALL.px.

R-kode til direkte dannelse af lt_all
# Direct period life-table calculation
#
# Closed one-year intervals 0-98:
# qx = 1 - exp(-mx)
# px = 1 - qx
# l(x+1) = lx * px
# dx = lx * qx
# Lx = dx / mx, and Lx = lx when mx = 0
#
# Open interval 99+:
# q99 = 1
# L99 = l99 / m99
#
# Finally:
# Tx = sum of Lx from age x and above
# ex = Tx / lx
# -------------------------------------------------------------------

make_lifetable <- function(mx, radix = 1000) {

x <- 0:99

if (
length(mx) != length(x) ||
any(!is.finite(mx)) ||
any(mx < 0) ||
!is.finite(mx[length(mx)]) ||
mx[length(mx)] <= 0
) {
stop("Ugyldigt mx-grundlag til overlevelsestavlen.")
}

# Death probabilities in the closed one-year intervals.
# -expm1(-mx) is numerically stable for very small mx.
qx <- -expm1(-mx)
qx[length(qx)] <- 1

px <- 1 - qx

# Survivors at exact age x.
lx <- numeric(length(x))
lx[1] <- radix

for (i in seq_len(length(x) - 1L)) {
lx[i + 1L] <- lx[i] * px[i]
}

# Deaths in each age interval.
dx <- lx * qx

# Person-years lived.
Lx <- numeric(length(x))

closed <- seq_len(length(x) - 1L)

Lx[closed] <- ifelse(
mx[closed] > 0,
dx[closed] / mx[closed],
lx[closed]
)

# Open interval 99+.
Lx[length(x)] <- lx[length(x)] / mx[length(x)]

# Remaining person-years and life expectancy.
Tx <- rev(cumsum(rev(Lx)))
ex <- Tx / lx

out <- tibble(
x = x,
mx = mx,
qx = qx,
lx = lx,
dx = dx,
Lx = Lx,
Tx = Tx,
ex = ex
)

# Internal consistency checks.
if (
any(out$qx < 0 | out$qx > 1) ||
any(diff(out$lx) > 1e-10) ||
any(!is.finite(out$Lx)) ||
any(!is.finite(out$Tx)) ||
any(!is.finite(out$ex)) ||
any(out$ex < 0)
) {
stop("Intern kontrol af overlevelsestavlen fejlede.")
}

out
}

lt_funk <- function(p, e, y, s, n) {

dat <- mortality_inputs_ready %>%
filter(
pob == p,
period == y,
sex == s,
src == e,
nop == n
) %>%
arrange(age)

x <- 0:99

if (
nrow(dat) != length(x) ||
!identical(dat$age, x) ||
any(!is.finite(dat$mx)) ||
any(dat$mx < 0) ||
dat$mx[dat$age == 99L] <= 0
) {
stop(
paste0(
"Ufuldstændig overlevelsestavle: ",
"pob=", p,
", sex=", s,
", metode=", e,
", periode=", y,
", grundlag=", n,
", mx99=", dat$mx[dat$age == 99L]
)
)
}

make_lifetable(
mx = dat$mx,
radix = 1000
) %>%
mutate(nop = n)
}

lt_all <- tibble()

for (p in pob_values) {
for (e in src_values) {
for (s in sex_values) {
for (n in basis_values) {
for (y in period_values) {
tmp <- lt_funk(p, e, y, s, n)

lt_all <- bind_rows(
lt_all,
tmp %>%
mutate(
time = y,
pob = p,
sex = s,
type = e
)
)
}
}
}
}
}
R-kode til dannelse af px_data_lt
# Public table remains 0-95 for compatibility with the existing PX metadata.
px_data_lt <- lt_all %>%
filter(x <= 95) %>%
select(time, pob, nop, x, sex, type, mx, qx, lx, ex) %>%
pivot_longer(
cols = c(mx, qx, lx, ex),
names_to = "measure"
) %>%
mutate(age = as.character(x)) %>%
select(time, pob, nop, age, sex, calcbase = type, measure, value) %>%
drop_na(value) %>%
filter(time >= 1985, is.finite(value))
R-kode til dannelse af BEXLTALL.px
# Setup
make_px <- TRUE

# Optional PX production
px_output_file <- file.path(resultsPath, "BEXLTALL.px")

if (make_px) {

lastupdated <- format(Sys.time(), "%Y%m%d %H:%M")
nextupdate <- paste0(baseYear + 1, "0210 09:00")

# Reuse metadata from the existing StatBank table
z <- px("https://bank.stat.gl/Resources/PX/Databases/Greenland/BE/BE10/BE20/BEXLTALL.px") |>
px_last_updated(lastupdated) |>
px_next_update(nextupdate)

# Convert px_data_lt to a PX object
x <- px(
px_data_lt |>
rename("figures_" = value)
)

# Keep metadata and replace only the data
z$data <- x$data

# Save the new PX file
px_save(z, px_output_file)
}

Contact

The text on this page was translated with AI assistance. Graphs, tables and key figures are not AI-generated.

Rendered