I will use both Nobel Prize APIs to pull laureate and prize data as JSON into R, looping through the paginated results until every record is collected. The data will load directly from the API URLs, and I will flatten the nested JSON into two tidy data frames, one row per laureate-prize and one row per prize, pulling out fields like birth country, gender, category, and affiliation along the way.
I plan to ask four questions. Each question will include the question, the code, and the answer as a table or plot. I expect to handle organizations with no birth or gender data, incomplete birth dates, and years when no prize was awarded explicitly.
Code Base
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.6.1
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.1 ✔ readr 2.2.0
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.3 ✔ tibble 3.3.1
✔ lubridate 1.9.5 ✔ tidyr 1.3.2
✔ purrr 1.2.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(jsonlite)
Attaching package: 'jsonlite'
The following object is masked from 'package:purrr':
flatten
# A tibble: 1,028 × 7
id name org_name gender birth_date birth_country prizes
<chr> <chr> <chr> <chr> <chr> <chr> <list>
1 745 A. Michael Spence <NA> male 1943-11-07 USA <list [1]>
2 102 Aage N. Bohr <NA> male 1922-06-19 Denmark <list [1]>
3 779 Aaron Ciechanover <NA> male 1947-10-01 Israel <list [1]>
4 259 Aaron Klug <NA> male 1926-08-11 Lithuania <list [1]>
5 1004 Abdulrazak Gurnah <NA> male 1948-00-00 <NA> <list [1]>
6 114 Abdus Salam <NA> male 1926-01-29 Pakistan <list [1]>
7 982 Abhijit Banerjee <NA> male 1961-02-21 India <list [1]>
8 981 Abiy Ahmed Ali <NA> male 1976-08-15 Ethiopia <list [1]>
9 843 Ada E. Yonath <NA> female 1939-06-22 Israel <list [1]>
10 866 Adam G. Riess <NA> male 1969-12-16 USA <list [1]>
# ℹ 1,018 more rows
ggplot(women_by_decade, aes(decade, pct_women)) +geom_col(fill ="steelblue") +labs(title ="Share of Nobel awards going to women, by decade",x ="Decade", y ="% of individual awards")
Question #2: What is the median age at which laureates receive each prize, and how does that compare before and after 1970?
laureate_prizes |>filter(!is.na(age_at_award)) |>ggplot(aes(reorder(category, age_at_award, median), age_at_award)) +geom_boxplot(fill ="grey85") +coord_flip() +labs(title ="Age at award by category", x =NULL, y ="Age (years)")
Question #3: What is the average number of laureates per prize in each category and decade?
ggplot(sharing, aes(decade, avg_laureates, color = category)) +geom_line() +geom_point() +labs(title ="Average laureates per prize, by decade",x ="Decade", y ="Avg laureates per prize", color =NULL)
Question #4: Comparing each laureate’s birth country to the country of their first listed affiliation at the time of the award, which countries lost the most laureates, which gained the most, and what are the biggest flows?
lost <- moves |>filter(moved) |>count(birth_country, name ="lost")gained <- moves |>filter(moved) |>count(aff_country, name ="gained")net_flow <-full_join(lost, gained, by =c("birth_country"="aff_country")) |>rename(country = birth_country) |>replace_na(list(lost =0, gained =0)) |>mutate(net = gained - lost) |>arrange(net)net_flow
# A tibble: 57 × 4
country lost gained net
<chr> <int> <int> <int>
1 Poland 19 0 -19
2 Canada 15 6 -9
3 Scotland 9 0 -9
4 Austria 10 2 -8
5 Hungary 8 0 -8
6 Russia 11 3 -8
7 the Netherlands 9 1 -8
8 China 7 0 -7
9 Japan 7 0 -7
10 Italy 8 2 -6
# ℹ 47 more rows
bind_rows(head(net_flow, 5), tail(net_flow, 5))
# A tibble: 10 × 4
country lost gained net
<chr> <int> <int> <int>
1 Poland 19 0 -19
2 Canada 15 6 -9
3 Scotland 9 0 -9
4 Austria 10 2 -8
5 Hungary 8 0 -8
6 Sweden 3 4 1
7 Denmark 0 2 2
8 Switzerland 3 12 9
9 United Kingdom 24 35 11
10 USA 4 134 130
net_flow |>slice(c(1:8, (n() -7):n())) |>ggplot(aes(reorder(country, net), net, fill = net >0)) +geom_col(show.legend =FALSE) +coord_flip() +labs(title ="Net laureate gain/loss by country",subtitle ="Awarded while affiliated with the country minus born there",x =NULL, y ="Net laureates")
Conclusion
The 4 questions show many ways the Nobel Prize has evolved since 1901. The proportion of women individually winning in the first part of the century was very low. This went from 0% in the 1950s to around 7.5% in the 1940s up until the 1980s. However, more recently it has increased to 11.1% in the 2010s and 19.5% in the 2020s so far. It is therefore still far from equal. In the sciences the average age has significantly increased. For example Physics went from 47 to 64, Chemistry from 50.5 to 63 and Physiology/Medicine from 54 to 63. However, Peace decreased slightly to 58.5 from 64 and Economic Sciences decreased to 67 from 70. There are also more people winning awards. In Physics there have been on average 1.4 winners per prize in the 1900s, but now there are around 2.6 winners per prize in the 2020s. Similarly, Chemistry has gone from 1.0 to 2.6. However, Literature is still only 1 winner.
Around 32% of laureates with an association were awarded in the country they were not born in. The country with the biggest gain was the USA, increasing by +130. Next were the United Kingdom by +11 and Switzerland by +9. The country with the biggest loss was Poland decreasing by -19, then Canada and Scotland both decreased by -9. This is only due to the country of association being a proxy variable. Scotland is also a separate country meaning that these figures are not exact. This indicates trends in who has been acknowledged.