-
Case 3: Additional Inequality and Poverty Measures
+Case 3: Inequality Analysis
-
Finally, pipster
can also be used to easily calculate
-additional inequality measures. The Gini coefficient can be calculated
-using pipgd_gini()
like so:
-
-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))))
-#> [1] "The gini index is 0.29"
-
The Watts Index can be calculated using pipgd_watts()
-like so:
-
-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))))
-#> [1] "The Watts index is 0.43"
-
And finally, the MLD (Mean Logarithmic Deviation) can be calculated
-using pipgd_mld()
like so:
-
-mld <- pipgd_mld(welfare = pip_gd$L,
- weight = pip_gd$P,
- lorenz = 'lq')
-
-print((paste0("The MLD is ", round(mld$dist_stats$mld,2))))
-#> [1] "The MLD is 0.14"