Objective of this chapter

I will display the yearly variations of the cantril ladder values for certain group of countries. Additionally I will compute and integrate the mean for the ladder scores of each group.

Note 4.1: Using two functions

To facilitate computing and plotting I have developed two functions:

  • my_get_ls_data: creates the ladder score data for a country/region/group
  • my_ls-region: display the ladder score line graph for a country/region/group

Both functions are called from the R/helper.r file, where you can also find the name and type of the necessary parameters. Typically I have used the following code chunk:

my_ls_region(
  df = my_get_ls_data(
    region_name = rlang::quo(`region5`), # specific column name for a regional group
    world_bank_group = "World [WLD]",    # specific world bank group to select 
                                         # all countries of the workd, 
                                         # removing duplicates from world bank groupings
    filter_string = "."                  # "." = no filter, 
                                         # "Europe" = all values that contain "Europe           
                                         # "^Europe$" all values of "Europe" exactly
  ), 
  fig_title = "Ladder Score for continents 2011-2024",
  mean_column = TRUE                     # standard, calculate mean values
  legend_title = "Continent"             # standard value = "Region"
)

4.1 Continents

In the following chapter I will present the ladder score for the five continents (Africa, Americas, Asia, Europe and Oceania). To see which country belongs to which continent have a look at Table 2.3.

Note 4.2: How to interact with {plotly} graphs?
  1. If you hover over a {plotly} figure you will see additional information.
  2. If you hover over the {plotly} menu bar on the top right margin of the graph, you will get tool tips for different presentation modes. Try them out to see what they do.
  3. If you click on one of the legend categories of the figure you will hide this category from the graph. You can do this with several categories one after the other. A double click sets the graph to the default state, the original visibility.
  4. If you double click on one of the legend categories you will see the line of this category isolated. Another click of one of the other categories will add the line of this category. A double click sets the graph to the default state, the original visibility.

After changing the number of visible lines with c) or d) the axes may change accordingly so that the resulting graph remains still in the middle of the canvas.

Important 4.1: Things to know about the mean line
  1. Change of the number of visible lines does not change the mean values. The mean is always related to the standard view with all categories active.
  2. The mean is calculated by the number of countries and not weighted by population size.

R Code 4.1 : Ladder Score by Continents

Code
my_ls_region(
  df = my_get_ls_data(
    group_name  = rlang::quo(`region5`),
    region_name = rlang::quo(`region5`),
    world_bank_group = "World [WLD]",
    filter_string = "."
  ), 
  fig_title = "Ladder score for continents (2011-2024)",
  legend_title = "Continent"
)

There is hardly any change seen worldwide. We see a sharp level distinction between two groups: Oceania, the Americas and Europe have life satisfactions above 6, whereas Asia below 5.5 and Africa even below 4.5.

But these values as mean values hide country specific developments. In the next step I will explore more in detail the evolution of life satisfaction of the European countries.

4.1.1 Europe

Code Collection 4.1 : Life evolution for different groups of European regions and countries (2011-2024)

R Code 4.2 : Ladder Score for European regions (2011-2024)

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`region23`),
    world_bank_group = "World [WLD]",
    filter_string = "Europe"
  ), 
  fig_title = "Ladder score for European regions (2011-2024)"
)

There is a big difference between Western and Northern Europe to Eastern and Southern Europe. The European mean of the life evaluation rises between 2015 to 2020 but stagnates later. The main reason is a sharp drop in the Western European countries, presumably connected with the COVID-19 crisis.

R Code 4.3 : Life evaluation for Countries in Western Europe (2011-2024)

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`country_whr`),
    world_bank_group = "World [WLD]",
    filter_string = "Western Europe"
  ), 
  fig_title    = "Ladder score for countries in Western Europe (2011-2024)",
  legend_title = "Country"
)

No data available for Monaco and Lichtenstein.

Remarkable is the decline starting with the year 2020 presumably connected with COVID-19. Only Belgium has reached 2024 a level above the value of 2020.

