Skip to content

Commit

Permalink
draft 2 of poverty maps; also a gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhasp committed Jul 21, 2013
1 parent 258f081 commit e550720
Show file tree
Hide file tree
Showing 23 changed files with 83 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/cache
*.~lock*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file modified Poverty/figure/unnamed-chunk-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Poverty/figure/unnamed-chunk-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Poverty/figure/unnamed-chunk-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Poverty/figure/unnamed-chunk-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Poverty/figure/unnamed-chunk-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 44 additions & 19 deletions Poverty/index.html

Large diffs are not rendered by default.

53 changes: 37 additions & 16 deletions Poverty/index.rmd
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
<link href="http://kevinburke.bitbucket.org/markdowncss/markdown.css" rel="stylesheet"></link>

Poverty by District in Nepal, mapped
---

Chandan Sapkota, who one of my friend Bigyan calls the "Ezra Klein of Nepal", produces amazing analysis about Nepal, taking data sources from the obscure reports of government institutions and writing them up in accessible blog posts. When he posted about ["Poverty by District in Nepal"](http://sapkotac.blogspot.com/2013/07/poverty-by-district-in-nepal.html), I thought that I'd map the poverty, since it is hard for me to place all the districts in Nepal, and I wanted to see what the visual spread of poverty was. CSV data was digitized from [link in article to the CBS source](http://cbs.gov.np/wp-content/uploads/2014/06/Small%20Area%20Estimates%20of%20Poverty,%202011.pdf) (thanks Chandan for linking to the data source!), with two district spelling corrections done by author.

So lets load the data and the "NepalMapUtils" R file to get started.
Chandan Sapkota, who one of my friend Bigyan calls the "Ezra Klein of Nepal", produces amazing analysis about Nepal, taking data sources from the obscure reports of government institutions and writing them up in accessible blog posts. When he posted about ["Poverty by District in Nepal"](http://sapkotac.blogspot.com/2013/07/poverty-by-district-in-nepal.html), I thought that I'd map the poverty, since it is hard for me to place all the districts in Nepal, and I wanted to see what the visual spread of poverty was. This html is generated automatically using R markdown; see the [git repository](https://github.com/prabhasp/NepalMaps/tree/gh-pages/Poverty) to see the data and to get the rmd file.

## 0. Data preparation

Lets load up the data and our map convenience functions. This works fine if you do a [setwd](http://www.statmethods.net/interface/workspace.html) to inside the "SmallAreaPoverty" folder within [NepalMaps](http://github.com/prabhasp/NepalMaps).
Lets load up the data and the "NepalMapUtils" library. This works fine if you do a [setwd](http://www.statmethods.net/interface/workspace.html) to inside the `Poverty` folder within the [NepalMaps](http://github.com/prabhasp/NepalMaps) repository.

```{r echo=T, comment=NA, fig.height=6, fig.width=10, cache=TRUE}
poverty <- read.csv("SmallAreaPovertyEstimation.csv")
# setwd(...) here
poverty11 <- read.csv("PovertyEstimates2011.csv")
source("../NepalMapUtils.R")
```

We will do one tranformation before proceeding, which is to rename our columns. In the dataset, "FGT(0)" (which loads in R as `FGT.0.` because R doesn't like parentheses) is the _poverty incidence_ metric, defined as proportion of individuals living in that area who are in households with an average per capita expenditure below the poverty line. FGT(1) is the _poverty gap_, which is the average distance below the poverty line, being zero for those individuals above the line, and FGT(2) is _poverty severity_, the squared distance for those below hte line, which gives more weight to the very poor. [source]
We will do one tranformation before proceeding, which is to rename our columns. In the dataset, "FGT(0)" (which loads in R as `FGT.0.` because R doesn't like parentheses) is the _poverty incidence_ metric, defined as proportion of individuals living in that area who are in households with an average per capita expenditure below the poverty line. FGT(1) is the _poverty gap_, which is the average distance below the poverty line, being zero for those individuals above the line, and FGT(2) is _poverty severity_, the squared distance for those below hte line, which gives more weight to the very poor. [(See 2006 report for definitions)](http://cbs.gov.np/wp-content/uploads/2012/Others/SAE%20of%20Poverty,%20Caloric%20Intake%20and%20Malnutrition%20in%20Nepal.pdf).

So lets go ahead and rename our columns to these understandable names:

```{r}
names(poverty)
names(poverty) <- c("District", "Population", "PovertyIncidence", "S.E-P.I.", "PovertyGap",
names(poverty11)
names(poverty11) <- c("District", "Population", "PovertyIncidence", "S.E-P.I.", "PovertyGap",
"S.E-P.G." , "PovertySeverity", "S.E-P.S.")
```

And now we will also load the 2001 data, which has been modified to have the exact same column names already:

```{r echo=T, comment=NA, fig.height=6, fig.width=10, cache=TRUE}
poverty2001 <- read.csv("PovertyEstimates2001.csv")
```

## 1. Poverty Incidence (2011)

Lets make a quick map of it (note that I haven't paid attention to map projections: these are sketches).
```{r echo=T, comment=NA, fig.height=7., fig.width=12, cache=TRUE}
npchoropleth(poverty, 'District', 'PovertyIncidence')
npchoropleth(poverty11, 'District', 'PovertyIncidence')
```

A second map, coloring those that are above the mean (weighted by population) as blue and those below as red:
```{r echo=T, comment=NA, fig.height=7., fig.width=12, cache=TRUE, message=F}
meanpoverty <- weighted.mean(poverty$PovertyIncidence, poverty$Population)
npchoropleth(poverty, 'District', 'PovertyIncidence') + scale_fill_gradient2(low=muted('blue'), midpoint=meanpoverty, mid='white', high=muted('red'))
meanpoverty <- weighted.mean(poverty11$PovertyIncidence, poverty11$Population)
npchoropleth(poverty11, 'District', 'PovertyIncidence') + scale_fill_gradient2(low=muted('blue'), midpoint=meanpoverty, mid='white', high=muted('red'))
```

In the second map, you can really see how (1) the far west and the western moutains are really hurting and (2) prosperity is pretty spatial: swaths of prosperity in the Kathmandu valley, the Pokhara-Chitwan area (and larger Gandaki / Lumbini zones), in the very east, and in Sarlahi / Mahottari (wonder why... these districts house neither Birgunj nor Janakpur).
Expand All @@ -42,12 +49,26 @@ In the second map, you can really see how (1) the far west and the western mouta

The next thing to look at, as Chandan did, is the number of absolute poor, which is easily calculable given that population is nicely included in this dataset. Lets have a look:
```{r echo=T, comment=NA, fig.height=7.2, fig.width=12, cache=TRUE}
poverty$AbsolutePoor <- poverty$Population * poverty$PovertyIncidence
npchoropleth(poverty, 'District', 'AbsolutePoor')
poverty11$AbsolutePoor <- poverty11$Population * poverty11$PovertyIncidence
npchoropleth(poverty11, 'District', 'AbsolutePoor')
```
The absolute poor are concentrated in swatches of the Tarai, and you see quite a bit of absolute poor in the far west, even though populations are smaller, because of such a high concentration of the poor there. Note that the Kathmandu valley doesn't fare all that well, even though there is relative prosperity there; it just has a LOT of people living there.

For reference, a population sketch to remind us where people live in Nepal:
```{r echo=T, comment=NA, fig.height=7.2, fig.width=12, cache=TRUE}
npchoropleth(poverty, 'District', 'Population')
```
npchoropleth(poverty11, 'District', 'Population')
```

3. Comparisons with 2001
===

Now, lets us compare the data to the 2001 small area povery estimates. We will first create a new dataframe containing data from both years, then take the difference and map it (while remembering to flip the color scheme, a decrease is poverty incidence is good!):

```{r echo=T, comment=NA, fig.height=7.2, fig.width=12, cache=TRUE}
poverty <- merge(poverty11, poverty2001, by="District", suffixes=c("_2011", "_2001"))
poverty$PovertyTenYrChange <- poverty$PovertyIncidence_2011 - poverty$PovertyIncidence_2001
npchoropleth(poverty, 'District', 'PovertyTenYrChange') +
scale_fill_gradient2(low=muted('blue'), high=muted('red'))
```

The units here are in difference of percentage points; bigger negative numbers are better. The message here seems to be that most of the country has become less poor, with an exception of an icnrease in poverty in: Mustang / Manang, the Far Western Mountains, and in the central-eastern Terai (Parsa/Bara/Rautahat and Siraha/Saptari).

0 comments on commit e550720

Please sign in to comment.