---
title: "What is a Micromort?"
subtitle: "A visual introduction to everyday risk — then test yourself"
format:
  closeread-html:
    code-fold: true
    code-summary: "Show code"
    remove-header-space: true
    css: closeread-standalone.css
vignette: >
  %\VignetteIndexEntry{What is a Micromort?}
  %\VignetteEngine{quarto::html}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE, comment = "", echo = FALSE,
  fig.width = 8, fig.height = 5, dpi = 150,
  warning = FALSE, message = FALSE
)
pkg_root <- tryCatch(rprojroot::find_root(rprojroot::is_r_package), error = function(e) ".")
source(file.path(pkg_root, "inst", "vignette_utils.R"))
if (requireNamespace("micromort", quietly = TRUE)) {
  library(micromort)
} else {
  pkgload::load_all(quiet = TRUE)
}
library(ggplot2)
library(dplyr)
library(plotly)

# Shared plotly dark theme
dark_plotly <- function(p) {
  p |> layout(
    paper_bgcolor = "#1a1a2e", plot_bgcolor = "#1a1a2e",
    font = list(color = "#e0e0e0", size = 13),
    xaxis = list(gridcolor = "#333355", zerolinecolor = "#333355"),
    yaxis = list(gridcolor = "#333355"),
    legend = list(bgcolor = "#1a1a2e", font = list(color = "#e0e0e0"))
  ) |> config(displayModeBar = FALSE)
}

# Format mm for display
fmt_mm <- function(x) {
  ifelse(x >= 1000, paste0(format(round(x, -2), big.mark = ","), " mm"),
  ifelse(x >= 1, paste0(round(x, 1), " mm"),
         paste0(x, " mm")))
}
```

```{css}
.cr-section .narrative-col p,
.cr-section .narrative-col li {
  font-size: 1.25rem;
  line-height: 1.8;
}
.cr-section .narrative-col h3 {
  font-size: 1.6rem;
}
```

:::{.cr-section}

### How dangerous is your morning?

Every morning involves risk. Brewing coffee. Crossing the road. Commuting to work. Each activity carries a measurable probability of death.[@cr-mundane]{focus-on="cr-mundane"}

A **micromort (mm)** is a one-in-a-million chance of death from a single activity.

```{r mundane-table}
#| echo: false
show_target("vig_whatis_mundane_table",
  caption = "Six mundane activities ranked by micromorts (mm). Ratio vs coffee = mm / coffee mm. All rows are acute per-event risks from common_risks(). Source: micromort package.")