Most of the countries have somewhat stabilized with 2024, the last available year of the life evaluation. This was not the case for Switzerland, Austria, and to a lesser extend for France. Life evaluation measured by the Cantril ladder declined since 2020 especially for the so-called DACH countries: Switzerland (-0.625), followed by Austria (-0.458) and Germany (-0.402).

R Code 4.4 : Life evaluation for Countries in Eastern Europe (2011-2024)

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`country_whr`),
    world_bank_group = "World [WLD]",
    filter_string = "Eastern Europe"
  ), 
  fig_title    = "Ladder score for countries in Eastern Europe (2011-2024)",
  legend_title = "Country"
)

R Code 4.5 : Life evaluation for Countries in Soutern Europe (2011-2024)

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`country_whr`),
    world_bank_group = "World [WLD]",
    filter_string = "Southern Europe"
  ), 
  fig_title    = "Ladder score for countries in Southern Europe (2011-2024)",
  legend_title = "Country"
)

No data available for Andorra, Gibraltar, Holy See, San Marino and Lichtenstein.

We notice generally a lower level of life satisfaction than in Western Europe. But with the exception of Spain and Malta (both experiencing a relative high life satisfaction) all country of Southern Europe caught up tremendously starting about 2015. There is also to notice a buckling around the years of the Corona pandemic but the decline is much lesser than in Western Europe.

It is somewhat surprising that even Italy – where we have heard and seen dreadful COVID-19 condition – was not so hard hit than the three German speaking countries.

R Code 4.6 : Life evaluation for Countries in Northern Europe (2011-2024)

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`country_whr`),
    world_bank_group = "World [WLD]",
    filter_string = "Northern Europe"
  ), 
  fig_title    = "Ladder score for countries in Northern Europe (2011-2024)",
  legend_title = "Country"
)

4.1.2 Africa

R Code 4.7 : Ladder Score by African regions

Code
my_ls_region(
  my_get_ls_data(
    group_name  = rlang::quo(`region23`),
    region_name = rlang::quo(`region23`),
    world_bank_group = "World [WLD]",
    filter_string = "Africa"
  ), 
  fig_title = "Ladder score for African regions (2011-2024)"
)

You can see the negative impact of the corona crisis especially in Middle and Western Africa. To see which country belongs to which continent have a look at Table 2.4.

4.1.3 Rankings

R Code 4.8 : Rank changes for Countries in Western Europe 2011-2024

Code
base::readRDS("data/whr-cantril/rds/whr_final.rds") |>
      dplyr::filter(
        region23 == "Western Europe"
          ) |> 
        base::droplevels() |> 
  plotly::plot_ly(
    x = ~ year,
    y = ~ rank,
    color = ~ country_whr,
    type = "scatter",
    mode = "lines+markers"
  ) |> 
  plotly::layout(
    title = "Changes in the Rank for West European Countries (2011-2024)",
    legend = base::list(title = list(text = 'Country')),
    xaxis = base::list(title = "Year"), 
    yaxis = base::list(title = "Rank", autorange = "reversed")
    )

4.2 DACH countries

As I am especially interested in my native country the next graph will compare the three German speaking countries DACH = Germany (Deutschland), Austria and Switzerland (Country iso2 code = CH))

4.2.1 Ladder scores

R Code 4.9 : Evolution of life evaluation for German speaking countries

Code
base::readRDS("data/whr-cantril/rds/whr_final.rds") |> 
    dplyr::filter(
        country_whr == "Austria" |
        country_whr == "Germany" |
        country_whr == "Switzerland"
        ) |> 
    dplyr::filter(group48 == "World [WLD]") |> 
    base::droplevels() |> 

    plotly::plot_ly(
      x = ~ year,
      y = ~ ladder_score,
      color = ~ country_whr,
      type = "scatter",
      mode = "lines+markers"
    ) |> 
    plotly::layout(
      title = "Changes in the Ladder Scores for DACH Countries (2011-2024)",
      legend = base::list(title = list(text = 'Country')),
      xaxis = base::list(title = "Year"), 
      yaxis = base::list(title = "Cantril Ladder Score")
      )

