---
title: "Nobel Prize Laureates: What We Learned"
format:
html:
toc: true
code-fold: true
embed-resources: true
execute:
warning: false
message: false
---
## Overview
This report collects the results of an exploratory session on the `nobel` dataset (one row per laureate and prize). It looks at three questions:
1. Where were recent physics laureates born?
2. How has the typical age at which laureates receive their prize changed over time?
3. Does that age trend look the same across prize categories?
The data is read from `nobel.csv`, which must sit in the same directory as this file.
```{r setup}
library(ggsql)
library(DBI)
library(duckdb)
library(knitr)
# Load the bundled CSV into an in-memory DuckDB database as the "nobel" table
con <- dbConnect(duckdb::duckdb())
nobel <- read.csv("nobel.csv", stringsAsFactors = FALSE)
dbWriteTable(con, "nobel", nobel, overwrite = TRUE)
```
> **Note:** `{ggsql}` chunks run against their own implicit in-memory DuckDB database, so the chunks below read `nobel.csv` directly by path (aliased as `nobel`). The regular R chunks use the `con` connection created above.
## Physics laureates since 2000
### Who won, year by year
```{r physics-laureates}
physics_by_year <- dbGetQuery(con, "
SELECT award_year,
string_agg(name, ', ' ORDER BY name) AS laureates
FROM nobel
WHERE category = 'Physics' AND award_year >= 2000
GROUP BY award_year
ORDER BY award_year
")
kable(physics_by_year, col.names = c("Award year", "Laureates"))
```
### Birth country of physics laureates
The chart counts physics laureates awarded since 2000 by their birth country (present-day borders). Laureates with no recorded birth country, such as organizations, are excluded.
```{r physics-summary}
physics_country <- dbGetQuery(con, "
SELECT birth_country_now, COUNT(*) AS n
FROM nobel
WHERE category = 'Physics' AND award_year >= 2000 AND birth_country_now IS NOT NULL
GROUP BY birth_country_now
ORDER BY n DESC
")
top_country <- physics_country[1, ]
top_share <- top_country$n / sum(physics_country$n)
```
```{ggsql}
SELECT birth_country_now, COUNT(*) AS n FROM 'nobel.csv' AS nobel WHERE category = 'Physics' AND award_year >= 2000 AND birth_country_now IS NOT NULL GROUP BY birth_country_now
VISUALISE birth_country_now AS x, n AS y
DRAW bar ORDER BY n DESC
SCALE DISCRETE x SETTING reverse => true
PROJECT y, x TO cartesian
LABEL x => 'Birth country (present-day)', y => 'Number of laureates'
```
**What we learned:** Among physics laureates since 2000 with a known birth country, the most common birth country is **`r top_country$birth_country_now`** with `r top_country$n` laureates, about `r sprintf("%.0f%%", 100 * top_share)` of the `r sum(physics_country$n)` counted. In total, `r nrow(physics_country)` different countries are represented.
Caveat: counts are by birth country, not by the country where the research was done (see the `affiliation_country` column for that). Shared prizes also mean that one award year can contribute several laureates.
## Age at award over time
### Rolling 10-year median age, all categories
For each award year from 1910 onward, we take all laureates with a known age who were awarded in that year or the nine years before it, and compute the median age at award. A rolling window smooths out the noise from single years, when only a handful of people receive a prize.
```{r age-summary}
age_roll <- dbGetQuery(con, "
WITH years AS (
SELECT DISTINCT CAST(award_year AS INTEGER) AS yr
FROM nobel WHERE age_at_award IS NOT NULL AND award_year >= 1910
)
SELECT y.yr AS award_year,
quantile_cont(n.age_at_award, 0.5) AS rolling_median_age
FROM years y
JOIN nobel n ON n.age_at_award IS NOT NULL AND n.award_year BETWEEN y.yr - 9 AND y.yr
GROUP BY y.yr
ORDER BY y.yr
")
first_row <- age_roll[1, ]
last_row <- age_roll[nrow(age_roll), ]
```
```{ggsql}
WITH years AS (
SELECT DISTINCT CAST(award_year AS INTEGER) AS yr FROM 'nobel.csv' WHERE age_at_award IS NOT NULL AND award_year >= 1910
)
SELECT y.yr AS award_year,
quantile_cont(n.age_at_award, 0.5) AS rolling_median_age
FROM years y
JOIN 'nobel.csv' n ON n.age_at_award IS NOT NULL AND n.award_year BETWEEN y.yr - 9 AND y.yr
GROUP BY y.yr
ORDER BY y.yr
VISUALISE award_year AS x, rolling_median_age AS y
DRAW line
LABEL x => 'Award year (end of 10-year window)', y => 'Rolling median age at award (years)'
```
**What we learned:** The rolling median age was **`r round(first_row$rolling_median_age, 1)`** years for the window ending in `r first_row$award_year` and **`r round(last_row$rolling_median_age, 1)`** years for the window ending in `r last_row$award_year`. The line shows the path between those two points, so the overall direction and any periods of faster change can be read from the chart.
### Rolling 10-year median age, by category
The same calculation is repeated separately for each prize category. Windows containing fewer than five laureates are dropped so that the medians are not driven by one or two people.
```{ggsql}
WITH cat_years AS (
SELECT DISTINCT category, CAST(award_year AS INTEGER) AS yr
FROM 'nobel.csv' WHERE age_at_award IS NOT NULL
)
SELECT cy.category,
cy.yr AS award_year,
quantile_cont(n.age_at_award, 0.5) AS rolling_median_age
FROM cat_years cy
JOIN 'nobel.csv' n
ON n.category = cy.category
AND n.age_at_award IS NOT NULL
AND n.award_year BETWEEN cy.yr - 9 AND cy.yr
GROUP BY cy.category, cy.yr
HAVING COUNT(*) >= 5 -- skip windows with too few laureates
ORDER BY cy.category, cy.yr
VISUALISE award_year AS x, rolling_median_age AS y
DRAW line
FACET category SETTING ncol => 3
LABEL x => 'Award year (end of 10-year window)', y => 'Rolling median age at award (years)'
```
**What we learned:** Faceting by category shows whether the overall age trend is shared by every prize or driven by a few. Compare the vertical level of each panel (typical age) and its slope (change over time). Categories such as Economic Sciences were introduced later, so their lines start later.
## Summary of findings
- **Geography:** Recent physics laureates come from a small number of countries, with `r top_country$birth_country_now` the most common birth country (`r top_country$n` of `r sum(physics_country$n)` counted laureates).
- **Age overall:** The rolling median age at award moved from `r round(first_row$rolling_median_age, 1)` to `r round(last_row$rolling_median_age, 1)` years between the first and last windows.
- **Age by category:** Categories differ in both their typical age and how it has changed, so the overall trend should not be assumed to hold for each prize.
### Caveats and next steps
- Rolling windows are defined by award year and overlap, so neighbouring points are not independent.
- Birth country reflects present-day borders (`birth_country_now`) and may differ from the country at the time of birth.
- Natural follow-ups: compare affiliation country with birth country, and look at how the number of shared prizes (`n_shared`) relates to laureate age.
```{r cleanup, include=FALSE}
dbDisconnect(con, shutdown = TRUE)
```