```

All of these are **below 1 mm** — risks so small we never perceive them as dangerous.

```{r mundane-comparison-sentence, results='asis', echo=FALSE}
cat(safe_tar_read("vig_whatis_mundane_comparison_sentence") %||% "")
```

Hover over the bars to compare.

:::{#cr-mundane}
```{r mundane-plot}
show_target("vig_whatis_mundane_plot")
```
:::

:::


:::{.cr-section}

### The full spectrum

Now zoom out. Hover over any dot to see the activity name and micromort value.[@cr-spectrum]{focus-on="cr-spectrum"}

The micromort scale spans **six orders of magnitude** — from a dental X-ray (0.05 mm) to summiting Everest (~38,000 mm).

**Bottom** (< 1 mm): daily activities — commuting, coffee, office work, dental X-rays. Risks so small we never notice them.

**Middle** (1–100 mm): risks we weigh consciously — a night in hospital (75 mm), general anaesthesia (10 mm), a long-haul flight (4 mm), running a marathon (7 mm).

**Top** (> 100 mm): risks that make headlines — base jumping (430 mm per jump), Himalayan mountaineering (12,000 mm), **Everest at ~38,000 mm — roughly a 4% chance of death per ascent**.

:::{#cr-spectrum}
```{r spectrum-plot}
show_target("vig_whatis_spectrum_plot")
```
:::

:::


:::{.cr-section}

### The slow burn

Not all risks kill in an instant.[@cr-chronic]{focus-on="cr-chronic"}

Some shorten your life by half an hour, every single day. David Spiegelhalter called these **microlives (ml)** — each one worth 30 minutes of life expectancy.

**Smoking 20 cigarettes a day costs 10 microlives.** That is 10 × 30 = 300 minutes = **5 hours of life, lost every 24 hours.** A heavy smoker lives as though the day were only 19 hours long.

The scale works in reverse too. **150 minutes of weekly exercise gains 3 ml/day.** Five servings of fruit and vegetables: **+4 ml/day** — yes, diet can outweigh exercise in Spiegelhalter's estimates (both from the BMJ 2012 paper). A Mediterranean diet: +2 ml/day.

Hover over the bars to explore. Red = life lost. Green = life gained.

:::{#cr-chronic}
```{r chronic-plot}
show_target("vig_whatis_chronic_plot")
```
:::

:::


:::{.cr-section}

### The bridge

How do you compare a skydive to a cigarette? One kills instantly (rarely). The other kills slowly (certainly, at scale).[@cr-bridge]{focus-on="cr-bridge"}

The answer is **Loss of Life Expectancy (LLE)** — the average time lost or gained per exposure.

One micromort costs roughly **21 minutes** of life expectancy. One microlife is **30 minutes**. So 1 mm ≈ 0.7 ml.

The UK Department for Transport values a micromort at **£1.60**. NICE values a microlife at **£1.70**. Two independent government agencies, nearly the same price for a unit of risk.

:::{#cr-bridge}

| Unit | Abbreviation | Definition | Example |
|------|:---:|-----------|---------|
| **Micromort** | mm | 1-in-a-million death probability | Skydiving (per jump) = 10 mm |
| **Microlife** | ml/day | 30 min of life expectancy per day | Smoking 2 cigs/day = −1 ml/day |
| **LLE** | min | Loss of Life Expectancy | 1 mm ≈ 21 min ≈ 0.7 ml |
| **£ value** | £ | NICE/DfT policy valuation | 1 mm ≈ £1.60 ≈ 1 ml/day |

: The three currencies of risk and the exchange rate between them. {.striped}

:::

:::


:::{.cr-section}

### Now test yourself

You now have three currencies for risk — micromorts (mm), microlives (ml/day), and loss of life expectancy (LLE).[@cr-quiz]{focus-on="cr-quiz"}

You know that coffee is 0.01 mm and Everest is ~38,000 mm. You know that smoking costs 10 ml/day and exercise gains 3 ml/day. But how good is your intuition? Three quizzes, three formats:

**☠️ Micromort Quiz** — which activity is riskier? Pick A or B. Covers acute risks from skydiving to surgery.

**⏳ Microlife Quiz** — which daily habit has the bigger effect on your lifespan? Smoking vs diet vs exercise.

**📊 Rank Risks Quiz** — drag and drop 4 items into the correct order. Mixes acute and chronic risks on the same scale.

:::{#cr-quiz}

::: {style="background:#2b3e50;border-radius:12px;padding:28px;color:#fff;text-align:center;"}

### Ready?

[**☠️ Micromort Quiz**](micromort-quiz.html){.btn .btn-danger .btn-lg style="margin:8px;display:block;"}

Which event is more likely to kill you?

[**⏳ Microlife Quiz**](microlife-quiz.html){.btn .btn-success .btn-lg style="margin:8px;display:block;"}

Which daily habit has the bigger effect?

[**📊 Rank Risks Quiz**](risk-ranking-quiz.html){.btn .btn-primary .btn-lg style="margin:8px;display:block;"}

Rank 4 risks from biggest to smallest effect.

:::

:::

:::

<details>
<summary>Session Info</summary>
```{r session-info, eval=TRUE}
sessionInfo()
```
</details>

```{r build-info}
#| echo: false
#| results: asis
bi <- tryCatch(
  targets::tar_read_raw("vig_build_info",
    store = tryCatch(file.path(rprojroot::find_root(rprojroot::is_r_package), "_targets"),
                     error = function(e) "_targets")),
  error = function(e) NULL
)
if (!is.null(bi)) cat(bi)
```