4.2.2 Rankings

R Code 4.10 : Evolution of life evaluation for German speaking countries

Code
base::readRDS("data/whr-cantril/rds/whr_final.rds") |> 
    dplyr::filter(
        country_whr == "Austria" |
        country_whr == "Germany" |
        country_whr == "Switzerland"
        ) |> 
    dplyr::filter(group48 == "World [WLD]") |> 
    base::droplevels() |> 

    plotly::plot_ly(
      x = ~ year,
      y = ~ rank,
      color = ~ country_whr,
      type = "scatter",
      mode = "lines+markers"
    ) |> 
    plotly::layout(
      title = "Ranking Changes of Live Evaluations for DACH Countries (2011-2024)",
      legend = base::list(title = list(text = 'Country')),
      xaxis = base::list(title = "Year"), 
      yaxis = base::list(title = "Rank", autorange = "reversed")
      )

R Code 4.11 : DACH with ordered legend

Code
DACH <- base::readRDS("data/whr-cantril/rds/whr_final.rds") |> 
    dplyr::filter(
        country_whr == "Austria" |
        country_whr == "Denmark" |
        country_whr == "Finland"
        ) |> 
    dplyr::filter(group48 == "World [WLD]") |> 
    dplyr::select(year, rank, country_whr, ladder_score) |> 
    base::droplevels()

DACH |> plotly::plot_ly(
    x = ~ year,
    y = ~ ladder_score,
    color = ~ forcats::fct_reorder2(
      country_whr, year, ladder_score, .fun = forcats::last2
      ),
    type = "scatter",
    mode = "lines+markers"
  ) |> 
  plotly::layout(
    title = "Changes in the Ladder Scores for DACH Countries (2011-2024)",
    legend = base::list(title = list(text = 'Country')),
    xaxis = base::list(title = "Year"), 
    yaxis = base::list(title = "Cantril Ladder Score")
    )

4.3 Glossary

term definition
Cantril ladder The Cantril Ladder is a visual scale used to assess general life satisfaction. It asks respondents to evaluate their lives on a ladder from worst (bottom) to best (top) possible life, making it a simple tool to measure subjective well-being. This measure has been widely used in various studies and surveys, including the Gallup World Poll, which collects data from over 140 countries annually.
DACH The abbreviation DACH refers to Deutschland, Austria, and Switzerland, which collectively represent German-speaking Europe. It is derived from the international license plate abbreviations for these countries.

4.4 Session Info

Session Info

