Skip to content

Commit

Permalink
Merge pull request #16 from PIP-Technical-Team/revert-15-DEV_website_…
Browse files Browse the repository at this point in the history
…params

Revert 15 dev website params
  • Loading branch information
giorgiacek authored Feb 13, 2024
2 parents ec5d52c + 6678c60 commit 1330109
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 119 deletions.
5 changes: 1 addition & 4 deletions R/pipgd_pov.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,13 @@ pipgd_pov_gap_nv <- function(params = NULL,
params <- pipgd_pov_headcount_nv(welfare = welfare,
weight = weight,
complete = TRUE,
mean = mean,
times_mean = times_mean,
popshare = popshare,
mean = mean,
povline = povline,
lorenz = lorenz)
} else {
params <- pipgd_pov_headcount_nv(params = params,
complete = TRUE,
mean = mean,
times_mean = times_mean,
popshare = popshare,
povline = povline,
lorenz = lorenz)
Expand Down
45 changes: 7 additions & 38 deletions vignettes/gd_functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library(pipster)

## Overview

This vignette shows an overview of the `pipster` package functions for grouped data. Grouped data are consumption expenditure or income data organized in intervals or bins, such as deciles or percentiles. In order to estimate poverty and inequality measures from grouped data, one has to derive a continuous Lorenz curve and use it together with mean welfare to build a full distribution. `pipster` provides a series of functions to estimate poverty and inequality measures, based on the methodology of [Datt (1998)](http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf):
This vignette shows an overview of the `pipster` package functions for grouped data. Grouped data are consumption expenditure or income organized in intervals or bins, such as deciles or percentiles. In order to estimate poverty and inequality measures from grouped data, one has to derive a continuous Lorenz curve and use it together with mean welfare to build a full distribution. `pipster` provides a series of functions to estimate poverty and inequality measures, based on the methodology of [Datt (1998)](http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf):

- `pipgd_pov_headcount()` (FGT0)

Expand Down Expand Up @@ -48,7 +48,7 @@ It also provides a series of functions to calculate distributional measures and

## Sample Grouped Data

In this vignette, we will explore several typical scenarios in which the pipster package can be effectively utilized. In each of these scenario, we will use a sample dataset, `pip_gd`, available with this package and obtained from [Datt (1998)](http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf). The dataset shows the distribution of consumption expenditure in rural India in 1983. The variables are the following:
In this vignette, we will explore several typical scenarios in which the pipster package can be effectively utilized. In each of these scenario, we will use a sample dataset, `pip_gd`, available with the package and obtained from [Datt (1998)](http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf). The dataset shows the distribution of consumption expenditure in rural India in 1983. The variables are the following:

- **W**: Weights, share of population, sum up to 100.
- **X**: Welfare vector with mean welfare by group.
Expand Down Expand Up @@ -275,43 +275,12 @@ print(paste0("The poverty severity is ", round(SPG*100,2), "%"))
Using `pipster`, we simply do:
```{r severity}
severity <- pipgd_pov_severity(welfare = pip_gd$L,
weight = pip_gd$P,
mean = mu,
povline = z,
lorenz = 'lq')
weight = pip_gd$P,
mean = mu,
povline = z,
lorenz = 'lq')
print((paste0("The poverty severity is ", round(severity$pov_severity*100,2), "%")))
```

## Case 3: Additional Inequality and Poverty Measures

Finally, `pipster` can also be used to easily calculate additional inequality measures.
The Gini coefficient can be calculated using `pipgd_gini()` like so:
```{r gini}
gini <- pipgd_gini(welfare = pip_gd$L,
weight = pip_gd$P,
lorenz = 'lq')
print((paste0("The gini index is ", round(gini$dist_stats$gini,2))))
```

The Watts Index can be calculated using `pipgd_watts()` like so:
```{r watts}
watts <- pipgd_watts(welfare = pip_gd$L,
weight = pip_gd$P,
mean = mu,
povline = z,
lorenz = 'lq')
print((paste0("The Watts index is ", round(watts$watts, 2))))
```

And finally, the MLD (Mean Logarithmic Deviation) can be calculated using `pipgd_mld()` like so:
```{r mld}
mld <- pipgd_mld(welfare = pip_gd$L,
weight = pip_gd$P,
lorenz = 'lq')
print((paste0("The MLD is ", round(mld$dist_stats$mld,2))))
```
## Case 3: Inequality Analysis
77 changes: 0 additions & 77 deletions vignettes/md_functions.Rmd

This file was deleted.

0 comments on commit 1330109

Please sign in to comment.