第4週

01/11(TH) 南部アフリカ諸国の貧困と不平等の現状1

      南部アフリカ諸国の貧困と不平等の現状2

第4週、第5週の講義では、貧困の問題が特に深刻な南部アフリカ諸国の問題を議論します。

World BankのINEQUALITY IN SOUTHERN AFRICA:AN ASSESSMENT OF THE SOUTHERN AFRICAN CUSTOMS UNION (https://wir2022.wid.world/)をテキストにしています。教育、失業、COVID-19の貧困に与える影響などを取り上げます。

01/16(TU) Rでデータサイエンス4:貧困(データが少ない難点) [Main]・[授業]

Poverty rates at national poverty lines

Poverty headcount ratio at national poverty lines (% of population):SI.POV.NAHC [Link]

National poverty headcount ratio is the percentage of the population living below the national poverty line(s). National estimates are based on population-weighted subgroup estimates from household surveys. For economies for which the data are from EU-SILC, the reported year is the income reference year, which is the year before the survey year.

全国貧困人口比率は、全国貧困線以下で生活している人口の割合です。国の推定値は、世帯調査からの人口加重サブグループ推定値に基づいています。データが EU-SILC からのものである経済の場合、報告される年は所得基準年、つまり調査年の前年です。

Poverty and Inequality―Poverty rates at international poverty lines

Poverty headcount ratio at $2.15 a day (2017 PPP) (% of population):SI.POV.DDAY [Link]

Poverty headcount ratio at $2.15 a day is the percentage of the population living on less than $2.15 a day at 2017 purchasing power adjusted prices. As a result of revisions in PPP exchange rates, poverty rates for individual countries cannot be compared with poverty rates reported in earlier editions.

1日2.15ドルの貧困人口比率は、2017年の購買力調整後価格で1日2.15ドル未満で生活している人口の割合です。PPP 為替レートの改定により、各国の貧困率を以前の版で報告された貧困率と比較することができなくなりました。

Poverty headcount ratio at $3.65 a day (2017 PPP) (% of population):SI.POV.LMIC [Link]

Poverty headcount ratio at $3.65 a day is the percentage of the population living on less than $3.65 a day at 2017 international prices.

1 日 3.65 ドルの貧困人口比率は、2017 年の国際価格で 1 日 3.65 ドル未満で生活している人口の割合です。

Poverty headcount ratio at $6.85 a day (2017 PPP) (% of population):SI.POV.UMIC [Link]

Poverty headcount ratio at $6.85 a day is the percentage of the population living on less than $6.85 a day at 2017 international prices.

1日6.85ドルの貧困人口比率は、2017年の国際価格で1日6.85ドル未満で生活している人口の割合です。

内容

準備

library(tidyverse)
library(WDI)

データの読み込み(importing)

追加情報(地域・所得レベル)を読み込みたいので、extra=TRUE としてあります。

df_poverty_rate <- WDI(
  indicator = c(ratio = "SI.POV.NAHC",
                under_2.15 = "SI.POV.DDAY",
                under_3.65 = "SI.POV.LMIC",
                under_6.85 = "SI.POV.UMIC"),
  extra = TRUE)

データを見てみよう (viewing)

df_poverty_rate
str(df_poverty_rate)
'data.frame':   16758 obs. of  16 variables:
 $ country    : chr  "Afghanistan" "Afghanistan" "Afghanistan" "Afghanistan" ...
 $ iso2c      : chr  "AF" "AF" "AF" "AF" ...
 $ iso3c      : chr  "AFG" "AFG" "AFG" "AFG" ...
 $ year       : int  2014 1971 2006 2013 1995 2005 1997 1998 1999 1996 ...
 $ status     : chr  "" "" "" "" ...
 $ lastupdated: chr  "2023-12-18" "2023-12-18" "2023-12-18" "2023-12-18" ...
 $ ratio      : num  NA NA NA NA NA NA NA NA NA NA ...
  ..- attr(*, "label")= chr "Poverty headcount ratio at national poverty lines (% of population)"
 $ under_2.15 : num  NA NA NA NA NA NA NA NA NA NA ...
  ..- attr(*, "label")= chr "Poverty headcount ratio at $2.15 a day (2017 PPP) (% of population)"
 $ under_3.65 : num  NA NA NA NA NA NA NA NA NA NA ...
  ..- attr(*, "label")= chr "Poverty headcount ratio at $3.65 a day (2017 PPP) (% of population)"
 $ under_6.85 : num  NA NA NA NA NA NA NA NA NA NA ...
  ..- attr(*, "label")= chr "Poverty headcount ratio at $6.85 a day (2017 PPP) (% of population)"
 $ region     : chr  "South Asia" "South Asia" "South Asia" "South Asia" ...
 $ capital    : chr  "Kabul" "Kabul" "Kabul" "Kabul" ...
 $ longitude  : chr  "69.1761" "69.1761" "69.1761" "69.1761" ...
 $ latitude   : chr  "34.5228" "34.5228" "34.5228" "34.5228" ...
 $ income     : chr  "Low income" "Low income" "Low income" "Low income" ...
 $ lending    : chr  "IDA" "IDA" "IDA" "IDA" ...

利用しない変数もあるので select を使って変数を減らすことも可能ですが、今回は、そのまま使うことにしましょう。減らしたい時は、次のようにします。下の例では、見やすいように、ratio が NA のものは、削除してあります。

df_poverty_rate_selected <- df_poverty_rate |> drop_na(ratio) |>
  select(country, iso2c, year, ratio, under_2.15, under_3.65, under_6.85, region, income)
df_poverty_rate_selected

変形

四つの指標を同時にいくつか選択し比較したいので、一つの列(変数)にならべた、縦長データ(long data)も作成しておきます。ここでは、ratio から under_6.85 を、level という名前の列にならべ、値を value という列に並べるようにしてあります。

確認するときは、value が NA のものは除き、country と、iso2c と、level と value の部分だけ取り出して確認しています。

df_poverty_rate_long <- df_poverty_rate |> 
  pivot_longer(ratio:under_6.85, names_to = "level", values_to = "value")
df_poverty_rate_long |> drop_na(value) |> select(country, iso2c, level, value)

年毎のデータの数の確認(number of data in each year)

df_poverty_rate_long |> drop_na(value) |> 
  group_by(year, level) |> summarize(n = n()) |> arrange(desc(year))
`summarise()` has grouped output by 'year'. You can override using the `.groups` argument.
df_poverty_rate_long |> filter(year %in% c(1960, 1970, 1980, 1990, 2000, 2010, 2020)) |> drop_na(value) |> group_by(year, level) |> summarize(n = n()) |>
  ggplot(aes(as.character(year), n, fill = level)) + geom_col(position = "dodge", col = "black", linewidht = 0.1) + labs(x = "year", y = "number of data")
`summarise()` has grouped output by 'year'. You can override using the `.groups` argument.Warning: Ignoring unknown parameters: `linewidht`

df_poverty_rate_long |> 
  filter(country %in% c("World", "Sub-Saharan Africa")) |> drop_na() |>
  ggplot(aes(year, value, col = level, linetype = country)) + geom_line()

df_poverty_rate_long |> filter(year %in% c(2000, 2010, 2020)) |> drop_na(value) |> 
  filter(region == "Aggregates") |> filter(level %in% c("ratio", "under_2.15")) |> group_by(country, year, level) |> summarize(n = n())
`summarise()` has grouped output by 'country', 'year'. You can override using the `.groups` argument.
df_poverty_rate_long |>  drop_na(value) |> 
  filter(region == "Sub-Saharan Africa") |> group_by(country, level) |> 
  summarize(n = n())
`summarise()` has grouped output by 'country'. You can override using the `.groups` argument.
df_poverty_rate_long |> 
  filter(country %in% c("South Africa", "Lesotho", "Botswana", "Namibia", "Eswatini")) |> drop_na(value) |>
  ggplot(aes(year, value, col = country, linetype = level)) + geom_line()

df_poverty_rate |> 
  filter(country %in% c("South Africa", "Lesotho", "Botswana", "Namibia", "Eswatini")) |>
  drop_na(under_2.15) |> group_by(country) |> filter(year == max(year)) |> 
  select(country, iso2c, year, ratio:under_6.85)
df_poverty_rate_long |> 
  filter(country %in% c("South Africa", "Lesotho", "Botswana", "Namibia", "Eswatini")) |>
  drop_na(value) |> group_by(country) |> filter(year == max(year)) |>
  ggplot(aes(country, value, fill = level)) + geom_col(position = "dodge", col = "black", linewidth = 0.1)

df_poverty_rate_long |> filter(country == "China") |>
  drop_na(value) |>
  ggplot(aes(year, value, col = level)) + geom_line()

df_poverty_rate_long |> 
  filter(country == "Indonesia") |> drop_na() |>
  ggplot(aes(year, value, col = level)) + geom_line()

df_poverty_rate_long |> filter(year == 2022) |> 
  drop_na(value) |>
  ggplot(aes(value, level, fill = region)) + 
  geom_boxplot()

df_poverty_rate_long |> filter(year == 2022) |> 
  drop_na(value) |>
  ggplot(aes(value, level, fill = income)) + 
  geom_boxplot() + labs(fill = "")

df_poverty_rate_long |> filter(region == "Sub-Saharan Africa", year == 2020) |> 
  drop_na(value) |>
  ggplot(aes(value, level)) + 
  geom_boxplot()

LS0tCnRpdGxlOiAiR0VTIDAwMSDmvJTnv5I0IgphdXRob3I6ICJILiBTdXp1a2kiCmRhdGU6ICJgciBTeXMuRGF0ZSgpYCIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6IGRlZmF1bHQKLS0tCgojIyDnrKw06YCxCgowMS8xMShUSCnjgIDljZfpg6jjgqLjg5Xjg6rjgqvoq7jlm73jga7osqflm7DjgajkuI3lubPnrYnjga7nj77nirYxCgrjgIDjgIDjgIDjgIDjgIDjgIDljZfpg6jjgqLjg5Xjg6rjgqvoq7jlm73jga7osqflm7D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