Code
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.5.0 (2025-04-11)
#>  os       macOS Sequoia 15.3.2
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Vienna
#>  date     2025-04-25
#>  pandoc   3.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
#>  quarto   1.6.42 @ /usr/local/bin/quarto
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date (UTC) lib source
#>  cli            3.6.5   2025-04-23 [1] CRAN (R 4.5.0)
#>  commonmark     1.9.5   2025-03-17 [1] CRAN (R 4.5.0)
#>  crosstalk      1.2.1   2023-11-23 [1] CRAN (R 4.5.0)
#>  curl           6.2.2   2025-03-24 [1] CRAN (R 4.5.0)
#>  data.table     1.17.0  2025-02-22 [1] CRAN (R 4.5.0)
#>  dichromat      2.0-0.1 2022-05-02 [1] CRAN (R 4.5.0)
#>  digest         0.6.37  2024-08-19 [1] CRAN (R 4.5.0)
#>  dplyr          1.1.4   2023-11-17 [1] CRAN (R 4.5.0)
#>  evaluate       1.0.3   2025-01-10 [1] CRAN (R 4.5.0)
#>  farver         2.1.2   2024-05-13 [1] CRAN (R 4.5.0)
#>  fastmap        1.2.0   2024-05-15 [1] CRAN (R 4.5.0)
#>  forcats        1.0.0   2023-01-29 [1] CRAN (R 4.5.0)
#>  generics       0.1.3   2022-07-05 [1] CRAN (R 4.5.0)
#>  ggplot2        3.5.2   2025-04-09 [1] CRAN (R 4.5.0)
#>  glossary     * 1.0.0   2023-05-30 [1] CRAN (R 4.5.0)
#>  glue           1.8.0   2024-09-30 [1] CRAN (R 4.5.0)
#>  gtable         0.3.6   2024-10-25 [1] CRAN (R 4.5.0)
#>  here           1.0.1   2020-12-13 [1] CRAN (R 4.5.0)
#>  htmltools      0.5.8.1 2024-04-04 [1] CRAN (R 4.5.0)
#>  htmlwidgets    1.6.4   2023-12-06 [1] CRAN (R 4.5.0)
#>  httr           1.4.7   2023-08-15 [1] CRAN (R 4.5.0)
#>  jsonlite       2.0.0   2025-03-27 [1] CRAN (R 4.5.0)
#>  kableExtra     1.4.0   2024-01-24 [1] CRAN (R 4.5.0)
#>  knitr          1.50    2025-03-16 [1] CRAN (R 4.5.0)
#>  lazyeval       0.2.2   2019-03-15 [1] CRAN (R 4.5.0)
#>  lifecycle      1.0.4   2023-11-07 [1] CRAN (R 4.5.0)
#>  litedown       0.7     2025-04-08 [1] CRAN (R 4.5.0)
#>  magrittr       2.0.3   2022-03-30 [1] CRAN (R 4.5.0)
#>  markdown       2.0     2025-03-23 [1] CRAN (R 4.5.0)
#>  pillar         1.10.2  2025-04-05 [1] CRAN (R 4.5.0)
#>  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.5.0)
#>  plotly         4.10.4  2024-01-13 [1] CRAN (R 4.5.0)
#>  purrr          1.0.4   2025-02-05 [1] CRAN (R 4.5.0)
#>  R6             2.6.1   2025-02-15 [1] CRAN (R 4.5.0)
#>  RColorBrewer   1.1-3   2022-04-03 [1] CRAN (R 4.5.0)
#>  rlang          1.1.6   2025-04-11 [1] CRAN (R 4.5.0)
#>  rmarkdown      2.29    2024-11-04 [1] CRAN (R 4.5.0)
#>  rprojroot      2.0.4   2023-11-05 [1] CRAN (R 4.5.0)
#>  rstudioapi     0.17.1  2024-10-22 [1] CRAN (R 4.5.0)
#>  rversions      2.1.2   2022-08-31 [1] CRAN (R 4.5.0)
#>  scales         1.4.0   2025-04-24 [1] CRAN (R 4.5.0)
#>  sessioninfo    1.2.3   2025-02-05 [1] CRAN (R 4.5.0)
#>  stringi        1.8.7   2025-03-27 [1] CRAN (R 4.5.0)
#>  stringr        1.5.1   2023-11-14 [1] CRAN (R 4.5.0)
#>  svglite        2.1.3   2023-12-08 [1] CRAN (R 4.5.0)
#>  systemfonts    1.2.2   2025-04-04 [1] CRAN (R 4.5.0)
#>  tibble         3.2.1   2023-03-20 [1] CRAN (R 4.5.0)
#>  tidyr          1.3.1   2024-01-24 [1] CRAN (R 4.5.0)
#>  tidyselect     1.2.1   2024-03-11 [1] CRAN (R 4.5.0)
#>  vctrs          0.6.5   2023-12-01 [1] CRAN (R 4.5.0)
#>  viridisLite    0.4.2   2023-05-02 [1] CRAN (R 4.5.0)
#>  withr          3.0.2   2024-10-28 [1] CRAN (R 4.5.0)
#>  xfun           0.52    2025-04-02 [1] CRAN (R 4.5.0)
#>  xml2           1.3.8   2025-03-14 [1] CRAN (R 4.5.0)
#>  yaml           2.3.10  2024-07-26 [1] CRAN (R 4.5.0)
#> 
#>  [1] /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
#>  * ── Packages attached to the search path.
#> 
#> ──────────────────────────────────────────────────────────────────────────────