knitr::opts_chunk$set(fig.width=12, fig.height=8, fig.path='Figs/', warning=FALSE, message=FALSE) knitr::opts_knit$set(root.dir="../")
library(MLlibrary) library(dplyr) library(Hmisc) library(ggplot2) k <- nrow(distinct(joined, fold))
This is a sample analysis using the variables which are being used in the PMT. The dataset has r nrow(dataset)
households and r ncol(dataset)
variables
Least squares can be considered the benchmark method upon which the PMT from the WB was based.
We use r k
fold cross validation for testing predictive accuracy.
The following shows, for different poverty thresholds (as quantiles of the population, given by the graph title), how the number of poor included increases compared to how the number of rich included increases as the eligibility cutoff increases.
plot_reach_vs_waste_(joined, POINT_COUNT=100)
The following is the same graph, for a poverty line at the 40% percentile of the distribution.
plot_reach_vs_waste_(joined, POINT_COUNT=1000, THRESHOLD = 0.4)
The following shows, as the coverage of the program is increased, the social welfare using a targeting rule based on our prediction, divided by the social welfare of using a perfect targeting rule. The social welfare is the sum of the marginal utilities of consumption of recipients, using a CRRA utility function with coefficient of relative risk aversion = gamma.
plot_swf_(joined, POINT_COUNT=1000, GAMMA = 3)
e <- filter(joined, grepl('ensemble', method) | method == "least_squares") plot_swf_(e, GAMMA=3) plot_swf_(e, GAMMA=3) + coord_cartesian(xlim=c(0, 0.4)) plot_reach_vs_waste_(e) plot_reach_vs_waste_(e) + coord_cartesian(xlim=c(0, 0.4)) plot_reach_vs_waste_(e, THRESHOLD=0.4) plot_reach_vs_waste_(e, THRESHOLD=0.2)
The following shows the density plots across the regression methods. rtree is not displayed since it is a set of point masses.
r <- filter(joined, grepl('quantile', method) | (!grepl('_30', method) & !grepl('_40', method))) plot_density_(r)
The following shows the density plots across the classification methods.
c <- filter(joined, !grepl('quantile', method) & (grepl('_30', method) | grepl('_40', method))) plot_density_(c)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.