From fce7d313c435e6eb06a10f23efd3023adef9d40b Mon Sep 17 00:00:00 2001 From: giorgiacek Date: Tue, 13 Feb 2024 17:44:39 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20PIP-Tech?= =?UTF-8?q?nical-Team/pipster@40508fb2fb0b73d084a6c1c895124440aac73496=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/md_functions.html | 30 ++++++++++++++++++++++++++++++ pkgdown.yml | 2 +- search.json | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/articles/md_functions.html b/articles/md_functions.html index 863065e..631403a 100644 --- a/articles/md_functions.html +++ b/articles/md_functions.html @@ -211,6 +211,36 @@

1.3 Poverty Severityprint(paste0("The poverty severity index is ", round(pip_FGT2$pov_severity*100,2), "%")) #> [1] "The poverty severity index is 23.29%" + +
+

Case 2: Inequality Measures: Additional Inequality and Poverty +Measures +

+

pipster can also be used to easily calculate additional +inequality measures. The Gini coefficient can be calculated using +pipmd_gini() like so:

+
+gini <- pipmd_gini(welfare = pip_md$welfare,
+                   weight = pip_md$weight)
+
+print((paste0("The gini index is ", round(gini$value,2))))
+#> [1] "The gini index is -0.29"
+

The Watts Index can be calculated using pipgd_watts() +like so:

+
+watts <- pipmd_watts(welfare = pip_md$welfare,
+                     weight = pip_md$weight,
+                     povline = z)
+print((paste0("The Watts index is ", round(watts$watts, 2))))
+#> [1] "The Watts index is 0.48"
+

And finally, the MLD (Mean Logarithmic Deviation) can be calculated +using pipgd_mld() like so:

+
+mld <- pipmd_mld(welfare = pip_md$welfare,
+                 weight = pip_md$weight)
+
+print((paste0("The MLD is ", round(mld$value,2))))
+#> [1] "The MLD is 4.57"
diff --git a/pkgdown.yml b/pkgdown.yml index 97ff38a..dd51174 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: gd_functions: gd_functions.html md_functions: md_functions.html -last_built: 2024-02-13T13:34Z +last_built: 2024-02-13T17:44Z urls: reference: https://pip-technical-team.github.io/pipster/reference article: https://pip-technical-team.github.io/pipster/articles diff --git a/search.json b/search.json index 32fcd36..fb074e5 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://pip-technical-team.github.io/pipster/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 pipster authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Grouped Data Functions","text":"vignette shows overview pipster package functions grouped data. Grouped data consumption expenditure income data organized intervals bins, deciles percentiles. order estimate poverty inequality measures grouped data, one derive continuous Lorenz curve use together mean welfare build full distribution. pipster provides series functions estimate poverty inequality measures, based methodology Datt (1998): pipgd_pov_headcount() (FGT0) pipgd_pov_gap() (FGT1) pipgd_pov_severity() (FGT2) pipgd_gini() pipgd_mld() pipgd_watts() also provides series functions calculate distributional measures select validate best Lorenz curve subsequent estimation: pipgd_welfare_share_at() pipgd_quantile_welfare_share() pipgd_quantile() pipgd_validate_lorenz() pipgd_select_lorenz()","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"sample-grouped-data","dir":"Articles","previous_headings":"","what":"Sample Grouped Data","title":"Grouped Data Functions","text":"vignette, explore several typical scenarios pipster package can effectively utilized. scenario, use sample dataset, pip_gd, available package obtained Datt (1998). dataset shows distribution consumption expenditure rural India 1983. variables following: W: Weights, share population, sum 100. X: Welfare vector mean welfare group. P: Cumulative share population. L: Cumulative share welfare. R: Share welfare, sum 1.","code":"#> W X P L R #> 1 0.92 24.84 0.0092 0.00208 0.002079692 #> 2 2.47 35.80 0.0339 0.01013 0.008047104 #> 3 5.11 45.36 0.0850 0.03122 0.021093739 #> 4 7.90 55.10 0.1640 0.07083 0.039613054 #> 5 9.69 64.92 0.2609 0.12808 0.057248211 #> 6 15.24 77.08 0.4133 0.23498 0.106902117 #> 7 13.64 91.75 0.5497 0.34887 0.113888553 #> 8 16.99 110.64 0.7196 0.51994 0.171066582 #> 9 10.00 134.90 0.8196 0.64270 0.122764156 #> 10 9.78 167.76 0.9174 0.79201 0.149309315 #> 11 3.96 215.48 0.9570 0.86966 0.077653634 #> 12 1.81 261.66 0.9751 0.91277 0.043099829 #> 13 2.49 384.97 1.0000 1.00000 0.087234016"},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"welfare-share-at-a-given-population-share","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.1 Welfare share at a given population share","title":"Grouped Data Functions","text":"One simple use case calculating welfare share specific share population, can achieved using pipgd_welfare_share_at(): complete = FALSE, output list. results can accessed like :","code":"# Calculate the welfare share at a given population share selected_popshare <- 0.5 welfare_share_50 <- pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, popshare = selected_popshare, complete = FALSE) #> Warning: replacing previous import 'collapse::fdroplevels' by #> 'data.table::fdroplevels' when loading 'wbpip' # Format the string with the given values formatted_message <- sprintf(\"%.0f%% of the population owns %.0f%% of welfare.\", selected_popshare * 100, welfare_share_50$dist_stats$welfare_share_at[[1]] * 100) print(formatted_message) #> [1] \"50% of the population owns 31% of welfare.\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"quantile-share-vs-cumulative-share","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.2 Quantile share vs cumulative share","title":"Grouped Data Functions","text":"pipster selection functions calculate welfare shares. n declared, pipgd_quantile_welfare_share() calculate share welfare owned specific share population, pipgd_welfare_share_at() return cumulative share:","code":"quantile_welfare_share <- pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, n = 5, complete = FALSE) quantile_welfare_share_at <- pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, n = 5, complete = FALSE) # Combine into a dataframe for practicality df_combined <- data.frame( popshare = quantile_welfare_share$dist_stats$popshare, quantile_share = quantile_welfare_share$dist_stats$quantile_welfare_share, cumulative_share = quantile_welfare_share_at$dist_stats$welfare_share_at ) # View the combined dataframe print(df_combined) #> popshare quantile_share cumulative_share #> 1 0.2 0.09067747 0.09067747 #> 2 0.4 0.13345103 0.22412849 #> 3 0.6 0.17201737 0.39614586 #> 4 0.8 0.22138237 0.61752824 #> 5 1.0 0.38247176 1.00000000"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"estimate-and-plot-the-lorenz-curve","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.3 Estimate and Plot the Lorenz Curve","title":"Grouped Data Functions","text":"pister can also used estimate Lorenz curve dataset grouped data. One hypothetical workflow: First, generate parameters using pipgd_params() Validate parameters using pipgd_validate_lorenz() Generate Lorenz curve using validated parameters pipgd_lorenz_curve()","code":"# Validate Lorenz curve. parameters <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) validated_lorenz <- pipgd_validate_lorenz(params = parameters, complete = TRUE) # Select the best Lorenz curve and check which method has been used. selected_lorenz <- pipgd_select_lorenz(params = validated_lorenz) lorenz_used_for_dist <- selected_lorenz$selected_lorenz$for_dist lorenz_used_for_pov <- selected_lorenz$selected_lorenz$for_pov formatted_message <- sprintf(\"%s used for distribution statistics and %s used for poverty metrics.\", lorenz_used_for_dist, lorenz_used_for_pov) print(formatted_message) #> [1] \"lq used for distribution statistics and lb used for poverty metrics.\" # Plot the Lorenz Curve lorenz_curve_data <- pipgd_lorenz_curve(params = validated_lorenz) plot(lorenz_curve_data$lorenz_curve$points, lorenz_curve_data$lorenz_curve$output, type = 'l', col = 'blue', xlab = 'Cumulative Share of Population', ylab = 'Cumulative Share of Welfare', main = 'Lorenz Curve', xlim = c(0, 1), ylim = c(0, 1), xaxs = \"i\", yaxs = \"i\") # Add the line of equality abline(0, 1, col = 'red', lty = 2)"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"case-2-poverty-profiling-manual-vs-pipster","dir":"Articles","previous_headings":"","what":"Case 2: Poverty Profiling Manual vs Pipster","title":"Grouped Data Functions","text":"pipster allows user estimate poverty measures quickly accurately using Lorenz curve. demonstrate use, can manually calculate FGT(0), FGT(1), FGT(2), replicate using pipster functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"manual-parameters","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.0 Manual parameters","title":"Grouped Data Functions","text":"Following Datt(1998), first derive necessary parameters Lorenz curve using pipgd_lorenz_curve(): pipster suggests use lb, Lorenz beta, poverty measures estimation. use lq instead compare results ones reported article. retrieve parameters assign objects:","code":"# STEP 0 : assign variables cum_welfare <- pip_gd$L cum_pop <- pip_gd$P # STEP 1: Estimate Lorenz Curve lorenz_curve_params <- pipgd_lorenz_curve(welfare = cum_welfare, weight = cum_pop, complete = TRUE) print(lorenz_curve_params$selected_lorenz$for_pov) #> [1] \"lb\" # parameters m <- lorenz_curve_params$gd_params$lq$key_values$m n <- lorenz_curve_params$gd_params$lq$key_values$n r <- lorenz_curve_params$gd_params$lq$key_values$r s1 <- lorenz_curve_params$gd_params$lq$key_values$s1 s2 <- lorenz_curve_params$gd_params$lq$key_values$s2 a <- lorenz_curve_params$gd_params$lq$reg_results$coef[[1]] b <- lorenz_curve_params$gd_params$lq$reg_results$coef[[2]] c <- lorenz_curve_params$gd_params$lq$reg_results$coef[[3]] z <- 89 # the poverty line for rural India, 1983. mu <- 109.9 # the actual mean of the sample. # helpful combinations z_div_mu <- z/mu mu_div_z <- mu/z"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-headcount","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.1 Poverty Headcount","title":"Grouped Data Functions","text":"pipster, can apply pipgd_pov_headcount() function determine proportion population living specified poverty line. poverty headcount can calculated manually follows: \\[H=-\\frac{1}{2 m}\\left[n+r(b+2 (z / \\mu))\\left\\{(b+2 (z / \\mu))^2-m\\right\\}^{-1 / 2}\\right]\\] Manually: Using pipster, simply : One might want calculate poverty line using povertyline = mean * times_mean instead. defining parameters, important define poverty line well, otherwise parameter times_mean ignored:","code":"H <- -(1/(2*m)) * (n + r*(b + 2*(z_div_mu)) * ((b + 2*z_div_mu)^2 - m)^(-1/2)) print(paste0(\"The poverty headcount is \", round(H*100,2), \"%\")) #> [1] \"The poverty headcount is 45.06%\" headcount1 <- pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty headcount is \", round(headcount1$headcount*100,2), \"%\"))) #> [1] \"The poverty headcount is 45.06%\" headcount2 <- pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, times_mean = 0.8, lorenz = 'lq') print(headcount2) #> povline headcount lorenz #> #> 1: 87.92 0.4403688 lq"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-gap","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.2 Poverty Gap","title":"Grouped Data Functions","text":"Next, use pipgd_pov_gap() function calculate poverty gap index. index measures average shortfall population poverty line, expressed percentage poverty line. can calculated follows: \\[PG = H - (\\mu / z) L(H)\\] Manually: Using pipster, simply :","code":"# First we calculate the value of the Lorenz curve at H: L_at_H <- pipgd_welfare_share_at(welfare = cum_welfare, weight = cum_pop, popshare = H)$dist_stats$welfare_share_at # Then we calculate the poverty gap: PG = H - mu_div_z*L_at_H print(paste0(\"The poverty gap is \", round(PG*100,2), \"%\")) #> [1] \"The poverty gap is 12.47%\" gap <- pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty gap is \", round(gap$pov_gap*100,2), \"%\"))) #> [1] \"The poverty gap is 12.47%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-severity","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.3 Poverty Severity","title":"Grouped Data Functions","text":"Finally, utilize pipgd_pov_severity() function assess poverty severity index. index considers squared poverty gap, placing weight welfare poorest. can calculated follows: \\[\\begin{aligned} & P_2=2(P G)-H \\\\ & -\\left(\\frac{\\mu}{z}\\right)^2\\left[H+b L(H)-\\left(\\frac{r}{16}\\right) \\ln \\left(\\frac{1-H / s_1}{1-H / s_2}\\right)\\right] \\end{aligned}\\] Using pipster, simply :","code":"SPG = 2*PG - H - ((mu_div_z)^2) * (a*H + b*L_at_H - (r/16) * log((1-(H/s1))/(1-(H/s2)))) print(paste0(\"The poverty severity is \", round(SPG*100,2), \"%\")) #> [1] \"The poverty severity is 4.75%\" severity <- pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty severity is \", round(severity$pov_severity*100,2), \"%\"))) #> [1] \"The poverty severity is 4.75%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"case-3-additional-inequality-and-poverty-measures","dir":"Articles","previous_headings":"","what":"Case 3: Additional Inequality and Poverty Measures","title":"Grouped Data Functions","text":"Finally, pipster can also used easily calculate additional inequality measures. Gini coefficient can calculated using pipgd_gini() like : Watts Index can calculated using pipgd_watts() like : finally, MLD (Mean Logarithmic Deviation) can calculated using pipgd_mld() like :","code":"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\" 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\" 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\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Micro Data Functions","text":"vignette shows overview pipster package functions micro data. Microdata consist detailed records individual welfare measures, consumption, expenditure, income, observation corresponds unique individual, accompanied sample weight represents individual’s proportion overall population. pipster provides series functions estimate poverty inequality measures using microdata: pipmd_pov_headcount() (FGT0) pipmd_pov_gap() (FGT1) pipmd_pov_severity() (FGT2) pipmd_gini() pipmd_mld() pipmd_watts() also provides series functions calculate distributional measures select validate best Lorenz curve subsequent estimation: pipmd_welfare_share_at() pipmd_quantile_welfare_share() pipmd_quantile() pipmd_validate_lorenz() pipmd_select_lorenz()","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"micro-data-sample","dir":"Articles","previous_headings":"","what":"Micro Data Sample","title":"Micro Data Functions","text":"vignette, explore several typical scenarios pipster package can effectively utilized. scenario, use sample dataset 1000 observations, pip_md, available package. variables following: welfare: welfare (income consumption) weight: population weights. preview data:","code":"#> welfare weight #> 1 81.5864216 7941 #> 2 61.4004171 7672 #> 3 304.4441509 2617 #> 4 1267.9985109 7912 #> 5 3.9202884 8371 #> 6 0.6881794 6819"},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"case-1-poverty-profiling","dir":"Articles","previous_headings":"","what":"Case 1: Poverty Profiling","title":"Micro Data Functions","text":"pipster allows user estimate poverty measures quickly accurately. demonstrate use, can manually calculate FGT(0), FGT(1), FGT(2), replicate using pipster functions. Foster-Greer-Thorbecke indices family poverty metrics can derived substituting different values parameter \\(\\alpha\\) following equation: \\[F G T_\\alpha=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^\\alpha\\] \\(z\\) povety line, \\(N\\) total population, \\(H\\) number poor individuals (income, \\(y_i <= z\\)).","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-headcount","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.1 Poverty Headcount","title":"Micro Data Functions","text":"poverty headcount, FGT(1) can calculated follows: \\[F G T_0=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^0 = \\frac{H}{N}\\] pipster, can simply use pipmd_pov_headcount() function:","code":"z = 1.4 # set the poverty line N = sum(pip_md$weight) H = sum(pip_md$weight[pip_md$welfare <= z]) FGT0 = H/N print(paste0(\"The poverty headcount index is \", round(FGT0*100,2), \"%\")) #> [1] \"The poverty headcount index is 37.15%\" pip_FGT0 <- pipmd_pov_headcount(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) #> Warning: replacing previous import 'collapse::fdroplevels' by #> 'data.table::fdroplevels' when loading 'wbpip' print(paste0(\"The poverty headcount index is \", round(pip_FGT0$pov_headcount*100,2), \"%\")) #> [1] \"The poverty headcount index is 37.15%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-gap","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.2 Poverty Gap","title":"Micro Data Functions","text":"poverty gap, FGT(1), can calculated follows: \\[F G T_1=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)\\] pipster, can simply use pipmd_pov_gap() function:","code":"# Calculate the shortfall: the distance between the poverty line and the income of the poor, for each poor. shortfall <- sum((z - pip_md$welfare[pip_md$welfare <= z]) * pip_md$weight[pip_md$welfare <= z])/z FGT1 <- (1/N)*(shortfall) print(paste0(\"The poverty gap index is \", round(FGT1*100,2), \"%\")) #> [1] \"The poverty gap index is 27.48%\" pip_FGT1 <- pipmd_pov_gap(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) print(paste0(\"The poverty gap index is \", round(pip_FGT1$pov_gap*100,2), \"%\")) #> [1] \"The poverty gap index is 27.48%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-severity","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.3 Poverty Severity","title":"Micro Data Functions","text":"poverty severity, FGT(2), can calculated follows: \\[F G T_2=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^2\\] pipster, can simply use pipmd_pov_severity() function:","code":"shortfall_squared <- sum(((z - pip_md$welfare[pip_md$welfare <= z]) / z)^2 * pip_md$weight[pip_md$welfare <= z]) FGT2 <- (1/N)*shortfall_squared print(paste0(\"The poverty severity index is \", round(FGT2*100,2), \"%\")) #> [1] \"The poverty severity index is 23.29%\" pip_FGT2 <- pipmd_pov_severity(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) print(paste0(\"The poverty severity index is \", round(pip_FGT2$pov_severity*100,2), \"%\")) #> [1] \"The poverty severity index is 23.29%\""},{"path":"https://pip-technical-team.github.io/pipster/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"R.Andres Castaneda. Author, maintainer. Zander Prinsloo. Author.","code":""},{"path":"https://pip-technical-team.github.io/pipster/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Castaneda R, Prinsloo Z (2024). pipster: Package (One Line, Title Case). R package version 0.0.1.9000, https://pip-technical-team.github.io/pipster/.","code":"@Manual{, title = {pipster: What the Package Does (One Line, Title Case)}, author = {R.Andres Castaneda and Zander Prinsloo}, year = {2024}, note = {R package version 0.0.1.9000}, url = {https://pip-technical-team.github.io/pipster/}, }"},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"pipster","dir":"","previous_headings":"","what":"What the Package Does (One Line, Title Case)","title":"What the Package Does (One Line, Title Case)","text":"goal pipster make use wbpip functions easily.","code":""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"What the Package Does (One Line, Title Case)","text":"can install development version pipster GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"PIP-Technical-Team/pipster\") library(pipster) library(collapse) #> Warning: package 'collapse' was built under R version 4.3.2 #> collapse 2.0.7, see ?`collapse-package` or ?`collapse-documentation` #> #> Attaching package: 'collapse' #> The following object is masked from 'package:stats': #> #> D ## basic example code"},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"group-data","dir":"","previous_headings":"Identify type of data","what":"Group Data","title":"What the Package Does (One Line, Title Case)","text":"","code":"# W: Weights, share of population, sum up to 100 # X: welfare vector with mean welfare by decile # P:Cumulative share of population # L: Cumulative share of welfare # R: share of welfare, sum up to 1. W = c(0.92, 2.47, 5.11, 7.9, 9.69, 15.24, 13.64, 16.99, 10, 9.78, 3.96, 1.81, 2.49) X = c(24.84, 35.8, 45.36, 55.1, 64.92, 77.08, 91.75, 110.64, 134.9, 167.76, 215.48, 261.66, 384.97) P = c(0.0092, 0.0339, 0.085, 0.164, 0.2609, 0.4133, 0.5497, 0.7196, 0.8196, 0.9174, 0.957, 0.9751, 1) L = c(0.00208, 0.01013, 0.03122, 0.07083, 0.12808, 0.23498, 0.34887, 0.51994, 0.6427, 0.79201, 0.86966, 0.91277, 1) R = (W * X) / sum(W * X) # type 1 ------ ## up to 1 --------- identify_pip_type(welfare = L, weight = P) #> [1] \"gd_1\" ## up to 100 --------- identify_pip_type(welfare = L*100, weight = P) #> [1] \"gd_1\" # type 2 ----------- ## up to 1 ----------- identify_pip_type(welfare = R, weight = W/100) #> ! vectors not sorted #> [1] \"gd_2\" ## up to 100 --------- identify_pip_type(welfare = R*100, weight = W) #> ! vectors not sorted #> [1] \"gd_2\" # type 5 ----------- identify_pip_type(welfare = X, weight = W/100) #> [1] \"gd_5\" # type 3 ----------- identify_pip_type(welfare = X, weight = P) #> [1] \"gd_3\""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"microdata","dir":"","previous_headings":"Identify type of data","what":"Microdata","title":"What the Package Does (One Line, Title Case)","text":"","code":"# l: length # Y: welfare # Q: population or weights # I: imputation ID l <- 300 Y <- sample(1000, l,replace = TRUE) Q <- sample(35, l,replace = TRUE) I <- sample(1:5, l,replace = TRUE) identify_pip_type(welfare = Y, weight = Q) #> ! vectors not sorted #> [1] \"md\" identify_pip_type(welfare = Y, weight = Q, imputation_id = I) #> ! vectors not sorted #> [1] \"id\" I2 <- rep(1, l) identify_pip_type(welfare = Y, weight = Q, imputation_id = I2) #> ! vectors not sorted #> [1] \"md\""},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"group-data-1","dir":"","previous_headings":"Convert to PIP format","what":"Group Data","title":"What the Package Does (One Line, Title Case)","text":"Convert Group Data Type-2 Group Data Type-1 . Notice whole dataframe parsed function need whole dataframe back. enough parsing just welfare weight vetors.","code":"pip_gd |> fselect(R,W) #> R W #> 1 0.002079692 0.92 #> 2 0.008047104 2.47 #> 3 0.021093739 5.11 #> 4 0.039613054 7.90 #> 5 0.057248211 9.69 #> 6 0.106902117 15.24 #> 7 0.113888553 13.64 #> 8 0.171066582 16.99 #> 9 0.122764156 10.00 #> 10 0.149309315 9.78 #> 11 0.077653634 3.96 #> 12 0.043099829 1.81 #> 13 0.087234016 2.49 gd <- as_pip(dt = pip_gd, welfare_var = \"R\", weight_var = \"W\", pip_type = \"gd_2\") #> i columns \"welfare\" and \"W\" have been rescaled to range (0,1] gd |> fselect(R,W) #> R W #> 1: 0.002079692 0.0092 #> 2: 0.010126796 0.0339 #> 3: 0.031220536 0.0850 #> 4: 0.070833589 0.1640 #> 5: 0.128081800 0.2609 #> 6: 0.234983917 0.4133 #> 7: 0.348872469 0.5497 #> 8: 0.519939051 0.7196 #> 9: 0.642703207 0.8196 #> 10: 0.792012522 0.9174 #> 11: 0.869666156 0.9570 #> 12: 0.912765984 0.9751 #> 13: 1.000000000 1.0000 class(gd) #> [1] \"pipgd\" \"data.table\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"micro-data","dir":"","previous_headings":"Convert to PIP format","what":"Micro Data","title":"What the Package Does (One Line, Title Case)","text":"","code":"md <- as_pip(dt = pip_md, welfare_var = \"welfare\", weight_var = \"weight\") #> ! vectors not sorted #> > PIP type identified: \"md\" waldo::compare(md, roworderv(pip_md, \"welfare\")) #> `class(old)`: \"pipmd\" \"data.table\" \"data.frame\" #> `class(new)`: \"tbl_df\" \"tbl\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":null,"dir":"Reference","previous_headings":"","what":"add PIP class — add_pip_class","title":"add PIP class — add_pip_class","text":"add PIP class","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"add PIP class — add_pip_class","text":"","code":"add_pip_class(x, pip_type)"},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"add PIP class — add_pip_class","text":"x data frame pip_type character: One \"md\", \"id\", \"gd_*\". Generally comes output identify_pip_type()","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"add PIP class — add_pip_class","text":"data frame pip class","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to PIP format and add class — as_pip","title":"Convert to PIP format and add class — as_pip","text":"Convert welfare, weight (optionally) imputed id vectors PIP format data.frame","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to PIP format and add class — as_pip","text":"","code":"as_pip( dt, welfare_var, weight_var, imputation_id_var = NULL, pip_type = NULL, groupdata_threshold = getOption(\"pipster.gd_threshold\"), verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to PIP format and add class — as_pip","text":"dt data.frame welfare data welfare_var character: variable name welfare vector dt weight_var character: variable name weight vector dt imputation_id_var character: variable name imputation ID vector dt pip_type character: One \"md\", \"id\", \"gd_*\". Generally comes output identify_pip_type() groupdata_threshold numeric: threshold discriminate micro data group data. Default 200 observations verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to PIP format and add class — as_pip","text":"data.frame","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to PIP format and add class — as_pip","text":"","code":"# Example 1: Basic usage with md data. as_pip(dt = pip_md, welfare_var = \"welfare\", weight_var = \"weight\") |> class() #> ! vectors not sorted #> → PIP type identified: \"md\" #> [1] \"pipmd\" \"data.table\" \"data.frame\" # Example 2: Including imputation_id_var as_pip(dt = pip_id, welfare_var = \"welfare\", weight_var = \"weight\", imputation_id_var = \"imputation_id\") |> class() #> ! vectors not sorted #> → PIP type identified: \"id\" #> [1] \"pipid\" \"pipmd\" \"data.table\" \"data.frame\" # Example 3: Basic usage with gd data and explicit pip_type as_pip(dt = pip_gd, welfare_var = \"L\", weight_var = \"P\", pip_type = \"gd_1\") |> class() #> Warning: replacing previous import ‘collapse::fdroplevels’ by ‘data.table::fdroplevels’ when loading ‘wbpip’ #> ℹ columns \"welfare\" and \"P\" have been rescaled to range (0,1] #> [1] \"pipgd\" \"data.table\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Check parameters of pipgd functions — check_pipgd_params","title":"Check parameters of pipgd functions — check_pipgd_params","text":"Check parameters pipgd functions","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check parameters of pipgd functions — check_pipgd_params","text":"","code":"check_pipgd_params(lp)"},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check parameters of pipgd functions — check_pipgd_params","text":"lp list parameters","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check parameters of pipgd functions — check_pipgd_params","text":"invisible TRUE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":null,"dir":"Reference","previous_headings":"","what":"Check parameters of pipmd functions — check_pipmd_pov","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"Check parameters pipmd functions","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"","code":"check_pipmd_pov()"},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"invisible TRUE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert vectors to microdata data PIP format — convert_to_pip_md","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"Convert vectors microdata data PIP format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"","code":"convert_to_pip_md( dt, welfare_var, imputation_id_var, verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"dt data.frame welfare data welfare_var character: variable name welfare vector dt imputation_id_var character: variable name imputation ID vector dt verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"dataframe","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify PIP type — identify_pip_type","title":"Identify PIP type — identify_pip_type","text":"Based welfare weight vectors identifies whether data microdata, group data imputed data","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify PIP type — identify_pip_type","text":"","code":"identify_pip_type( welfare, weight = rep(1, length(welfare)), imputation_id = NULL, groupdata_threshold = getOption(\"pipster.gd_threshold\"), verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify PIP type — identify_pip_type","text":"welfare numeric: welfare variable, either income consumption weight numeric: expansion sample weighs. Default vector o 1s length welfare imputation_id numeric: vector identifies different imputations. Default NULL groupdata_threshold numeric: threshold discriminate micro data group data. Default 200 observations verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify PIP type — identify_pip_type","text":"character length 1.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify PIP type — identify_pip_type","text":"","code":"# Group data ------- # W: Weights, share of population, sum up to 100 # X: welfare vector with mean welfare by decile # P:Cumulative share of population # L: Cumulative share of welfare # R: share of welfare, sum up to 1. W = c(0.92, 2.47, 5.11, 7.9, 9.69, 15.24, 13.64, 16.99, 10, 9.78, 3.96, 1.81, 2.49) X = c(24.84, 35.8, 45.36, 55.1, 64.92, 77.08, 91.75, 110.64, 134.9, 167.76, 215.48, 261.66, 384.97) P = c(0.0092, 0.0339, 0.085, 0.164, 0.2609, 0.4133, 0.5497, 0.7196, 0.8196, 0.9174, 0.957, 0.9751, 1) L = c(0.00208, 0.01013, 0.03122, 0.07083, 0.12808, 0.23498, 0.34887, 0.51994, 0.6427, 0.79201, 0.86966, 0.91277, 1) R = (W * X) / sum(W * X) ## type 1 ------ identify_pip_type(welfare = L, weight = P) #> [1] \"gd_1\" identify_pip_type(welfare = L*100, weight = P) #> [1] \"gd_1\" ## type 2 ----------- identify_pip_type(welfare = R, weight = W/100) #> ! vectors not sorted #> [1] \"gd_2\" identify_pip_type(welfare = R*100, weight = W) #> ! vectors not sorted #> [1] \"gd_2\" ## type 5 ----------- identify_pip_type(welfare = X, weight = W/100) #> [1] \"gd_5\" identify_pip_type(welfare = X, weight = W) #> [1] \"gd_5\" ## type 3 ----------- identify_pip_type(welfare = X, weight = P) #> [1] \"gd_3\" identify_pip_type(welfare = X, weight = P*100) #> [1] \"gd_3\" # Microdata ------- l <- 300 Y <- sample(1000, l,replace = TRUE) Q <- sample(35, l,replace = TRUE) I <- sample(1:5, l,replace = TRUE) identify_pip_type(welfare = Y, weight = Q) #> ! vectors not sorted #> [1] \"md\" identify_pip_type(welfare = Y, weight = Q, imputation_id = I) #> ! vectors not sorted #> [1] \"id\""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Check whether the vector is cumulative up to 1 — is_cumulative","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"Check whether vector cumulative 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"","code":"is_cumulative(x, digits = 8)"},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"x numeric: vector whose elements might cumulative 1 digits numeric: number digits cumulative sum threshold. Default 8 decimals","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"logical","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_gd — pip_gd","title":"pip_gd — pip_gd","text":"PIP Group Data example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_gd — pip_gd","text":"","code":"pip_gd"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_gd — pip_gd","text":"grouped data frame five variables: W Weights, share population, sum 100 X welfare vector mean welfare group P Cumulative share population L Cumulative share welfare R share welfare, sum 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"pip_gd — pip_gd","text":"Datt, Gaurav. 1998. “Computational Tools Poverty Measurement Analysis.” http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf, downloaded 2023-07-18 details, see https://datanalytics.worldbank.org/PIP-Methodology/welfareaggregate.html#tgd","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_id — pip_id","title":"pip_id — pip_id","text":"PIP imputed data example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_id — pip_id","text":"","code":"pip_id"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_id — pip_id","text":"imputed data frame three variables: welfare welfare (income consumption) weight population weights imputation_id Imputation ID","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_md — pip_md","title":"pip_md — pip_md","text":"PIP microdata example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_md — pip_md","text":"","code":"pip_md"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_md — pip_md","text":"microdata frame two variables: welfare welfare (income consumption) weight population weights","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_md_s — pip_md_s","title":"pip_md_s — pip_md_s","text":"Small PIP microdata example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_md_s — pip_md_s","text":"","code":"pip_md_s"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_md_s — pip_md_s","text":"100 obs microdata frame two variables: welfare welfare (income consumption) weight population weights","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Gini coefficient — pipgd_gini","title":"Compute Gini coefficient — pipgd_gini","text":"Gini computed using either beta quadratic Lorenz functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Gini coefficient — pipgd_gini","text":"","code":"pipgd_gini( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Gini coefficient — pipgd_gini","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Gini coefficient — pipgd_gini","text":"Returns nested list containing distribution statistics: $dist_stats$gini numeric vector containing gini coefficient. $dist_stats$lorenz numeric vector showing lorenz curve used. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Gini coefficient — pipgd_gini","text":"","code":"# Example 1: Basic Calculation of Gini Coefficient pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$gini #> [1] 0.2890171 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> # Example 2: Gini Coefficient with a Specific Lorenz Curve (e.g. Lorenz beta) pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$gini #> [1] 0.2894039 #> #> $dist_stats$lorenz #> [1] \"lb\" #> #> # Example 3: Detailed Output of Gini Calculation pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$gini #> [1] 0.2890171 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":null,"dir":"Reference","previous_headings":"","what":"Lorenz curve — pipgd_lorenz_curve","title":"Lorenz curve — pipgd_lorenz_curve","text":"Returns Lorenz curve. User provides cumulative welfare cumulative weight, well number points lorenz curve required. default, best fitting Lorenz parameterization (quadratic beta) selected.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lorenz curve — pipgd_lorenz_curve","text":"","code":"pipgd_lorenz_curve( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n_bins = 100 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lorenz curve — pipgd_lorenz_curve","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n_bins atomic double vector length 1: number points lorenz curve","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lorenz curve — pipgd_lorenz_curve","text":"Returns list contains: numeric lorenz curve, corresponding points x-axis, whether lq lb parameterization, complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lorenz curve — pipgd_lorenz_curve","text":"","code":"# Example 1: Generating a Lorenz Curve with default settings pipgd_lorenz_curve(welfare = pip_gd$L, weight = pip_gd$P) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.003286780 0.006735991 0.010341921 0.014099338 0.018003439 #> [7] 0.022049809 0.026234377 0.030553393 0.035003389 0.039581162 0.044283744 #> [13] 0.049108392 0.054052559 0.059113890 0.064290199 0.069579464 0.074979810 #> [19] 0.080489502 0.086106939 0.091830640 0.097659242 0.103591492 0.109626241 #> [25] 0.115762440 0.121999134 0.128335458 0.134770637 0.141303978 0.147934869 #> [31] 0.154662779 0.161487251 0.168407907 0.175424439 0.182536613 0.189744269 #> [37] 0.197047313 0.204445726 0.211939559 0.219528932 0.227214038 0.234995141 #> [43] 0.242872579 0.250846764 0.258918183 0.267087401 0.275355065 0.283721901 #> [49] 0.292188723 0.300756433 0.309426025 0.318198590 0.327075321 0.336057517 #> [55] 0.345146589 0.354344068 0.363651612 0.373071013 0.382604208 0.392253285 #> [61] 0.402020503 0.411908294 0.421919287 0.432056318 0.442322452 0.452721002 #> [67] 0.463255550 0.473929981 0.484748506 0.495715698 0.506836539 0.518116455 #> [73] 0.529561380 0.541177812 0.552972888 0.564954470 0.577131250 0.589512865 #> [79] 0.602110052 0.614934816 0.628000656 0.641322826 0.654918667 0.668808034 #> [85] 0.683013823 0.697562671 0.712485868 0.727820580 0.743611525 0.759913326 #> [91] 0.776793891 0.794339470 0.812662487 0.831914312 0.852307416 0.874157041 #> [97] 0.897968756 0.924654900 0.956235231 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 2: Specifying the number of bins for the Lorenz Curve pipgd_lorenz_curve(welfare = pip_gd$L, weight = pip_gd$P, n_bins = 50) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.006808033 0.014255849 0.022302075 0.030911793 0.040055347 #> [7] 0.049707427 0.059846372 0.070453613 0.081513244 0.093011673 0.104937348 #> [13] 0.117280536 0.130033146 0.143188589 0.156741666 0.170688490 0.185026418 #> [19] 0.199754014 0.214871027 0.230378386 0.246278213 0.262573861 0.279269957 #> [25] 0.296372487 0.313888885 0.331828163 0.350201075 0.369020310 0.388300749 #> [31] 0.408059777 0.428317676 0.449098123 0.470428821 0.492342315 0.514877054 #> [37] 0.538078796 0.562002505 0.586714954 0.612298402 0.638855924 0.666519417 #> [43] 0.695462132 0.725919329 0.758224630 0.792879765 0.830705384 0.873231159 #> [49] 0.924071589 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.02040816 0.04081633 0.06122449 0.08163265 0.10204082 #> [7] 0.12244898 0.14285714 0.16326531 0.18367347 0.20408163 0.22448980 #> [13] 0.24489796 0.26530612 0.28571429 0.30612245 0.32653061 0.34693878 #> [19] 0.36734694 0.38775510 0.40816327 0.42857143 0.44897959 0.46938776 #> [25] 0.48979592 0.51020408 0.53061224 0.55102041 0.57142857 0.59183673 #> [31] 0.61224490 0.63265306 0.65306122 0.67346939 0.69387755 0.71428571 #> [37] 0.73469388 0.75510204 0.77551020 0.79591837 0.81632653 0.83673469 #> [43] 0.85714286 0.87755102 0.89795918 0.91836735 0.93877551 0.95918367 #> [49] 0.97959184 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 3: Using pre-calculated parameters use_params <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) pipgd_lorenz_curve(params = use_params) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.003286780 0.006735991 0.010341921 0.014099338 0.018003439 #> [7] 0.022049809 0.026234377 0.030553393 0.035003389 0.039581162 0.044283744 #> [13] 0.049108392 0.054052559 0.059113890 0.064290199 0.069579464 0.074979810 #> [19] 0.080489502 0.086106939 0.091830640 0.097659242 0.103591492 0.109626241 #> [25] 0.115762440 0.121999134 0.128335458 0.134770637 0.141303978 0.147934869 #> [31] 0.154662779 0.161487251 0.168407907 0.175424439 0.182536613 0.189744269 #> [37] 0.197047313 0.204445726 0.211939559 0.219528932 0.227214038 0.234995141 #> [43] 0.242872579 0.250846764 0.258918183 0.267087401 0.275355065 0.283721901 #> [49] 0.292188723 0.300756433 0.309426025 0.318198590 0.327075321 0.336057517 #> [55] 0.345146589 0.354344068 0.363651612 0.373071013 0.382604208 0.392253285 #> [61] 0.402020503 0.411908294 0.421919287 0.432056318 0.442322452 0.452721002 #> [67] 0.463255550 0.473929981 0.484748506 0.495715698 0.506836539 0.518116455 #> [73] 0.529561380 0.541177812 0.552972888 0.564954470 0.577131250 0.589512865 #> [79] 0.602110052 0.614934816 0.628000656 0.641322826 0.654918667 0.668808034 #> [85] 0.683013823 0.697562671 0.712485868 0.727820580 0.743611525 0.759913326 #> [91] 0.776793891 0.794339470 0.812662487 0.831914312 0.852307416 0.874157041 #> [97] 0.897968756 0.924654900 0.956235231 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 4: Generating Lorenz Curve with a specific Lorenz model(e.g. Lorenz beta) pipgd_lorenz_curve(params = use_params, lorenz = \"lb\") #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.002359208 0.005529581 0.009030258 0.012766584 0.016694612 #> [7] 0.020788888 0.025032840 0.029414865 0.033926425 0.038561009 0.043313520 #> [13] 0.048179882 0.053156792 0.058241540 0.063431882 0.068725953 0.074122193 #> [19] 0.079619304 0.085216200 0.090911983 0.096705914 0.102597394 0.108585948 #> [25] 0.114671213 0.120852923 0.127130905 0.133505068 0.139975397 0.146541950 #> [31] 0.153204853 0.159964294 0.166820523 0.173773849 0.180824638 0.187973311 #> [37] 0.195220344 0.202566265 0.210011658 0.217557159 0.225203457 0.232951296 #> [43] 0.240801475 0.248754849 0.256812330 0.264974888 0.273243555 0.281619425 #> [49] 0.290103658 0.298697483 0.307402198 0.316219176 0.325149871 0.334195817 #> [55] 0.343358638 0.352640049 0.362041866 0.371566009 0.381214512 0.390989529 #> [61] 0.400893345 0.410928383 0.421097220 0.431402595 0.441847427 0.452434826 #> [67] 0.463168118 0.474050857 0.485086857 0.496280210 0.507635324 0.519156952 #> [73] 0.530850234 0.542720746 0.554774551 0.567018266 0.579459137 0.592105126 #> [79] 0.604965026 0.618048584 0.631366666 0.644931449 0.658756669 0.672857922 #> [85] 0.687253062 0.701962704 0.717010891 0.732425994 0.748241930 0.764499898 #> [91] 0.781250867 0.798559334 0.816509188 0.835213413 0.854831234 0.875601306 #> [97] 0.897914640 0.922509170 0.951207864 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lb\" #> #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute MLD — pipgd_mld","title":"Compute MLD — pipgd_mld","text":"MLD (Mean Logarithimic Deviation) computed using either beta quadratic Lorenz functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute MLD — pipgd_mld","text":"","code":"pipgd_mld( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute MLD — pipgd_mld","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute MLD — pipgd_mld","text":"Returns nested list containing distribution statistics: $dist_stats$mld numeric vector containing mld calculation. $dist_stats$lorenz numeric vector showing lorenz curve used. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute MLD — pipgd_mld","text":"","code":"# Example 1: Basic MLD Calculation pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$mld #> [1] 0.1376809 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> # Example 2: MLD with a Specific Lorenz Curve pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$mld #> [1] 0.1405595 #> #> $dist_stats$lorenz #> [1] \"lb\" #> #> # Example 3: Detailed Output of MLD Calculation pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$mld #> [1] 0.1376809 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Group Data Parameters — pipgd_params","title":"Get Group Data Parameters — pipgd_params","text":"Get Parameters key values derived quadratic Beta Lorenz parametrization. welfare population must vectors group data dataset","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Group Data Parameters — pipgd_params","text":"","code":"pipgd_params(welfare, weight, mean = NULL, population = NULL)"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Group Data Parameters — pipgd_params","text":"welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default NULL population numeric scalar actual size population. Default NULL","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Group Data Parameters — pipgd_params","text":"Returns pipgd_params object Group data parameters accessible $gd_params data used accessible $data.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get Group Data Parameters — pipgd_params","text":"Datt, G. 1998. \"Computational Tools Poverty Measurement Analysis\". FCND Discussion Paper 50. World Bank, Washington, DC. Krause, M. 2013. \"Corrigendum Elliptical Lorenz curves\". Journal Econometrics 174 (1): 44. Villasenor, J., B. C. Arnold. 1989. \"Elliptical Lorenz curves\". Journal Econometrics 40 (2): 327-338.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Group Data Parameters — pipgd_params","text":"","code":"# Example 1: Get Lorenz parameters res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 2 #> ..$ welfare: num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res) # Example 2: Get Lorenz parameters with Specific Mean actual_mean <- 90 res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P, mean = actual_mean) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 3 #> ..$ welfare: num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> ..$ mean : num 90 #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res) # Example 3: Get Lorenz parameters with Specific Population Count actual_pop <- 1000 res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P, population = actual_pop) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 3 #> ..$ welfare : num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> ..$ population: num 1000 #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res)"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty gap (FGT1) — pipgd_pov_gap","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"Estimate poverty gap (FGT1)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"","code":"pipgd_pov_gap( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"Returns data.table data.frame object three variables: povline, pov_gap, lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline pov_gap lorenz #> #> 1: 89 0.1273534 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline pov_gap lorenz #> #> 1: 0.5 0.02500299 lb #> 2: 1.0 0.20523323 lb #> 3: 2.0 0.52208004 lb #> 4: 3.0 0.67289468 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$pov_gap #> [1] 0.02500299 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$pov_gap #> [1] 0.2052332 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$pov_gap #> [1] 0.52208 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$pov_gap #> [1] 0.6728947 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.02500299 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.2052332 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.52208 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.6728947 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.02500299 0.20523323 0.52208004 0.67289468 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"function vectorized. Use pipgd_pov_gap instead","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"","code":"pipgd_pov_gap_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"numeric poverty gap value","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"Estimate poverty headcount (FGT0)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"","code":"pipgd_pov_headcount( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"Returns data.table data.frame object three variables: povline, headcount, lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline headcount lorenz #> #> 1: 89 0.4511816 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline headcount lorenz #> #> 1: 0.5 0.1331300 lb #> 2: 1.0 0.6161877 lb #> 3: 2.0 0.9500443 lb #> 4: 3.0 0.9876954 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$headcount #> [1] 0.13313 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$headcount #> [1] 0.6161877 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$headcount #> [1] 0.9500443 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$headcount #> [1] 0.9876954 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.1331300 0.6161877 0.9500443 0.9876954 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"function vectorized thus exported. Use pipgd_pov_headcount instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"","code":"pipgd_pov_headcount_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"numeric poverty headcount","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty severity — pipgd_pov_severity","title":"Estimate poverty severity — pipgd_pov_severity","text":"Estimate poverty severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty severity — pipgd_pov_severity","text":"","code":"pipgd_pov_severity( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, pov_gap = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty severity — pipgd_pov_severity","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta pov_gap list: NULL (default), welfare weight arguments used estimate underlying parameters. Else, list output pipgd_pov_gap_nv. complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty severity — pipgd_pov_severity","text":"Returns data.table data.frame object two variables: pov_severity lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty severity — pipgd_pov_severity","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline pov_severity lorenz #> #> 1: 89 0.04966338 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline pov_severity lorenz #> #> 1: 0.5 0.007590746 lb #> 2: 1.0 0.090218282 lb #> 3: 2.0 0.321801149 lb #> 4: 3.0 0.482687436 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$pov_severity #> [1] 0.007590746 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$pov_severity #> [1] 0.09021828 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$pov_severity #> [1] 0.3218011 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$pov_severity #> [1] 0.4826874 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.02500299 #> #> $pov_stats$pov_severity #> [1] 0.007590746 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.2052332 #> #> $pov_stats$pov_severity #> [1] 0.09021828 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.52208 #> #> $pov_stats$pov_severity #> [1] 0.3218011 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.6728947 #> #> $pov_stats$pov_severity #> [1] 0.4826874 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.007590746 0.090218282 0.321801149 0.482687436 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"function vectorized thus exported. Use pipgd_pov_severity instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"","code":"pipgd_pov_severity_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, pov_gap = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta pov_gap list: NULL (default), welfare weight arguments used estimate underlying parameters. Else, list output pipgd_pov_gap_nv. complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"list: contains numeric poverty severity , complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Get quantile at specified shared of population - grouped data — pipgd_quantile","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"pipgd_quantile returns quantile (.e., monetary value) corresponds share population lives threshold.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"","code":"pipgd_quantile( params = NULL, welfare = NULL, weight = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), mean = 1, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n) mean numeric scalar distribution mean. Default 1 complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$quantile numeric vector showing corresponding quantile. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"basically inverse estimating poverty rate (headcount population share) poverty line. case, provide headcount pipgd_quantile returns \"poverty line\". quantiles calculated function mean distribution times x factor. Basically, quantile x times mean. default, mean equal 1, implies , mean value provided, return value equal x. NOTE: outcome pipgd_quantile necessarily inverse pipgd_pov_headcount. reason , pipgd_pov_headcount selects Lorenz parametrization fits better specified point distribution (.e., poverty lines). pipgd_quantile, contrast, use Lorenz parametrization point. lorenz used one fits best distributional measures.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"","code":"# Example 1: Basic usage with default parameters pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.4581878 0.5697811 0.6679802 0.7617734 0.8582851 0.9657644 1.0978575 #> [8] 1.2861477 1.6470281 5.8269953 #> #> # Example 2: Specifying a custom number of quantiles pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$quantile #> [1] 0.5697811 0.7617734 0.9657644 1.2861477 5.8269953 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- c(0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95) pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.05 0.10 0.15 0.20 0.25 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.95 #> #> $dist_stats$quantile #> [1] 0.3929136 0.4581878 0.5163987 0.5697811 0.6199097 0.6679802 0.7617734 #> [8] 0.8582851 0.9657644 1.0978575 1.2861477 1.6470281 2.0918353 #> #> # Example 4: Specifying a different Lorenz curve ('lb', Lorenz beta) pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.4635670 0.5668074 0.6615363 0.7579823 0.8617611 0.9791821 1.1208976 #> [8] 1.3113561 1.6379028 Inf #> #> # Example 5: Detailed output with complete = TRUE and different mean factor pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, mean = 1.5, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.6872817 0.8546717 1.0019703 1.1426602 1.2874277 1.4486466 1.6467862 #> [8] 1.9292215 2.4705422 8.7404929 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantile welfare share — pipgd_quantile_welfare_share","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"pipgd_quantile_welfare_share returns share welfare held particular quantile. Notice pipgd_welfare_share_at get share welfare held particular share population, sense cumulative share. Instead, pipgd_quantile_welfare_share returns proportion welfare specified quantile holds.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"","code":"pipgd_quantile_welfare_share( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n) )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$quantile_welfare_share numeric vector showing corresponding share welfare. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"","code":"# Example 1: Basic usage with default parameters pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 2: Specifying a custom quantile (e.g. 5) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.09067747 0.13345103 0.17201737 0.22138237 0.38247176 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- seq(from = 1/13, to = 1, length.out = 13) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.07692308 0.15384615 0.23076923 0.30769231 0.38461538 0.46153846 #> [7] 0.53846154 0.61538462 0.69230769 0.76923077 0.84615385 0.92307692 #> [13] 1.00000000 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 4: Using a different Lorenz curve (e.g., Lorenz Beta) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 5: Detailed output with complete = TRUE pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":null,"dir":"Reference","previous_headings":"","what":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"Get selected Lorenz curve distributional stats","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"","code":"pipgd_select_lorenz( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"Returns list values best lorenz fit given distributional Stats.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"","code":"# Example 1: Directly using welfare and weight vectors. pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 2: Specifying mean and poverty line. custom_mean <- sum(pip_gd$W * pip_gd$X) / sum(pip_gd$W) pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P, mean = custom_mean, povline = 1.25) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lq\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] TRUE #> #> # Example 3.1: Using parameters from pipgd_validate_lorenz() validated_parameters <- pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) pipgd_select_lorenz(params = validated_parameters) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 3.2: Piping from from pipgd_params |> pipgd_validate_lorenz() pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) |> pipgd_validate_lorenz(complete = TRUE)|> pipgd_select_lorenz() #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 4: Detailed output with complete = TRUE pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":null,"dir":"Reference","previous_headings":"","what":"Check validity of Lorenz Curve — pipgd_validate_lorenz","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"Check validity Lorenz Curve","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"","code":"pipgd_validate_lorenz( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"params list parameters pipgd_params() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric: welfare mean distribution. times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"Returns nested list distributional validity Lorenz model accessible $gd_params$lq$validity$is_normal Lorenz beta $gd_params$lq$validity$is_normal Lorenz quadratic.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"","code":"# Example 1: Validate Lorenz Curves using pre-calculated parameters. parameters <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) pipgd_validate_lorenz(params = parameters) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> # Example 2: Directly using welfare and weight vectors. pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> # Example 3: Specifying mean and poverty line pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, mean = mean(pip_gd$X), povline = 50) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.04732287 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 128.481538461538 and a poverty line of 50;0.389160968950942 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.04550107 #> #> #> #> # Example 4: Using a custom population share pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, popshare = 0.5) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.5 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.861761080993303;0.861761080993303 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.5 #> #> #> #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Watts poverty index — pipgd_watts","title":"Estimate Watts poverty index — pipgd_watts","text":"Computes Watts Index either beta quadratic Lorenz fit. first distribution-sensitive poverty measure proposed 1968 Watts. defined mean across population proportionate poverty gaps, measured log ratio poverty line income, mean formed whole population, counting nonpoor zero poverty gap.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Watts poverty index — pipgd_watts","text":"","code":"pipgd_watts( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Watts poverty index — pipgd_watts","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Watts poverty index — pipgd_watts","text":"Returns data.table data.frame object two variables: watts lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Watts poverty index — pipgd_watts","text":"","code":"# Example 1: Basic usage with the pip_gd dataset and default poverty line pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P) #> povline watts lorenz #> #> 1: 1 0.2775801 lb # Example 2: Specifying a different poverty line and output as a list pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, povline = 1.9, format = \"list\") #> $pl1.9 #> $pl1.9$pov_stats #> $pl1.9$pov_stats$watts #> [1] 0.7973243 #> #> $pl1.9$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 3: Detailed output with complete = TRUE pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, format = \"list\", complete = TRUE) #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$watts #> [1] 0.2775801 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 4: Custom mean and times_mean with data.table format pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.9, times_mean = 1.5) #> povline watts lorenz #> #> 1: 164.85 0.5828177 lb"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"function vectorized thus exported. Use pipgd_watts instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"","code":"pipgd_watts_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"list: contains numeric Watts ratio , complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Welfare share by quantile in group data — pipgd_welfare_share_at","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"pipgd_welfare_share_at returns share welfare held specified share population parameter popshare. Alternatively, can select number quantiles (10 default), estimate corresponding share welfare .","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"","code":"pipgd_welfare_share_at( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n) )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$welfare_share_at numeric vector showing corresponding share welfare. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"","code":"# Example 1: Basic usage with default parameters pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03911772 0.09067747 0.15263425 0.22412849 0.30507843 0.39614586 #> [7] 0.49903558 0.61752824 0.76157408 1.00000000 #> #> # Example 2: Specifying a custom number of quantiles (n = 5) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.09067747 0.22412849 0.39614586 0.61752824 1.00000000 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- seq(from = 1/13, to = 1, length.out = 13) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.07692308 0.15384615 0.23076923 0.30769231 0.38461538 0.46153846 #> [7] 0.53846154 0.61538462 0.69230769 0.76923077 0.84615385 0.92307692 #> [13] 1.00000000 #> #> $dist_stats$welfare_share_at #> [1] 0.02887655 0.06550084 0.10869119 0.15780056 0.21251996 0.27280064 #> [7] 0.33884270 0.41114336 0.49063514 0.57902253 0.67970615 0.80128755 #> [13] 1.00000000 #> #> # Example 4: Using a specified Lorenz curve (e.g., Lorenz Beta) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03809217 0.08976495 0.15119586 0.22213280 0.30303589 0.39493547 #> [7] 0.49966955 0.62069307 0.76615187 1.00000000 #> #> # Example 5: Detailed output with complete = TRUE pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03911772 0.09067747 0.15263425 0.22412849 0.30507843 0.39614586 #> [7] 0.49903558 0.61752824 0.76157408 1.00000000 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":null,"dir":"Reference","previous_headings":"","what":"Gini coefficient — pipmd_gini","title":"Gini coefficient — pipmd_gini","text":"Compute Gini coefficient microdata.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gini coefficient — pipmd_gini","text":"","code":"pipmd_gini( welfare, weight = rep(1, length = length(welfare)), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gini coefficient — pipmd_gini","text":"welfare welfare vector weight population weight vector format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gini coefficient — pipmd_gini","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gini coefficient — pipmd_gini","text":"Given vector income consumption values respective weights pipmd_gini() computes Gini coefficient distribution.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gini coefficient — pipmd_gini","text":"","code":"# Example 1: Basic Gini coefficient calculation with default settings pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: gini 0.4190533 # Example 2: Returning Gini coefficient in data.table format pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"dt\") #> indicator value #> #> 1: gini 0.4190533 # Example 3: Returning Gini coefficient as an atomic value pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") #> gini #> 0.4190533 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\" # Example 4: Using equal weights (weight vector is NULL) pipmd_gini(welfare = pip_md_s$welfare, format = \"list\") #> $gini #> [1] 0.4080793 #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":null,"dir":"Reference","previous_headings":"","what":"Mean Log Deviation — pipmd_mld","title":"Mean Log Deviation — pipmd_mld","text":"Given vector weights welfare, functions computes Mean Log Deviation (MLD).","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mean Log Deviation — pipmd_mld","text":"","code":"pipmd_mld( welfare, weight = rep(1, length = length(welfare)), mean = NULL, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mean Log Deviation — pipmd_mld","text":"welfare welfare vector weight population weight vector mean numeric: weighted welfare mean. Default NULL. format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mean Log Deviation — pipmd_mld","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mean Log Deviation — pipmd_mld","text":"","code":"# Example 1: Basic usage with default settings pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: mld 0.3016201 # Example 2: Specifying mean and returning as a list custom_mean <- mean(pip_md_s$welfare) pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight, mean = custom_mean, format = \"list\") #> $mld #> [1] 0.2606041 #> # Example 3: Returning MLD as an atomic value pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") #> mld #> 0.3016201 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\" # Example 4: Using equal weights (weight vector is NULL) pipmd_mld(welfare = pip_md_s$welfare, format = \"list\") #> $mld #> [1] 0.283235 #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":null,"dir":"Reference","previous_headings":"","what":"Wolfson polarization index — pipmd_polarization","title":"Wolfson polarization index — pipmd_polarization","text":"Compute Wolfson polarization index microdata.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wolfson polarization index — pipmd_polarization","text":"","code":"pipmd_polarization( welfare, weight = rep(1, length = length(welfare)), gini = NULL, mean = NULL, median = NULL, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wolfson polarization index — pipmd_polarization","text":"welfare welfare vector weight population weight vector gini numeric: gini coefficient. NULL (default) uses pipmd_gini calculate gini. mean numeric: weighted welfare mean. Default NULL. median numeric: weighted welfare mean. Default NULL. format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wolfson polarization index — pipmd_polarization","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Wolfson polarization index — pipmd_polarization","text":"Given vector income consumption values respective weights pipmd_polarization() computes Wolfson polarization index.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wolfson polarization index — pipmd_polarization","text":"","code":"# Example 1: Basic polarization calculation with default settings pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: polarization 0.4301155 # Example 2: Specifying Gini coefficient, mean, and median custom_gini <- pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") custom_mean <- mean(pip_md_s$welfare) custom_median <- median(pip_md_s$welfare) pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight, gini = custom_gini, mean = custom_mean, median = custom_median, format = \"list\") #> $polarization #> [1] 0.4038148 #> rm(custom_gini, custom_mean, custom_median) # Example 3: Returning polarization index in data.table format pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"dt\") #> indicator value #> #> 1: polarization 0.4301155 # Example 4: Using equal weights (weight vector is NULL) pipmd_polarization(welfare = pip_md_s$welfare, format = \"atomic\") #> polarization #> 0.3827663 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty gap from microdata — pipmd_pov_gap","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"Calculate poverty gap microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"","code":"pipmd_pov_gap( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"data.table data.frame object length equal povline vector variables povline pov_gap. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"","code":"# Example 1: Basic poverty gap calculation pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_gap #> [1] 0.0673906 #> #> # Example 2: Returning data.table format, multiple povline. pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_gap #> #> 1: 1.3 0.06739060 #> 2: 1.2 0.05631327 # Example 3: Returning atomic format pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.0673906"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"Non-vectorized poverty gap microdata function. Use vectorized function pipmd_pov_gap","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"","code":"pipmd_pov_gap_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"numeric: Poverty gap","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty headcount from microdata — pipmd_pov_headcount","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"Calculate poverty headcount microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"","code":"pipmd_pov_headcount( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"data.table data.frame object length equal povline vector variables povline pov_headcount. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_headcount #> [1] 0.208561 #> #> # Example 2: Returning data.table format, multiple povline. pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_headcount #> #> 1: 1.3 0.2085610 #> 2: 1.2 0.1917473 # Example 3: Returning atomic format pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.208561"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"Non-vectorized poverty headcount microdata function. Use vectorized function pipmd_pov_headcount","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"","code":"pipmd_pov_headcount_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"numeric: Poverty headcount ratio","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty severity from microdata — pipmd_pov_severity","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"Calculate poverty severity microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"","code":"pipmd_pov_severity( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"data.table data.frame object length equal povline vector variables povline pov_severity. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_severity #> [1] 0.02972097 #> #> # Example 2: Returning data.table format and multiple povline pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_severity #> #> 1: 1.3 0.02972097 #> 2: 1.2 0.02413119 # Example 3: Returning atomic format pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.02972097"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"Non-vectorized poverty severity microdata function. Use vectorized function pipmd_pov_severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"","code":"pipmd_pov_severity_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"numeric: Poverty severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Get quantile at specified shared of population - micro data — pipmd_quantile","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"pipmd_quantile returns quantile (.e., monetary value) corresponds share population lives threshold.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"","code":"pipmd_quantile( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"Returns data.table data.frame object two variables: quantile value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"basically inverse estimating poverty rate (headcount population share) poverty line. case, provide headcount pipmd_quantile returns \"poverty line\". quantiles calculated function mean distribution times x factor. Basically, quantile x times mean. default, mean equal 1, implies , mean value provided, return value equal x.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"","code":"# Example 1: Calculating quintiles. pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, format = \"list\") #> $`20%` #> [1] 1.266062 #> #> $`40%` #> [1] 1.945387 #> #> $`60%` #> [1] 2.986672 #> #> $`80%` #> [1] 4.836562 #> #> $`100%` #> [1] 18.01952 #> # Example 2: Calculating deciles with data.table format. pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 10, format = \"dt\") #> quantile values #> #> 1: q_10% 0.8454755 #> 2: q_20% 1.2660622 #> 3: q_30% 1.6202722 #> 4: q_40% 1.9453871 #> 5: q_50% 2.3513837 #> 6: q_60% 2.9866717 #> 7: q_70% 3.6777302 #> 8: q_80% 4.8365623 #> 9: q_90% 7.3149182 #> 10: q_100% 18.0195166 # Example 3: Calculating quantiles at specific population shares and format atomic. specific_popshares <- seq(from = 0, to = 1, length.out = 100) pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"atomic\") #> 10% 20% 30% 40% 50% 60% 70% #> 0.8454755 1.2660622 1.6202722 1.9453871 2.3513837 2.9866717 3.6777302 #> 80% 90% 100% #> 4.8365623 7.3149182 18.0195166"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantile welfare share — pipmd_quantile_welfare_share","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"pipmd_quantile_welfare_share returns share welfare held particular quantile. Notice pipmd_welfare_share_at get share welfare held particular share population, sense cumulative share. Instead, pipmd_quantile_welfare_share returns proportion welfare specified quantile holds.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"","code":"pipmd_quantile_welfare_share( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"Returns data.table data.frame object two variables: quantile share_at. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"","code":"# Example 1: Basic usage with default quantiles (10) pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> quantile share_at #> #> 1: q_10% 0.01599470 #> 2: q_20% 0.03758688 #> 3: q_30% 0.04517520 #> 4: q_40% 0.06755463 #> 5: q_50% 0.06777595 #> 6: q_60% 0.10813059 #> 7: q_70% 0.08360875 #> 8: q_80% 0.14695423 #> 9: q_90% 0.18607431 #> 10: q_100% 0.24114476 # Example 2: Specifying a different number of quantiles pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, # For quintiles format = \"list\") #> $`20%` #> [1] 0.05358158 #> #> $`40%` #> [1] 0.1127298 #> #> $`60%` #> [1] 0.1759065 #> #> $`80%` #> [1] 0.230563 #> #> $`100%` #> [1] 0.4272191 #> # Example 3: Using specific population shares specific_popshares <- seq(from = 0.1, to = 1, by = 0.1) # Deciles pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"dt\") #> quantile share_at #> #> 1: q_10% 0.01599470 #> 2: q_20% 0.03758688 #> 3: q_30% 0.04517520 #> 4: q_40% 0.06755463 #> 5: q_50% 0.06777595 #> 6: q_60% 0.10813059 #> 7: q_70% 0.08360875 #> 8: q_80% 0.14695423 #> 9: q_90% 0.18607431 #> 10: q_100% 0.24114476 rm(specific_popshares) # Example 4: Returning atomic format pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 4, # For quartiles format = \"atomic\") #> 25% 50% 75% 100% #> 0.0840979 0.1499895 0.2535388 0.5123738"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Watts index from microdata — pipmd_watts","title":"Calculate Watts index from microdata — pipmd_watts","text":"Calculate Watts index microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Watts index from microdata — pipmd_watts","text":"","code":"pipmd_watts( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Watts index from microdata — pipmd_watts","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Watts index from microdata — pipmd_watts","text":"data.table data.frame object length equal povline vector variables povline pov_severity. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Watts index from microdata — pipmd_watts","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$watts #> [1] 0.09129307 #> #> # Example 2: Returning data.table format pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline watts #> #> 1: 1.3 0.09129307 #> 2: 1.2 0.07527149 # Example 3: Returning atomic format pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.09129307"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Watts index using microdata — pipmd_watts_nv","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"Non-vectorized Watts index microdata function. Use vectorized function pipmd_watts","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"","code":"pipmd_watts_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"numeric: Watts index","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Welfare share by quantile in micro data — pipmd_welfare_share_at","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"pipmd_welfare_share_at returns share welfare held specified share population parameter popshare. Alternatively, can select number quantiles (10 default), estimate corresponding share welfare .","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"","code":"pipmd_welfare_share_at( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"Returns data.table data.frame object two variables: quantile share_at. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"","code":"# Example 1: Basic usage with default quantiles (10) pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> quantile share_at #> #> 1: q_10% 0.1088235 #> 2: q_20% 0.2070236 #> 3: q_30% 0.2993178 #> 4: q_40% 0.4131093 #> 5: q_50% 0.4988916 #> 6: q_60% 0.6124656 #> 7: q_70% 0.7001452 #> 8: q_80% 0.8032207 #> 9: q_90% 0.9117696 #> 10: q_100% 1.0000000 # Example 2: Specifying a different number of quantiles pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, # For quintiles format = \"list\") #> $`20%` #> [1] 0.2070236 #> #> $`40%` #> [1] 0.4131093 #> #> $`60%` #> [1] 0.6124656 #> #> $`80%` #> [1] 0.8032207 #> #> $`100%` #> [1] 1 #> # Example 3: Using specific population shares specific_popshares <- seq(from = 0.1, to = 1, by = 0.1) # Deciles pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"dt\") #> quantile share_at #> #> 1: q_10% 0.1088235 #> 2: q_20% 0.2070236 #> 3: q_30% 0.2993178 #> 4: q_40% 0.4131093 #> 5: q_50% 0.4988916 #> 6: q_60% 0.6124656 #> 7: q_70% 0.7001452 #> 8: q_80% 0.8032207 #> 9: q_90% 0.9117696 #> 10: q_100% 1.0000000 # Example 4: Returning atomic format pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 4, # For quartiles format = \"atomic\") #> 25% 50% 75% 100% #> 0.2641149 0.4988916 0.7536647 1.0000000"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":null,"dir":"Reference","previous_headings":"","what":"pipster: Poverty and Inequality methodology of WB methodology — pipster","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"higher-level package estimate socioeconomic indicators poverty inequality using methodology World Bank. packages mainly wrapper lower-level package wbpip","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"","code":".datatable.aware"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"object class logical length 1.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"pipster-functions","dir":"Reference","previous_headings":"","what":"pipster functions","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"pipster functions divided X groups. first, important set functions estimate specific indicators using input welfare weights vector microdata group data.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Return data according to format — return_format","title":"Return data according to format — return_format","text":"Return data according format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return data according to format — return_format","text":"","code":"return_format( ld, var, povline = NULL, complete = FALSE, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return data according to format — return_format","text":"ld list data var character: name variable returned. povline numeric: poverty line complete logical: format = \"list\" complete = TRUE gives complete information output. format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return data according to format — return_format","text":"data.table, list, atomic vector","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":null,"dir":"Reference","previous_headings":"","what":"Return data according to format - microdata — return_format_md","title":"Return data according to format - microdata — return_format_md","text":"Return data according format - microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return data according to format - microdata — return_format_md","text":"","code":"return_format_md( ld, var, povline, complete = FALSE, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return data according to format - microdata — return_format_md","text":"ld list data var character: name variable returned. povline numeric: poverty line complete logical: format = \"list\" complete = TRUE gives complete information output. format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return data according to format - microdata — return_format_md","text":"determined format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"return md dist data format — return_format_md_dist","title":"return md dist data format — return_format_md_dist","text":"return md dist data format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"return md dist data format — return_format_md_dist","text":"","code":"return_format_md_dist(p, name, format = \"atomic\")"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"return md dist data format — return_format_md_dist","text":"p object md_dist functions name character: name indicator format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"return md dist data format — return_format_md_dist","text":"depending format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"functions uses heuristic round sum closest integers, possible vectors intended sum 1, fail precision.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"","code":"sum_up_to_one(x, digits = 0)"},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"x numeric: vector whose elements might sum 1 100 digits numeric: threshold sum. Default 0 decimals","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"logical","code":""}] +[{"path":"https://pip-technical-team.github.io/pipster/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 pipster authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Grouped Data Functions","text":"vignette shows overview pipster package functions grouped data. Grouped data consumption expenditure income data organized intervals bins, deciles percentiles. order estimate poverty inequality measures grouped data, one derive continuous Lorenz curve use together mean welfare build full distribution. pipster provides series functions estimate poverty inequality measures, based methodology Datt (1998): pipgd_pov_headcount() (FGT0) pipgd_pov_gap() (FGT1) pipgd_pov_severity() (FGT2) pipgd_gini() pipgd_mld() pipgd_watts() also provides series functions calculate distributional measures select validate best Lorenz curve subsequent estimation: pipgd_welfare_share_at() pipgd_quantile_welfare_share() pipgd_quantile() pipgd_validate_lorenz() pipgd_select_lorenz()","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"sample-grouped-data","dir":"Articles","previous_headings":"","what":"Sample Grouped Data","title":"Grouped Data Functions","text":"vignette, explore several typical scenarios pipster package can effectively utilized. scenario, use sample dataset, pip_gd, available package obtained Datt (1998). dataset shows distribution consumption expenditure rural India 1983. variables following: W: Weights, share population, sum 100. X: Welfare vector mean welfare group. P: Cumulative share population. L: Cumulative share welfare. R: Share welfare, sum 1.","code":"#> W X P L R #> 1 0.92 24.84 0.0092 0.00208 0.002079692 #> 2 2.47 35.80 0.0339 0.01013 0.008047104 #> 3 5.11 45.36 0.0850 0.03122 0.021093739 #> 4 7.90 55.10 0.1640 0.07083 0.039613054 #> 5 9.69 64.92 0.2609 0.12808 0.057248211 #> 6 15.24 77.08 0.4133 0.23498 0.106902117 #> 7 13.64 91.75 0.5497 0.34887 0.113888553 #> 8 16.99 110.64 0.7196 0.51994 0.171066582 #> 9 10.00 134.90 0.8196 0.64270 0.122764156 #> 10 9.78 167.76 0.9174 0.79201 0.149309315 #> 11 3.96 215.48 0.9570 0.86966 0.077653634 #> 12 1.81 261.66 0.9751 0.91277 0.043099829 #> 13 2.49 384.97 1.0000 1.00000 0.087234016"},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"welfare-share-at-a-given-population-share","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.1 Welfare share at a given population share","title":"Grouped Data Functions","text":"One simple use case calculating welfare share specific share population, can achieved using pipgd_welfare_share_at(): complete = FALSE, output list. results can accessed like :","code":"# Calculate the welfare share at a given population share selected_popshare <- 0.5 welfare_share_50 <- pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, popshare = selected_popshare, complete = FALSE) #> Warning: replacing previous import 'collapse::fdroplevels' by #> 'data.table::fdroplevels' when loading 'wbpip' # Format the string with the given values formatted_message <- sprintf(\"%.0f%% of the population owns %.0f%% of welfare.\", selected_popshare * 100, welfare_share_50$dist_stats$welfare_share_at[[1]] * 100) print(formatted_message) #> [1] \"50% of the population owns 31% of welfare.\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"quantile-share-vs-cumulative-share","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.2 Quantile share vs cumulative share","title":"Grouped Data Functions","text":"pipster selection functions calculate welfare shares. n declared, pipgd_quantile_welfare_share() calculate share welfare owned specific share population, pipgd_welfare_share_at() return cumulative share:","code":"quantile_welfare_share <- pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, n = 5, complete = FALSE) quantile_welfare_share_at <- pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, n = 5, complete = FALSE) # Combine into a dataframe for practicality df_combined <- data.frame( popshare = quantile_welfare_share$dist_stats$popshare, quantile_share = quantile_welfare_share$dist_stats$quantile_welfare_share, cumulative_share = quantile_welfare_share_at$dist_stats$welfare_share_at ) # View the combined dataframe print(df_combined) #> popshare quantile_share cumulative_share #> 1 0.2 0.09067747 0.09067747 #> 2 0.4 0.13345103 0.22412849 #> 3 0.6 0.17201737 0.39614586 #> 4 0.8 0.22138237 0.61752824 #> 5 1.0 0.38247176 1.00000000"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"estimate-and-plot-the-lorenz-curve","dir":"Articles","previous_headings":"Case 1: Simple Welfare Analysis and Lorenz Curve","what":"1.3 Estimate and Plot the Lorenz Curve","title":"Grouped Data Functions","text":"pister can also used estimate Lorenz curve dataset grouped data. One hypothetical workflow: First, generate parameters using pipgd_params() Validate parameters using pipgd_validate_lorenz() Generate Lorenz curve using validated parameters pipgd_lorenz_curve()","code":"# Validate Lorenz curve. parameters <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) validated_lorenz <- pipgd_validate_lorenz(params = parameters, complete = TRUE) # Select the best Lorenz curve and check which method has been used. selected_lorenz <- pipgd_select_lorenz(params = validated_lorenz) lorenz_used_for_dist <- selected_lorenz$selected_lorenz$for_dist lorenz_used_for_pov <- selected_lorenz$selected_lorenz$for_pov formatted_message <- sprintf(\"%s used for distribution statistics and %s used for poverty metrics.\", lorenz_used_for_dist, lorenz_used_for_pov) print(formatted_message) #> [1] \"lq used for distribution statistics and lb used for poverty metrics.\" # Plot the Lorenz Curve lorenz_curve_data <- pipgd_lorenz_curve(params = validated_lorenz) plot(lorenz_curve_data$lorenz_curve$points, lorenz_curve_data$lorenz_curve$output, type = 'l', col = 'blue', xlab = 'Cumulative Share of Population', ylab = 'Cumulative Share of Welfare', main = 'Lorenz Curve', xlim = c(0, 1), ylim = c(0, 1), xaxs = \"i\", yaxs = \"i\") # Add the line of equality abline(0, 1, col = 'red', lty = 2)"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"case-2-poverty-profiling-manual-vs-pipster","dir":"Articles","previous_headings":"","what":"Case 2: Poverty Profiling Manual vs Pipster","title":"Grouped Data Functions","text":"pipster allows user estimate poverty measures quickly accurately using Lorenz curve. demonstrate use, can manually calculate FGT(0), FGT(1), FGT(2), replicate using pipster functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"manual-parameters","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.0 Manual parameters","title":"Grouped Data Functions","text":"Following Datt(1998), first derive necessary parameters Lorenz curve using pipgd_lorenz_curve(): pipster suggests use lb, Lorenz beta, poverty measures estimation. use lq instead compare results ones reported article. retrieve parameters assign objects:","code":"# STEP 0 : assign variables cum_welfare <- pip_gd$L cum_pop <- pip_gd$P # STEP 1: Estimate Lorenz Curve lorenz_curve_params <- pipgd_lorenz_curve(welfare = cum_welfare, weight = cum_pop, complete = TRUE) print(lorenz_curve_params$selected_lorenz$for_pov) #> [1] \"lb\" # parameters m <- lorenz_curve_params$gd_params$lq$key_values$m n <- lorenz_curve_params$gd_params$lq$key_values$n r <- lorenz_curve_params$gd_params$lq$key_values$r s1 <- lorenz_curve_params$gd_params$lq$key_values$s1 s2 <- lorenz_curve_params$gd_params$lq$key_values$s2 a <- lorenz_curve_params$gd_params$lq$reg_results$coef[[1]] b <- lorenz_curve_params$gd_params$lq$reg_results$coef[[2]] c <- lorenz_curve_params$gd_params$lq$reg_results$coef[[3]] z <- 89 # the poverty line for rural India, 1983. mu <- 109.9 # the actual mean of the sample. # helpful combinations z_div_mu <- z/mu mu_div_z <- mu/z"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-headcount","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.1 Poverty Headcount","title":"Grouped Data Functions","text":"pipster, can apply pipgd_pov_headcount() function determine proportion population living specified poverty line. poverty headcount can calculated manually follows: \\[H=-\\frac{1}{2 m}\\left[n+r(b+2 (z / \\mu))\\left\\{(b+2 (z / \\mu))^2-m\\right\\}^{-1 / 2}\\right]\\] Manually: Using pipster, simply : One might want calculate poverty line using povertyline = mean * times_mean instead. defining parameters, important define poverty line well, otherwise parameter times_mean ignored:","code":"H <- -(1/(2*m)) * (n + r*(b + 2*(z_div_mu)) * ((b + 2*z_div_mu)^2 - m)^(-1/2)) print(paste0(\"The poverty headcount is \", round(H*100,2), \"%\")) #> [1] \"The poverty headcount is 45.06%\" headcount1 <- pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty headcount is \", round(headcount1$headcount*100,2), \"%\"))) #> [1] \"The poverty headcount is 45.06%\" headcount2 <- pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, times_mean = 0.8, lorenz = 'lq') print(headcount2) #> povline headcount lorenz #> #> 1: 87.92 0.4403688 lq"},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-gap","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.2 Poverty Gap","title":"Grouped Data Functions","text":"Next, use pipgd_pov_gap() function calculate poverty gap index. index measures average shortfall population poverty line, expressed percentage poverty line. can calculated follows: \\[PG = H - (\\mu / z) L(H)\\] Manually: Using pipster, simply :","code":"# First we calculate the value of the Lorenz curve at H: L_at_H <- pipgd_welfare_share_at(welfare = cum_welfare, weight = cum_pop, popshare = H)$dist_stats$welfare_share_at # Then we calculate the poverty gap: PG = H - mu_div_z*L_at_H print(paste0(\"The poverty gap is \", round(PG*100,2), \"%\")) #> [1] \"The poverty gap is 12.47%\" gap <- pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty gap is \", round(gap$pov_gap*100,2), \"%\"))) #> [1] \"The poverty gap is 12.47%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"poverty-severity","dir":"Articles","previous_headings":"Case 2: Poverty Profiling Manual vs Pipster","what":"2.3 Poverty Severity","title":"Grouped Data Functions","text":"Finally, utilize pipgd_pov_severity() function assess poverty severity index. index considers squared poverty gap, placing weight welfare poorest. can calculated follows: \\[\\begin{aligned} & P_2=2(P G)-H \\\\ & -\\left(\\frac{\\mu}{z}\\right)^2\\left[H+b L(H)-\\left(\\frac{r}{16}\\right) \\ln \\left(\\frac{1-H / s_1}{1-H / s_2}\\right)\\right] \\end{aligned}\\] Using pipster, simply :","code":"SPG = 2*PG - H - ((mu_div_z)^2) * (a*H + b*L_at_H - (r/16) * log((1-(H/s1))/(1-(H/s2)))) print(paste0(\"The poverty severity is \", round(SPG*100,2), \"%\")) #> [1] \"The poverty severity is 4.75%\" severity <- pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, mean = mu, povline = z, lorenz = 'lq') print((paste0(\"The poverty severity is \", round(severity$pov_severity*100,2), \"%\"))) #> [1] \"The poverty severity is 4.75%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/gd_functions.html","id":"case-3-additional-inequality-and-poverty-measures","dir":"Articles","previous_headings":"","what":"Case 3: Additional Inequality and Poverty Measures","title":"Grouped Data Functions","text":"Finally, pipster can also used easily calculate additional inequality measures. Gini coefficient can calculated using pipgd_gini() like : Watts Index can calculated using pipgd_watts() like : finally, MLD (Mean Logarithmic Deviation) can calculated using pipgd_mld() like :","code":"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\" 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\" 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\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"overview","dir":"Articles","previous_headings":"","what":"Overview","title":"Micro Data Functions","text":"vignette shows overview pipster package functions micro data. Microdata consist detailed records individual welfare measures, consumption, expenditure, income, observation corresponds unique individual, accompanied sample weight represents individual’s proportion overall population. pipster provides series functions estimate poverty inequality measures using microdata: pipmd_pov_headcount() (FGT0) pipmd_pov_gap() (FGT1) pipmd_pov_severity() (FGT2) pipmd_gini() pipmd_mld() pipmd_watts() also provides series functions calculate distributional measures select validate best Lorenz curve subsequent estimation: pipmd_welfare_share_at() pipmd_quantile_welfare_share() pipmd_quantile() pipmd_validate_lorenz() pipmd_select_lorenz()","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"micro-data-sample","dir":"Articles","previous_headings":"","what":"Micro Data Sample","title":"Micro Data Functions","text":"vignette, explore several typical scenarios pipster package can effectively utilized. scenario, use sample dataset 1000 observations, pip_md, available package. variables following: welfare: welfare (income consumption) weight: population weights. preview data:","code":"#> welfare weight #> 1 81.5864216 7941 #> 2 61.4004171 7672 #> 3 304.4441509 2617 #> 4 1267.9985109 7912 #> 5 3.9202884 8371 #> 6 0.6881794 6819"},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"case-1-poverty-profiling","dir":"Articles","previous_headings":"","what":"Case 1: Poverty Profiling","title":"Micro Data Functions","text":"pipster allows user estimate poverty measures quickly accurately. demonstrate use, can manually calculate FGT(0), FGT(1), FGT(2), replicate using pipster functions. Foster-Greer-Thorbecke indices family poverty metrics can derived substituting different values parameter \\(\\alpha\\) following equation: \\[F G T_\\alpha=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^\\alpha\\] \\(z\\) povety line, \\(N\\) total population, \\(H\\) number poor individuals (income, \\(y_i <= z\\)).","code":""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-headcount","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.1 Poverty Headcount","title":"Micro Data Functions","text":"poverty headcount, FGT(1) can calculated follows: \\[F G T_0=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^0 = \\frac{H}{N}\\] pipster, can simply use pipmd_pov_headcount() function:","code":"z = 1.4 # set the poverty line N = sum(pip_md$weight) H = sum(pip_md$weight[pip_md$welfare <= z]) FGT0 = H/N print(paste0(\"The poverty headcount index is \", round(FGT0*100,2), \"%\")) #> [1] \"The poverty headcount index is 37.15%\" pip_FGT0 <- pipmd_pov_headcount(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) #> Warning: replacing previous import 'collapse::fdroplevels' by #> 'data.table::fdroplevels' when loading 'wbpip' print(paste0(\"The poverty headcount index is \", round(pip_FGT0$pov_headcount*100,2), \"%\")) #> [1] \"The poverty headcount index is 37.15%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-gap","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.2 Poverty Gap","title":"Micro Data Functions","text":"poverty gap, FGT(1), can calculated follows: \\[F G T_1=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)\\] pipster, can simply use pipmd_pov_gap() function:","code":"# Calculate the shortfall: the distance between the poverty line and the income of the poor, for each poor. shortfall <- sum((z - pip_md$welfare[pip_md$welfare <= z]) * pip_md$weight[pip_md$welfare <= z])/z FGT1 <- (1/N)*(shortfall) print(paste0(\"The poverty gap index is \", round(FGT1*100,2), \"%\")) #> [1] \"The poverty gap index is 27.48%\" pip_FGT1 <- pipmd_pov_gap(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) print(paste0(\"The poverty gap index is \", round(pip_FGT1$pov_gap*100,2), \"%\")) #> [1] \"The poverty gap index is 27.48%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"poverty-severity","dir":"Articles","previous_headings":"Case 1: Poverty Profiling","what":"1.3 Poverty Severity","title":"Micro Data Functions","text":"poverty severity, FGT(2), can calculated follows: \\[F G T_2=\\frac{1}{N} \\sum_{=1}^H\\left(\\frac{z-y_i}{z}\\right)^2\\] pipster, can simply use pipmd_pov_severity() function:","code":"shortfall_squared <- sum(((z - pip_md$welfare[pip_md$welfare <= z]) / z)^2 * pip_md$weight[pip_md$welfare <= z]) FGT2 <- (1/N)*shortfall_squared print(paste0(\"The poverty severity index is \", round(FGT2*100,2), \"%\")) #> [1] \"The poverty severity index is 23.29%\" pip_FGT2 <- pipmd_pov_severity(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) print(paste0(\"The poverty severity index is \", round(pip_FGT2$pov_severity*100,2), \"%\")) #> [1] \"The poverty severity index is 23.29%\""},{"path":"https://pip-technical-team.github.io/pipster/articles/md_functions.html","id":"case-2-inequality-measures-additional-inequality-and-poverty-measures","dir":"Articles","previous_headings":"","what":"Case 2: Inequality Measures: Additional Inequality and Poverty Measures","title":"Micro Data Functions","text":"pipster can also used easily calculate additional inequality measures. Gini coefficient can calculated using pipmd_gini() like : Watts Index can calculated using pipgd_watts() like : finally, MLD (Mean Logarithmic Deviation) can calculated using pipgd_mld() like :","code":"gini <- pipmd_gini(welfare = pip_md$welfare, weight = pip_md$weight) print((paste0(\"The gini index is \", round(gini$value,2)))) #> [1] \"The gini index is -0.29\" watts <- pipmd_watts(welfare = pip_md$welfare, weight = pip_md$weight, povline = z) print((paste0(\"The Watts index is \", round(watts$watts, 2)))) #> [1] \"The Watts index is 0.48\" mld <- pipmd_mld(welfare = pip_md$welfare, weight = pip_md$weight) print((paste0(\"The MLD is \", round(mld$value,2)))) #> [1] \"The MLD is 4.57\""},{"path":"https://pip-technical-team.github.io/pipster/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"R.Andres Castaneda. Author, maintainer. Zander Prinsloo. Author.","code":""},{"path":"https://pip-technical-team.github.io/pipster/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Castaneda R, Prinsloo Z (2024). pipster: Package (One Line, Title Case). R package version 0.0.1.9000, https://pip-technical-team.github.io/pipster/.","code":"@Manual{, title = {pipster: What the Package Does (One Line, Title Case)}, author = {R.Andres Castaneda and Zander Prinsloo}, year = {2024}, note = {R package version 0.0.1.9000}, url = {https://pip-technical-team.github.io/pipster/}, }"},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"pipster","dir":"","previous_headings":"","what":"What the Package Does (One Line, Title Case)","title":"What the Package Does (One Line, Title Case)","text":"goal pipster make use wbpip functions easily.","code":""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"What the Package Does (One Line, Title Case)","text":"can install development version pipster GitHub :","code":"# install.packages(\"devtools\") devtools::install_github(\"PIP-Technical-Team/pipster\") library(pipster) library(collapse) #> Warning: package 'collapse' was built under R version 4.3.2 #> collapse 2.0.7, see ?`collapse-package` or ?`collapse-documentation` #> #> Attaching package: 'collapse' #> The following object is masked from 'package:stats': #> #> D ## basic example code"},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"group-data","dir":"","previous_headings":"Identify type of data","what":"Group Data","title":"What the Package Does (One Line, Title Case)","text":"","code":"# W: Weights, share of population, sum up to 100 # X: welfare vector with mean welfare by decile # P:Cumulative share of population # L: Cumulative share of welfare # R: share of welfare, sum up to 1. W = c(0.92, 2.47, 5.11, 7.9, 9.69, 15.24, 13.64, 16.99, 10, 9.78, 3.96, 1.81, 2.49) X = c(24.84, 35.8, 45.36, 55.1, 64.92, 77.08, 91.75, 110.64, 134.9, 167.76, 215.48, 261.66, 384.97) P = c(0.0092, 0.0339, 0.085, 0.164, 0.2609, 0.4133, 0.5497, 0.7196, 0.8196, 0.9174, 0.957, 0.9751, 1) L = c(0.00208, 0.01013, 0.03122, 0.07083, 0.12808, 0.23498, 0.34887, 0.51994, 0.6427, 0.79201, 0.86966, 0.91277, 1) R = (W * X) / sum(W * X) # type 1 ------ ## up to 1 --------- identify_pip_type(welfare = L, weight = P) #> [1] \"gd_1\" ## up to 100 --------- identify_pip_type(welfare = L*100, weight = P) #> [1] \"gd_1\" # type 2 ----------- ## up to 1 ----------- identify_pip_type(welfare = R, weight = W/100) #> ! vectors not sorted #> [1] \"gd_2\" ## up to 100 --------- identify_pip_type(welfare = R*100, weight = W) #> ! vectors not sorted #> [1] \"gd_2\" # type 5 ----------- identify_pip_type(welfare = X, weight = W/100) #> [1] \"gd_5\" # type 3 ----------- identify_pip_type(welfare = X, weight = P) #> [1] \"gd_3\""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"microdata","dir":"","previous_headings":"Identify type of data","what":"Microdata","title":"What the Package Does (One Line, Title Case)","text":"","code":"# l: length # Y: welfare # Q: population or weights # I: imputation ID l <- 300 Y <- sample(1000, l,replace = TRUE) Q <- sample(35, l,replace = TRUE) I <- sample(1:5, l,replace = TRUE) identify_pip_type(welfare = Y, weight = Q) #> ! vectors not sorted #> [1] \"md\" identify_pip_type(welfare = Y, weight = Q, imputation_id = I) #> ! vectors not sorted #> [1] \"id\" I2 <- rep(1, l) identify_pip_type(welfare = Y, weight = Q, imputation_id = I2) #> ! vectors not sorted #> [1] \"md\""},{"path":[]},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"group-data-1","dir":"","previous_headings":"Convert to PIP format","what":"Group Data","title":"What the Package Does (One Line, Title Case)","text":"Convert Group Data Type-2 Group Data Type-1 . Notice whole dataframe parsed function need whole dataframe back. enough parsing just welfare weight vetors.","code":"pip_gd |> fselect(R,W) #> R W #> 1 0.002079692 0.92 #> 2 0.008047104 2.47 #> 3 0.021093739 5.11 #> 4 0.039613054 7.90 #> 5 0.057248211 9.69 #> 6 0.106902117 15.24 #> 7 0.113888553 13.64 #> 8 0.171066582 16.99 #> 9 0.122764156 10.00 #> 10 0.149309315 9.78 #> 11 0.077653634 3.96 #> 12 0.043099829 1.81 #> 13 0.087234016 2.49 gd <- as_pip(dt = pip_gd, welfare_var = \"R\", weight_var = \"W\", pip_type = \"gd_2\") #> i columns \"welfare\" and \"W\" have been rescaled to range (0,1] gd |> fselect(R,W) #> R W #> 1: 0.002079692 0.0092 #> 2: 0.010126796 0.0339 #> 3: 0.031220536 0.0850 #> 4: 0.070833589 0.1640 #> 5: 0.128081800 0.2609 #> 6: 0.234983917 0.4133 #> 7: 0.348872469 0.5497 #> 8: 0.519939051 0.7196 #> 9: 0.642703207 0.8196 #> 10: 0.792012522 0.9174 #> 11: 0.869666156 0.9570 #> 12: 0.912765984 0.9751 #> 13: 1.000000000 1.0000 class(gd) #> [1] \"pipgd\" \"data.table\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/index.html","id":"micro-data","dir":"","previous_headings":"Convert to PIP format","what":"Micro Data","title":"What the Package Does (One Line, Title Case)","text":"","code":"md <- as_pip(dt = pip_md, welfare_var = \"welfare\", weight_var = \"weight\") #> ! vectors not sorted #> > PIP type identified: \"md\" waldo::compare(md, roworderv(pip_md, \"welfare\")) #> `class(old)`: \"pipmd\" \"data.table\" \"data.frame\" #> `class(new)`: \"tbl_df\" \"tbl\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":null,"dir":"Reference","previous_headings":"","what":"add PIP class — add_pip_class","title":"add PIP class — add_pip_class","text":"add PIP class","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"add PIP class — add_pip_class","text":"","code":"add_pip_class(x, pip_type)"},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"add PIP class — add_pip_class","text":"x data frame pip_type character: One \"md\", \"id\", \"gd_*\". Generally comes output identify_pip_type()","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/add_pip_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"add PIP class — add_pip_class","text":"data frame pip class","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert to PIP format and add class — as_pip","title":"Convert to PIP format and add class — as_pip","text":"Convert welfare, weight (optionally) imputed id vectors PIP format data.frame","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert to PIP format and add class — as_pip","text":"","code":"as_pip( dt, welfare_var, weight_var, imputation_id_var = NULL, pip_type = NULL, groupdata_threshold = getOption(\"pipster.gd_threshold\"), verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert to PIP format and add class — as_pip","text":"dt data.frame welfare data welfare_var character: variable name welfare vector dt weight_var character: variable name weight vector dt imputation_id_var character: variable name imputation ID vector dt pip_type character: One \"md\", \"id\", \"gd_*\". Generally comes output identify_pip_type() groupdata_threshold numeric: threshold discriminate micro data group data. Default 200 observations verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert to PIP format and add class — as_pip","text":"data.frame","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/as_pip.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert to PIP format and add class — as_pip","text":"","code":"# Example 1: Basic usage with md data. as_pip(dt = pip_md, welfare_var = \"welfare\", weight_var = \"weight\") |> class() #> ! vectors not sorted #> → PIP type identified: \"md\" #> [1] \"pipmd\" \"data.table\" \"data.frame\" # Example 2: Including imputation_id_var as_pip(dt = pip_id, welfare_var = \"welfare\", weight_var = \"weight\", imputation_id_var = \"imputation_id\") |> class() #> ! vectors not sorted #> → PIP type identified: \"id\" #> [1] \"pipid\" \"pipmd\" \"data.table\" \"data.frame\" # Example 3: Basic usage with gd data and explicit pip_type as_pip(dt = pip_gd, welfare_var = \"L\", weight_var = \"P\", pip_type = \"gd_1\") |> class() #> Warning: replacing previous import ‘collapse::fdroplevels’ by ‘data.table::fdroplevels’ when loading ‘wbpip’ #> ℹ columns \"welfare\" and \"P\" have been rescaled to range (0,1] #> [1] \"pipgd\" \"data.table\" \"data.frame\""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Check parameters of pipgd functions — check_pipgd_params","title":"Check parameters of pipgd functions — check_pipgd_params","text":"Check parameters pipgd functions","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check parameters of pipgd functions — check_pipgd_params","text":"","code":"check_pipgd_params(lp)"},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check parameters of pipgd functions — check_pipgd_params","text":"lp list parameters","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipgd_params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check parameters of pipgd functions — check_pipgd_params","text":"invisible TRUE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":null,"dir":"Reference","previous_headings":"","what":"Check parameters of pipmd functions — check_pipmd_pov","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"Check parameters pipmd functions","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"","code":"check_pipmd_pov()"},{"path":"https://pip-technical-team.github.io/pipster/reference/check_pipmd_pov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check parameters of pipmd functions — check_pipmd_pov","text":"invisible TRUE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert vectors to microdata data PIP format — convert_to_pip_md","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"Convert vectors microdata data PIP format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"","code":"convert_to_pip_md( dt, welfare_var, imputation_id_var, verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"dt data.frame welfare data welfare_var character: variable name welfare vector dt imputation_id_var character: variable name imputation ID vector dt verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/convert_to_pip_md.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert vectors to microdata data PIP format — convert_to_pip_md","text":"dataframe","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify PIP type — identify_pip_type","title":"Identify PIP type — identify_pip_type","text":"Based welfare weight vectors identifies whether data microdata, group data imputed data","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify PIP type — identify_pip_type","text":"","code":"identify_pip_type( welfare, weight = rep(1, length(welfare)), imputation_id = NULL, groupdata_threshold = getOption(\"pipster.gd_threshold\"), verbose = getOption(\"pipster.verbose\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify PIP type — identify_pip_type","text":"welfare numeric: welfare variable, either income consumption weight numeric: expansion sample weighs. Default vector o 1s length welfare imputation_id numeric: vector identifies different imputations. Default NULL groupdata_threshold numeric: threshold discriminate micro data group data. Default 200 observations verbose logical: Whether display important messages data query","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify PIP type — identify_pip_type","text":"character length 1.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/identify_pip_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify PIP type — identify_pip_type","text":"","code":"# Group data ------- # W: Weights, share of population, sum up to 100 # X: welfare vector with mean welfare by decile # P:Cumulative share of population # L: Cumulative share of welfare # R: share of welfare, sum up to 1. W = c(0.92, 2.47, 5.11, 7.9, 9.69, 15.24, 13.64, 16.99, 10, 9.78, 3.96, 1.81, 2.49) X = c(24.84, 35.8, 45.36, 55.1, 64.92, 77.08, 91.75, 110.64, 134.9, 167.76, 215.48, 261.66, 384.97) P = c(0.0092, 0.0339, 0.085, 0.164, 0.2609, 0.4133, 0.5497, 0.7196, 0.8196, 0.9174, 0.957, 0.9751, 1) L = c(0.00208, 0.01013, 0.03122, 0.07083, 0.12808, 0.23498, 0.34887, 0.51994, 0.6427, 0.79201, 0.86966, 0.91277, 1) R = (W * X) / sum(W * X) ## type 1 ------ identify_pip_type(welfare = L, weight = P) #> [1] \"gd_1\" identify_pip_type(welfare = L*100, weight = P) #> [1] \"gd_1\" ## type 2 ----------- identify_pip_type(welfare = R, weight = W/100) #> ! vectors not sorted #> [1] \"gd_2\" identify_pip_type(welfare = R*100, weight = W) #> ! vectors not sorted #> [1] \"gd_2\" ## type 5 ----------- identify_pip_type(welfare = X, weight = W/100) #> [1] \"gd_5\" identify_pip_type(welfare = X, weight = W) #> [1] \"gd_5\" ## type 3 ----------- identify_pip_type(welfare = X, weight = P) #> [1] \"gd_3\" identify_pip_type(welfare = X, weight = P*100) #> [1] \"gd_3\" # Microdata ------- l <- 300 Y <- sample(1000, l,replace = TRUE) Q <- sample(35, l,replace = TRUE) I <- sample(1:5, l,replace = TRUE) identify_pip_type(welfare = Y, weight = Q) #> ! vectors not sorted #> [1] \"md\" identify_pip_type(welfare = Y, weight = Q, imputation_id = I) #> ! vectors not sorted #> [1] \"id\""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Check whether the vector is cumulative up to 1 — is_cumulative","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"Check whether vector cumulative 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"","code":"is_cumulative(x, digits = 8)"},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"x numeric: vector whose elements might cumulative 1 digits numeric: number digits cumulative sum threshold. Default 8 decimals","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/is_cumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check whether the vector is cumulative up to 1 — is_cumulative","text":"logical","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_gd — pip_gd","title":"pip_gd — pip_gd","text":"PIP Group Data example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_gd — pip_gd","text":"","code":"pip_gd"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_gd — pip_gd","text":"grouped data frame five variables: W Weights, share population, sum 100 X welfare vector mean welfare group P Cumulative share population L Cumulative share welfare R share welfare, sum 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_gd.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"pip_gd — pip_gd","text":"Datt, Gaurav. 1998. “Computational Tools Poverty Measurement Analysis.” http://ebrary.ifpri.org/utils/getfile/collection/p15738coll2/id/125673/filename/125704.pdf, downloaded 2023-07-18 details, see https://datanalytics.worldbank.org/PIP-Methodology/welfareaggregate.html#tgd","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_id — pip_id","title":"pip_id — pip_id","text":"PIP imputed data example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_id — pip_id","text":"","code":"pip_id"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_id.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_id — pip_id","text":"imputed data frame three variables: welfare welfare (income consumption) weight population weights imputation_id Imputation ID","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_md — pip_md","title":"pip_md — pip_md","text":"PIP microdata example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_md — pip_md","text":"","code":"pip_md"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_md — pip_md","text":"microdata frame two variables: welfare welfare (income consumption) weight population weights","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":null,"dir":"Reference","previous_headings":"","what":"pip_md_s — pip_md_s","title":"pip_md_s — pip_md_s","text":"Small PIP microdata example.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pip_md_s — pip_md_s","text":"","code":"pip_md_s"},{"path":"https://pip-technical-team.github.io/pipster/reference/pip_md_s.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pip_md_s — pip_md_s","text":"100 obs microdata frame two variables: welfare welfare (income consumption) weight population weights","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute Gini coefficient — pipgd_gini","title":"Compute Gini coefficient — pipgd_gini","text":"Gini computed using either beta quadratic Lorenz functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute Gini coefficient — pipgd_gini","text":"","code":"pipgd_gini( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute Gini coefficient — pipgd_gini","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute Gini coefficient — pipgd_gini","text":"Returns nested list containing distribution statistics: $dist_stats$gini numeric vector containing gini coefficient. $dist_stats$lorenz numeric vector showing lorenz curve used. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_gini.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute Gini coefficient — pipgd_gini","text":"","code":"# Example 1: Basic Calculation of Gini Coefficient pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$gini #> [1] 0.2890171 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> # Example 2: Gini Coefficient with a Specific Lorenz Curve (e.g. Lorenz beta) pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$gini #> [1] 0.2894039 #> #> $dist_stats$lorenz #> [1] \"lb\" #> #> # Example 3: Detailed Output of Gini Calculation pipgd_gini(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$gini #> [1] 0.2890171 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":null,"dir":"Reference","previous_headings":"","what":"Lorenz curve — pipgd_lorenz_curve","title":"Lorenz curve — pipgd_lorenz_curve","text":"Returns Lorenz curve. User provides cumulative welfare cumulative weight, well number points lorenz curve required. default, best fitting Lorenz parameterization (quadratic beta) selected.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lorenz curve — pipgd_lorenz_curve","text":"","code":"pipgd_lorenz_curve( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n_bins = 100 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lorenz curve — pipgd_lorenz_curve","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n_bins atomic double vector length 1: number points lorenz curve","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lorenz curve — pipgd_lorenz_curve","text":"Returns list contains: numeric lorenz curve, corresponding points x-axis, whether lq lb parameterization, complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_lorenz_curve.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lorenz curve — pipgd_lorenz_curve","text":"","code":"# Example 1: Generating a Lorenz Curve with default settings pipgd_lorenz_curve(welfare = pip_gd$L, weight = pip_gd$P) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.003286780 0.006735991 0.010341921 0.014099338 0.018003439 #> [7] 0.022049809 0.026234377 0.030553393 0.035003389 0.039581162 0.044283744 #> [13] 0.049108392 0.054052559 0.059113890 0.064290199 0.069579464 0.074979810 #> [19] 0.080489502 0.086106939 0.091830640 0.097659242 0.103591492 0.109626241 #> [25] 0.115762440 0.121999134 0.128335458 0.134770637 0.141303978 0.147934869 #> [31] 0.154662779 0.161487251 0.168407907 0.175424439 0.182536613 0.189744269 #> [37] 0.197047313 0.204445726 0.211939559 0.219528932 0.227214038 0.234995141 #> [43] 0.242872579 0.250846764 0.258918183 0.267087401 0.275355065 0.283721901 #> [49] 0.292188723 0.300756433 0.309426025 0.318198590 0.327075321 0.336057517 #> [55] 0.345146589 0.354344068 0.363651612 0.373071013 0.382604208 0.392253285 #> [61] 0.402020503 0.411908294 0.421919287 0.432056318 0.442322452 0.452721002 #> [67] 0.463255550 0.473929981 0.484748506 0.495715698 0.506836539 0.518116455 #> [73] 0.529561380 0.541177812 0.552972888 0.564954470 0.577131250 0.589512865 #> [79] 0.602110052 0.614934816 0.628000656 0.641322826 0.654918667 0.668808034 #> [85] 0.683013823 0.697562671 0.712485868 0.727820580 0.743611525 0.759913326 #> [91] 0.776793891 0.794339470 0.812662487 0.831914312 0.852307416 0.874157041 #> [97] 0.897968756 0.924654900 0.956235231 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 2: Specifying the number of bins for the Lorenz Curve pipgd_lorenz_curve(welfare = pip_gd$L, weight = pip_gd$P, n_bins = 50) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.006808033 0.014255849 0.022302075 0.030911793 0.040055347 #> [7] 0.049707427 0.059846372 0.070453613 0.081513244 0.093011673 0.104937348 #> [13] 0.117280536 0.130033146 0.143188589 0.156741666 0.170688490 0.185026418 #> [19] 0.199754014 0.214871027 0.230378386 0.246278213 0.262573861 0.279269957 #> [25] 0.296372487 0.313888885 0.331828163 0.350201075 0.369020310 0.388300749 #> [31] 0.408059777 0.428317676 0.449098123 0.470428821 0.492342315 0.514877054 #> [37] 0.538078796 0.562002505 0.586714954 0.612298402 0.638855924 0.666519417 #> [43] 0.695462132 0.725919329 0.758224630 0.792879765 0.830705384 0.873231159 #> [49] 0.924071589 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.02040816 0.04081633 0.06122449 0.08163265 0.10204082 #> [7] 0.12244898 0.14285714 0.16326531 0.18367347 0.20408163 0.22448980 #> [13] 0.24489796 0.26530612 0.28571429 0.30612245 0.32653061 0.34693878 #> [19] 0.36734694 0.38775510 0.40816327 0.42857143 0.44897959 0.46938776 #> [25] 0.48979592 0.51020408 0.53061224 0.55102041 0.57142857 0.59183673 #> [31] 0.61224490 0.63265306 0.65306122 0.67346939 0.69387755 0.71428571 #> [37] 0.73469388 0.75510204 0.77551020 0.79591837 0.81632653 0.83673469 #> [43] 0.85714286 0.87755102 0.89795918 0.91836735 0.93877551 0.95918367 #> [49] 0.97959184 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 3: Using pre-calculated parameters use_params <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) pipgd_lorenz_curve(params = use_params) #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.003286780 0.006735991 0.010341921 0.014099338 0.018003439 #> [7] 0.022049809 0.026234377 0.030553393 0.035003389 0.039581162 0.044283744 #> [13] 0.049108392 0.054052559 0.059113890 0.064290199 0.069579464 0.074979810 #> [19] 0.080489502 0.086106939 0.091830640 0.097659242 0.103591492 0.109626241 #> [25] 0.115762440 0.121999134 0.128335458 0.134770637 0.141303978 0.147934869 #> [31] 0.154662779 0.161487251 0.168407907 0.175424439 0.182536613 0.189744269 #> [37] 0.197047313 0.204445726 0.211939559 0.219528932 0.227214038 0.234995141 #> [43] 0.242872579 0.250846764 0.258918183 0.267087401 0.275355065 0.283721901 #> [49] 0.292188723 0.300756433 0.309426025 0.318198590 0.327075321 0.336057517 #> [55] 0.345146589 0.354344068 0.363651612 0.373071013 0.382604208 0.392253285 #> [61] 0.402020503 0.411908294 0.421919287 0.432056318 0.442322452 0.452721002 #> [67] 0.463255550 0.473929981 0.484748506 0.495715698 0.506836539 0.518116455 #> [73] 0.529561380 0.541177812 0.552972888 0.564954470 0.577131250 0.589512865 #> [79] 0.602110052 0.614934816 0.628000656 0.641322826 0.654918667 0.668808034 #> [85] 0.683013823 0.697562671 0.712485868 0.727820580 0.743611525 0.759913326 #> [91] 0.776793891 0.794339470 0.812662487 0.831914312 0.852307416 0.874157041 #> [97] 0.897968756 0.924654900 0.956235231 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lq\" #> #> # Example 4: Generating Lorenz Curve with a specific Lorenz model(e.g. Lorenz beta) pipgd_lorenz_curve(params = use_params, lorenz = \"lb\") #> $lorenz_curve #> $lorenz_curve$output #> [1] 0.000000000 0.002359208 0.005529581 0.009030258 0.012766584 0.016694612 #> [7] 0.020788888 0.025032840 0.029414865 0.033926425 0.038561009 0.043313520 #> [13] 0.048179882 0.053156792 0.058241540 0.063431882 0.068725953 0.074122193 #> [19] 0.079619304 0.085216200 0.090911983 0.096705914 0.102597394 0.108585948 #> [25] 0.114671213 0.120852923 0.127130905 0.133505068 0.139975397 0.146541950 #> [31] 0.153204853 0.159964294 0.166820523 0.173773849 0.180824638 0.187973311 #> [37] 0.195220344 0.202566265 0.210011658 0.217557159 0.225203457 0.232951296 #> [43] 0.240801475 0.248754849 0.256812330 0.264974888 0.273243555 0.281619425 #> [49] 0.290103658 0.298697483 0.307402198 0.316219176 0.325149871 0.334195817 #> [55] 0.343358638 0.352640049 0.362041866 0.371566009 0.381214512 0.390989529 #> [61] 0.400893345 0.410928383 0.421097220 0.431402595 0.441847427 0.452434826 #> [67] 0.463168118 0.474050857 0.485086857 0.496280210 0.507635324 0.519156952 #> [73] 0.530850234 0.542720746 0.554774551 0.567018266 0.579459137 0.592105126 #> [79] 0.604965026 0.618048584 0.631366666 0.644931449 0.658756669 0.672857922 #> [85] 0.687253062 0.701962704 0.717010891 0.732425994 0.748241930 0.764499898 #> [91] 0.781250867 0.798559334 0.816509188 0.835213413 0.854831234 0.875601306 #> [97] 0.897914640 0.922509170 0.951207864 1.000000000 #> #> $lorenz_curve$points #> [1] 0.00000000 0.01010101 0.02020202 0.03030303 0.04040404 0.05050505 #> [7] 0.06060606 0.07070707 0.08080808 0.09090909 0.10101010 0.11111111 #> [13] 0.12121212 0.13131313 0.14141414 0.15151515 0.16161616 0.17171717 #> [19] 0.18181818 0.19191919 0.20202020 0.21212121 0.22222222 0.23232323 #> [25] 0.24242424 0.25252525 0.26262626 0.27272727 0.28282828 0.29292929 #> [31] 0.30303030 0.31313131 0.32323232 0.33333333 0.34343434 0.35353535 #> [37] 0.36363636 0.37373737 0.38383838 0.39393939 0.40404040 0.41414141 #> [43] 0.42424242 0.43434343 0.44444444 0.45454545 0.46464646 0.47474747 #> [49] 0.48484848 0.49494949 0.50505051 0.51515152 0.52525253 0.53535354 #> [55] 0.54545455 0.55555556 0.56565657 0.57575758 0.58585859 0.59595960 #> [61] 0.60606061 0.61616162 0.62626263 0.63636364 0.64646465 0.65656566 #> [67] 0.66666667 0.67676768 0.68686869 0.69696970 0.70707071 0.71717172 #> [73] 0.72727273 0.73737374 0.74747475 0.75757576 0.76767677 0.77777778 #> [79] 0.78787879 0.79797980 0.80808081 0.81818182 0.82828283 0.83838384 #> [85] 0.84848485 0.85858586 0.86868687 0.87878788 0.88888889 0.89898990 #> [91] 0.90909091 0.91919192 0.92929293 0.93939394 0.94949495 0.95959596 #> [97] 0.96969697 0.97979798 0.98989899 1.00000000 #> #> $lorenz_curve$lorenz #> [1] \"lb\" #> #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute MLD — pipgd_mld","title":"Compute MLD — pipgd_mld","text":"MLD (Mean Logarithimic Deviation) computed using either beta quadratic Lorenz functions.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute MLD — pipgd_mld","text":"","code":"pipgd_mld( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute MLD — pipgd_mld","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute MLD — pipgd_mld","text":"Returns nested list containing distribution statistics: $dist_stats$mld numeric vector containing mld calculation. $dist_stats$lorenz numeric vector showing lorenz curve used. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_mld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute MLD — pipgd_mld","text":"","code":"# Example 1: Basic MLD Calculation pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$mld #> [1] 0.1376809 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> # Example 2: MLD with a Specific Lorenz Curve pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$mld #> [1] 0.1405595 #> #> $dist_stats$lorenz #> [1] \"lb\" #> #> # Example 3: Detailed Output of MLD Calculation pipgd_mld(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$mld #> [1] 0.1376809 #> #> $dist_stats$lorenz #> [1] \"lq\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Group Data Parameters — pipgd_params","title":"Get Group Data Parameters — pipgd_params","text":"Get Parameters key values derived quadratic Beta Lorenz parametrization. welfare population must vectors group data dataset","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Group Data Parameters — pipgd_params","text":"","code":"pipgd_params(welfare, weight, mean = NULL, population = NULL)"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Group Data Parameters — pipgd_params","text":"welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default NULL population numeric scalar actual size population. Default NULL","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Group Data Parameters — pipgd_params","text":"Returns pipgd_params object Group data parameters accessible $gd_params data used accessible $data.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Get Group Data Parameters — pipgd_params","text":"Datt, G. 1998. \"Computational Tools Poverty Measurement Analysis\". FCND Discussion Paper 50. World Bank, Washington, DC. Krause, M. 2013. \"Corrigendum Elliptical Lorenz curves\". Journal Econometrics 174 (1): 44. Villasenor, J., B. C. Arnold. 1989. \"Elliptical Lorenz curves\". Journal Econometrics 40 (2): 327-338.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_params.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get Group Data Parameters — pipgd_params","text":"","code":"# Example 1: Get Lorenz parameters res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 2 #> ..$ welfare: num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res) # Example 2: Get Lorenz parameters with Specific Mean actual_mean <- 90 res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P, mean = actual_mean) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 3 #> ..$ welfare: num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> ..$ mean : num 90 #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res) # Example 3: Get Lorenz parameters with Specific Population Count actual_pop <- 1000 res <- pipgd_params( welfare = pip_gd$L, weight = pip_gd$P, population = actual_pop) str(res) #> List of 2 #> $ gd_params:List of 2 #> ..$ lq:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num 0.122 #> .. .. ..$ sst : num 0.0846 #> .. .. ..$ coef : Named num [1:3] 0.888 -1.451 0.203 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 3.42e-06 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 3.8e-07 #> .. .. ..$ se : num [1:3] 0.00667 0.01903 0.01283 #> .. ..$ key_values :List of 6 #> .. .. ..$ e : num -0.639 #> .. .. ..$ m : num -1.44 #> .. .. ..$ n : num 1.04 #> .. .. ..$ r : num 1.86 #> .. .. ..$ s1: num -0.281 #> .. .. ..$ s2: num 1 #> ..$ lb:List of 2 #> .. ..$ reg_results:List of 7 #> .. .. ..$ ymean: num -2.5 #> .. .. ..$ sst : num 11 #> .. .. ..$ coef : Named num [1:3] 0.561 0.931 0.58 #> .. .. .. ..- attr(*, \"names\")= chr [1:3] \"A\" \"B\" \"C\" #> .. .. ..$ sse : num 0.0032 #> .. .. ..$ r2 : num 1 #> .. .. ..$ mse : num 0.000356 #> .. .. ..$ se : num [1:3] 0.01487 0.00551 0.00641 #> .. ..$ key_values : logi NA #> $ data :List of 3 #> ..$ welfare : num [1:13] 0.00208 0.01013 0.03122 0.07083 0.12808 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of welfare\" #> ..$ weight : num [1:13] 0.0092 0.0339 0.085 0.164 0.2609 ... #> .. ..- attr(*, \"label\")= chr \"Cumulative share of population\" #> ..$ population: num 1000 #> - attr(*, \"class\")= chr \"pipgd_params\" rm(res)"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty gap (FGT1) — pipgd_pov_gap","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"Estimate poverty gap (FGT1)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"","code":"pipgd_pov_gap( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"Returns data.table data.frame object three variables: povline, pov_gap, lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline pov_gap lorenz #> #> 1: 89 0.1273534 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline pov_gap lorenz #> #> 1: 0.5 0.02500299 lb #> 2: 1.0 0.20523323 lb #> 3: 2.0 0.52208004 lb #> 4: 3.0 0.67289468 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$pov_gap #> [1] 0.02500299 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$pov_gap #> [1] 0.2052332 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$pov_gap #> [1] 0.52208 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$pov_gap #> [1] 0.6728947 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.02500299 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.2052332 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.52208 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.6728947 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_gap(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.02500299 0.20523323 0.52208004 0.67289468 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"function vectorized. Use pipgd_pov_gap instead","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"","code":"pipgd_pov_gap_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_gap_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty gap (FGT1) — pipgd_pov_gap_nv","text":"numeric poverty gap value","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"Estimate poverty headcount (FGT0)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"","code":"pipgd_pov_headcount( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"Returns data.table data.frame object three variables: povline, headcount, lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline headcount lorenz #> #> 1: 89 0.4511816 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline headcount lorenz #> #> 1: 0.5 0.1331300 lb #> 2: 1.0 0.6161877 lb #> 3: 2.0 0.9500443 lb #> 4: 3.0 0.9876954 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$headcount #> [1] 0.13313 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$headcount #> [1] 0.6161877 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$headcount #> [1] 0.9500443 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$headcount #> [1] 0.9876954 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_headcount(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.1331300 0.6161877 0.9500443 0.9876954 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"function vectorized thus exported. Use pipgd_pov_headcount instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"","code":"pipgd_pov_headcount_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_headcount_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty headcount (FGT0) — pipgd_pov_headcount_nv","text":"numeric poverty headcount","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty severity — pipgd_pov_severity","title":"Estimate poverty severity — pipgd_pov_severity","text":"Estimate poverty severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty severity — pipgd_pov_severity","text":"","code":"pipgd_pov_severity( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, pov_gap = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty severity — pipgd_pov_severity","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta pov_gap list: NULL (default), welfare weight arguments used estimate underlying parameters. Else, list output pipgd_pov_gap_nv. complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty severity — pipgd_pov_severity","text":"Returns data.table data.frame object two variables: pov_severity lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate poverty severity — pipgd_pov_severity","text":"","code":"# Example 1: Basic usage with specified mean and poverty line pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.90, povline = 89, complete = FALSE) #> povline pov_severity lorenz #> #> 1: 89 0.04966338 lb # Example 2: Multiple poverty lines, returning data.table pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), complete = FALSE) #> povline pov_severity lorenz #> #> 1: 0.5 0.007590746 lb #> 2: 1.0 0.090218282 lb #> 3: 2.0 0.321801149 lb #> 4: 3.0 0.482687436 lb # Example 3: Multiple poverty lines, returning list format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\") #> $pl0.5 #> $pl0.5$pov_stats #> $pl0.5$pov_stats$pov_severity #> [1] 0.007590746 #> #> $pl0.5$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl1 #> $pl1$pov_stats #> $pl1$pov_stats$pov_severity #> [1] 0.09021828 #> #> $pl1$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl2 #> $pl2$pov_stats #> $pl2$pov_stats$pov_severity #> [1] 0.3218011 #> #> $pl2$pov_stats$lorenz #> [1] \"lb\" #> #> #> #> $pl3 #> $pl3$pov_stats #> $pl3$pov_stats$pov_severity #> [1] 0.4826874 #> #> $pl3$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 4: Multiple poverty lines, returning detailed list format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"list\", complete = TRUE) #> $pl0.5 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.1354142 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.5;0.5 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.13313 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.13313 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.02500299 #> #> $pov_stats$pov_severity #> [1] 0.007590746 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.2052332 #> #> $pov_stats$pov_severity #> [1] 0.09021828 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl2 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9430035 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 2;2 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9500443 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9500443 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.52208 #> #> $pov_stats$pov_severity #> [1] 0.3218011 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> #> $pl3 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.9830843 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 3;3 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.9876954 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.9876954 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$pov_gap #> [1] 0.6728947 #> #> $pov_stats$pov_severity #> [1] 0.4826874 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 5: Multiple poverty lines, returning atomic format pipgd_pov_severity(welfare = pip_gd$L, weight = pip_gd$P, povline = c(0.5, 1, 2, 3), format = \"atomic\", complete = FALSE) #> lb lb lb lb #> 0.007590746 0.090218282 0.321801149 0.482687436 #> attr(,\"povline\") #> [1] 0.5 1.0 2.0 3.0"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"function vectorized thus exported. Use pipgd_pov_severity instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"","code":"pipgd_pov_severity_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, pov_gap = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta pov_gap list: NULL (default), welfare weight arguments used estimate underlying parameters. Else, list output pipgd_pov_gap_nv. complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_pov_severity_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate poverty severity (non-vectorized) — pipgd_pov_severity_nv","text":"list: contains numeric poverty severity , complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Get quantile at specified shared of population - grouped data — pipgd_quantile","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"pipgd_quantile returns quantile (.e., monetary value) corresponds share population lives threshold.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"","code":"pipgd_quantile( params = NULL, welfare = NULL, weight = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), mean = 1, complete = getOption(\"pipster.return_complete\"), lorenz = NULL )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n) mean numeric scalar distribution mean. Default 1 complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$quantile numeric vector showing corresponding quantile. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"basically inverse estimating poverty rate (headcount population share) poverty line. case, provide headcount pipgd_quantile returns \"poverty line\". quantiles calculated function mean distribution times x factor. Basically, quantile x times mean. default, mean equal 1, implies , mean value provided, return value equal x. NOTE: outcome pipgd_quantile necessarily inverse pipgd_pov_headcount. reason , pipgd_pov_headcount selects Lorenz parametrization fits better specified point distribution (.e., poverty lines). pipgd_quantile, contrast, use Lorenz parametrization point. lorenz used one fits best distributional measures.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get quantile at specified shared of population - grouped data — pipgd_quantile","text":"","code":"# Example 1: Basic usage with default parameters pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.4581878 0.5697811 0.6679802 0.7617734 0.8582851 0.9657644 1.0978575 #> [8] 1.2861477 1.6470281 5.8269953 #> #> # Example 2: Specifying a custom number of quantiles pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$quantile #> [1] 0.5697811 0.7617734 0.9657644 1.2861477 5.8269953 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- c(0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95) pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.05 0.10 0.15 0.20 0.25 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.95 #> #> $dist_stats$quantile #> [1] 0.3929136 0.4581878 0.5163987 0.5697811 0.6199097 0.6679802 0.7617734 #> [8] 0.8582851 0.9657644 1.0978575 1.2861477 1.6470281 2.0918353 #> #> # Example 4: Specifying a different Lorenz curve ('lb', Lorenz beta) pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.4635670 0.5668074 0.6615363 0.7579823 0.8617611 0.9791821 1.1208976 #> [8] 1.3113561 1.6379028 Inf #> #> # Example 5: Detailed output with complete = TRUE and different mean factor pipgd_quantile(welfare = pip_gd$L, weight = pip_gd$P, mean = 1.5, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile #> [1] 0.6872817 0.8546717 1.0019703 1.1426602 1.2874277 1.4486466 1.6467862 #> [8] 1.9292215 2.4705422 8.7404929 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantile welfare share — pipgd_quantile_welfare_share","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"pipgd_quantile_welfare_share returns share welfare held particular quantile. Notice pipgd_welfare_share_at get share welfare held particular share population, sense cumulative share. Instead, pipgd_quantile_welfare_share returns proportion welfare specified quantile holds.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"","code":"pipgd_quantile_welfare_share( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n) )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$quantile_welfare_share numeric vector showing corresponding share welfare. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_quantile_welfare_share.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantile welfare share — pipgd_quantile_welfare_share","text":"","code":"# Example 1: Basic usage with default parameters pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 2: Specifying a custom quantile (e.g. 5) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.09067747 0.13345103 0.17201737 0.22138237 0.38247176 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- seq(from = 1/13, to = 1, length.out = 13) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.07692308 0.15384615 0.23076923 0.30769231 0.38461538 0.46153846 #> [7] 0.53846154 0.61538462 0.69230769 0.76923077 0.84615385 0.92307692 #> [13] 1.00000000 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 4: Using a different Lorenz curve (e.g., Lorenz Beta) pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> # Example 5: Detailed output with complete = TRUE pipgd_quantile_welfare_share(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$quantile_welfare_share #> [1] 0.03911772 0.05155974 0.06195678 0.07149424 0.08094994 0.09106744 #> [7] 0.10288972 0.11849266 0.14404584 0.23842592 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":null,"dir":"Reference","previous_headings":"","what":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"Get selected Lorenz curve distributional stats","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"","code":"pipgd_select_lorenz( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"Returns list values best lorenz fit given distributional Stats.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_select_lorenz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get selected Lorenz curve for distributional stats — pipgd_select_lorenz","text":"","code":"# Example 1: Directly using welfare and weight vectors. pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 2: Specifying mean and poverty line. custom_mean <- sum(pip_gd$W * pip_gd$X) / sum(pip_gd$W) pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P, mean = custom_mean, povline = 1.25) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lq\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] TRUE #> #> # Example 3.1: Using parameters from pipgd_validate_lorenz() validated_parameters <- pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) pipgd_select_lorenz(params = validated_parameters) #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 3.2: Piping from from pipgd_params |> pipgd_validate_lorenz() pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) |> pipgd_validate_lorenz(complete = TRUE)|> pipgd_select_lorenz() #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> # Example 4: Detailed output with complete = TRUE pipgd_select_lorenz(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":null,"dir":"Reference","previous_headings":"","what":"Check validity of Lorenz Curve — pipgd_validate_lorenz","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"Check validity Lorenz Curve","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"","code":"pipgd_validate_lorenz( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"params list parameters pipgd_params() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric: welfare mean distribution. times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"Returns nested list distributional validity Lorenz model accessible $gd_params$lq$validity$is_normal Lorenz beta $gd_params$lq$validity$is_normal Lorenz quadratic.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_validate_lorenz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check validity of Lorenz Curve — pipgd_validate_lorenz","text":"","code":"# Example 1: Validate Lorenz Curves using pre-calculated parameters. parameters <- pipgd_params(welfare = pip_gd$L, weight = pip_gd$P) pipgd_validate_lorenz(params = parameters) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> # Example 2: Directly using welfare and weight vectors. pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> # Example 3: Specifying mean and poverty line pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, mean = mean(pip_gd$X), povline = 50) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.04732287 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 128.481538461538 and a poverty line of 50;0.389160968950942 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.04550107 #> #> #> #> # Example 4: Using a custom population share pipgd_validate_lorenz(welfare = pip_gd$L, weight = pip_gd$P, popshare = 0.5) #> $gd_params #> $gd_params$lq #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.5 #> #> #> #> $gd_params$lb #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 0.861761080993303;0.861761080993303 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.5 #> #> #> #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Watts poverty index — pipgd_watts","title":"Estimate Watts poverty index — pipgd_watts","text":"Computes Watts Index either beta quadratic Lorenz fit. first distribution-sensitive poverty measure proposed 1968 Watts. defined mean across population proportionate poverty gaps, measured log ratio poverty line income, mean formed whole population, counting nonpoor zero poverty gap.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Watts poverty index — pipgd_watts","text":"","code":"pipgd_watts( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), format = c(\"dt\", \"list\", \"atomic\"), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Watts poverty index — pipgd_watts","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\" lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Watts poverty index — pipgd_watts","text":"Returns data.table data.frame object two variables: watts lorenz. Check format argument change output format. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate Watts poverty index — pipgd_watts","text":"","code":"# Example 1: Basic usage with the pip_gd dataset and default poverty line pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P) #> povline watts lorenz #> #> 1: 1 0.2775801 lb # Example 2: Specifying a different poverty line and output as a list pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, povline = 1.9, format = \"list\") #> $pl1.9 #> $pl1.9$pov_stats #> $pl1.9$pov_stats$watts #> [1] 0.7973243 #> #> $pl1.9$pov_stats$lorenz #> [1] \"lb\" #> #> #> # Example 3: Detailed output with complete = TRUE pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, format = \"list\", complete = TRUE) #> $pl1 #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $pov_stats #> $pov_stats$headcount #> [1] 0.6161877 #> #> $pov_stats$lorenz #> [1] \"lb\" #> #> $pov_stats$watts #> [1] 0.2775801 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\" #> # Example 4: Custom mean and times_mean with data.table format pipgd_watts(welfare = pip_gd$L, weight = pip_gd$P, mean = 109.9, times_mean = 1.5) #> povline watts lorenz #> #> 1: 164.85 0.5828177 lb"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"function vectorized thus exported. Use pipgd_watts instead.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"","code":"pipgd_watts_nv( params = NULL, welfare = NULL, weight = NULL, mean = 1, times_mean = 1, popshare = NULL, povline = ifelse(is.null(popshare), mean * times_mean, NA_real_), lorenz = NULL, complete = getOption(\"pipster.return_complete\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population mean numeric scalar distribution mean. Default 1 times_mean numeric factor multiplies mean create relative poverty line. Default 1 popshare numeric: range (0,1). Share population. Provide share population instead poverty line povline numeric: value poverty line. Default mean value lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_watts_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate Watts poverty index (non-vectorized) — pipgd_watts_nv","text":"list: contains numeric Watts ratio , complete=TRUE, also returns params.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Welfare share by quantile in group data — pipgd_welfare_share_at","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"pipgd_welfare_share_at returns share welfare held specified share population parameter popshare. Alternatively, can select number quantiles (10 default), estimate corresponding share welfare .","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"","code":"pipgd_welfare_share_at( params = NULL, welfare = NULL, weight = NULL, complete = getOption(\"pipster.return_complete\"), lorenz = NULL, n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n) )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"params list parameters pipgd_validate_lorenz() welfare numeric vector cumulative share welfare (income/consumption) weight numeric vector cumulative share population complete logical: TRUE, returns list cumulative returns previously used get_gd functions. Default FALSE lorenz character NULL. Lorenz curve selected. \"lq\" Lorenz Quadratic \"lb\" Lorenz Beta n numeric scalar number quantiles used popshare popshare numeric: vector share population. Default seq(= 1/n, = 1, = 1/n)","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"Returns nested list containing distribution statistics: $dist_stats$pop_share numeric vector containing share population. $dist_stats$welfare_share_at numeric vector showing corresponding share welfare. complete = TRUE, returns pipgd_params object additional details intermediate calculations.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipgd_welfare_share_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Welfare share by quantile in group data — pipgd_welfare_share_at","text":"","code":"# Example 1: Basic usage with default parameters pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE) #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03911772 0.09067747 0.15263425 0.22412849 0.30507843 0.39614586 #> [7] 0.49903558 0.61752824 0.76157408 1.00000000 #> #> # Example 2: Specifying a custom number of quantiles (n = 5) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, n = 5) #> $dist_stats #> $dist_stats$popshare #> [1] 0.2 0.4 0.6 0.8 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.09067747 0.22412849 0.39614586 0.61752824 1.00000000 #> #> # Example 3: Using a custom population share vector custom_popshare_vector <- seq(from = 1/13, to = 1, length.out = 13) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, popshare = custom_popshare_vector) #> $dist_stats #> $dist_stats$popshare #> [1] 0.07692308 0.15384615 0.23076923 0.30769231 0.38461538 0.46153846 #> [7] 0.53846154 0.61538462 0.69230769 0.76923077 0.84615385 0.92307692 #> [13] 1.00000000 #> #> $dist_stats$welfare_share_at #> [1] 0.02887655 0.06550084 0.10869119 0.15780056 0.21251996 0.27280064 #> [7] 0.33884270 0.41114336 0.49063514 0.57902253 0.67970615 0.80128755 #> [13] 1.00000000 #> #> # Example 4: Using a specified Lorenz curve (e.g., Lorenz Beta) pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = FALSE, lorenz = \"lb\") #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03809217 0.08976495 0.15119586 0.22213280 0.30303589 0.39493547 #> [7] 0.49966955 0.62069307 0.76615187 1.00000000 #> #> # Example 5: Detailed output with complete = TRUE pipgd_welfare_share_at(welfare = pip_gd$L, weight = pip_gd$P, complete = TRUE) #> $gd_params #> $gd_params$lq #> $gd_params$lq$reg_results #> $gd_params$lq$reg_results$ymean #> [1] 0.1219752 #> #> $gd_params$lq$reg_results$sst #> [1] 0.08456216 #> #> $gd_params$lq$reg_results$coef #> A B C #> 0.8877478 -1.4514459 0.2026400 #> #> $gd_params$lq$reg_results$sse #> [1] 3.418058e-06 #> #> $gd_params$lq$reg_results$r2 #> [1] 0.9999596 #> #> $gd_params$lq$reg_results$mse #> [1] 3.797842e-07 #> #> $gd_params$lq$reg_results$se #> [1] 0.006673127 0.019034521 0.012827923 #> #> #> $gd_params$lq$key_values #> $gd_params$lq$key_values$e #> [1] -0.638942 #> #> $gd_params$lq$key_values$m #> [1] -1.444296 #> #> $gd_params$lq$key_values$n #> [1] 1.044219 #> #> $gd_params$lq$key_values$r #> [1] 1.857124 #> #> $gd_params$lq$key_values$s1 #> [1] -0.2814192 #> #> $gd_params$lq$key_values$s2 #> [1] 1.004414 #> #> #> $gd_params$lq$validity #> $gd_params$lq$validity$is_normal #> [1] TRUE #> #> $gd_params$lq$validity$is_valid #> [1] TRUE #> #> $gd_params$lq$validity$headcount #> [1] 0.6284604 #> #> #> #> $gd_params$lb #> $gd_params$lb$reg_results #> $gd_params$lb$reg_results$ymean #> [1] -2.496791 #> #> $gd_params$lb$reg_results$sst #> [1] 10.98072 #> #> $gd_params$lb$reg_results$coef #> A B C #> 0.5613532 0.9309501 0.5800259 #> #> $gd_params$lb$reg_results$sse #> [1] 0.003204989 #> #> $gd_params$lb$reg_results$r2 #> [1] 0.9997081 #> #> $gd_params$lb$reg_results$mse #> [1] 0.0003561098 #> #> $gd_params$lb$reg_results$se #> [1] 0.014871578 0.005505620 0.006407669 #> #> #> $gd_params$lb$key_values #> [1] NA #> #> $gd_params$lb$validity #> $gd_params$lb$validity$is_valid #> [1] TRUE #> #> $gd_params$lb$validity$is_normal #> [1] TRUE #> attr(,\"label\") #> [1] \"Normality with a mean of 1 and a poverty line of 1;1 times the mean.\" #> #> $gd_params$lb$validity$headcount #> [1] 0.6161877 #> #> #> #> #> $data #> $data$welfare #> [1] 0.00208 0.01013 0.03122 0.07083 0.12808 0.23498 0.34887 0.51994 0.64270 #> [10] 0.79201 0.86966 0.91277 1.00000 #> attr(,\"label\") #> [1] \"Cumulative share of welfare\" #> #> $data$weight #> [1] 0.0092 0.0339 0.0850 0.1640 0.2609 0.4133 0.5497 0.7196 0.8196 0.9174 #> [11] 0.9570 0.9751 1.0000 #> attr(,\"label\") #> [1] \"Cumulative share of population\" #> #> #> $selected_lorenz #> $selected_lorenz$for_dist #> [1] \"lq\" #> #> $selected_lorenz$for_pov #> [1] \"lb\" #> #> $selected_lorenz$use_lq_for_dist #> [1] TRUE #> #> $selected_lorenz$use_lq_for_pov #> [1] FALSE #> #> #> $dist_stats #> $dist_stats$popshare #> [1] 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 #> #> $dist_stats$welfare_share_at #> [1] 0.03911772 0.09067747 0.15263425 0.22412849 0.30507843 0.39614586 #> [7] 0.49903558 0.61752824 0.76157408 1.00000000 #> #> #> attr(,\"class\") #> [1] \"pipgd_params\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":null,"dir":"Reference","previous_headings":"","what":"Gini coefficient — pipmd_gini","title":"Gini coefficient — pipmd_gini","text":"Compute Gini coefficient microdata.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gini coefficient — pipmd_gini","text":"","code":"pipmd_gini( welfare, weight = rep(1, length = length(welfare)), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gini coefficient — pipmd_gini","text":"welfare welfare vector weight population weight vector format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gini coefficient — pipmd_gini","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gini coefficient — pipmd_gini","text":"Given vector income consumption values respective weights pipmd_gini() computes Gini coefficient distribution.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_gini.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gini coefficient — pipmd_gini","text":"","code":"# Example 1: Basic Gini coefficient calculation with default settings pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: gini 0.4190533 # Example 2: Returning Gini coefficient in data.table format pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"dt\") #> indicator value #> #> 1: gini 0.4190533 # Example 3: Returning Gini coefficient as an atomic value pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") #> gini #> 0.4190533 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\" # Example 4: Using equal weights (weight vector is NULL) pipmd_gini(welfare = pip_md_s$welfare, format = \"list\") #> $gini #> [1] 0.4080793 #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":null,"dir":"Reference","previous_headings":"","what":"Mean Log Deviation — pipmd_mld","title":"Mean Log Deviation — pipmd_mld","text":"Given vector weights welfare, functions computes Mean Log Deviation (MLD).","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mean Log Deviation — pipmd_mld","text":"","code":"pipmd_mld( welfare, weight = rep(1, length = length(welfare)), mean = NULL, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mean Log Deviation — pipmd_mld","text":"welfare welfare vector weight population weight vector mean numeric: weighted welfare mean. Default NULL. format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mean Log Deviation — pipmd_mld","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_mld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mean Log Deviation — pipmd_mld","text":"","code":"# Example 1: Basic usage with default settings pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: mld 0.3016201 # Example 2: Specifying mean and returning as a list custom_mean <- mean(pip_md_s$welfare) pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight, mean = custom_mean, format = \"list\") #> $mld #> [1] 0.2606041 #> # Example 3: Returning MLD as an atomic value pipmd_mld(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") #> mld #> 0.3016201 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\" # Example 4: Using equal weights (weight vector is NULL) pipmd_mld(welfare = pip_md_s$welfare, format = \"list\") #> $mld #> [1] 0.283235 #>"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":null,"dir":"Reference","previous_headings":"","what":"Wolfson polarization index — pipmd_polarization","title":"Wolfson polarization index — pipmd_polarization","text":"Compute Wolfson polarization index microdata.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wolfson polarization index — pipmd_polarization","text":"","code":"pipmd_polarization( welfare, weight = rep(1, length = length(welfare)), gini = NULL, mean = NULL, median = NULL, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wolfson polarization index — pipmd_polarization","text":"welfare welfare vector weight population weight vector gini numeric: gini coefficient. NULL (default) uses pipmd_gini calculate gini. mean numeric: weighted welfare mean. Default NULL. median numeric: weighted welfare mean. Default NULL. format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wolfson polarization index — pipmd_polarization","text":"Returns data.table data.frame object two variables: indicator value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Wolfson polarization index — pipmd_polarization","text":"Given vector income consumption values respective weights pipmd_polarization() computes Wolfson polarization index.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_polarization.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Wolfson polarization index — pipmd_polarization","text":"","code":"# Example 1: Basic polarization calculation with default settings pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> indicator value #> #> 1: polarization 0.4301155 # Example 2: Specifying Gini coefficient, mean, and median custom_gini <- pipmd_gini(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"atomic\") custom_mean <- mean(pip_md_s$welfare) custom_median <- median(pip_md_s$welfare) pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight, gini = custom_gini, mean = custom_mean, median = custom_median, format = \"list\") #> $polarization #> [1] 0.4038148 #> rm(custom_gini, custom_mean, custom_median) # Example 3: Returning polarization index in data.table format pipmd_polarization(welfare = pip_md_s$welfare, weight = pip_md_s$weight, format = \"dt\") #> indicator value #> #> 1: polarization 0.4301155 # Example 4: Using equal weights (weight vector is NULL) pipmd_polarization(welfare = pip_md_s$welfare, format = \"atomic\") #> polarization #> 0.3827663 #> attr(,\"label\") #> [1] \"welfare(income of consumption)\""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty gap from microdata — pipmd_pov_gap","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"Calculate poverty gap microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"","code":"pipmd_pov_gap( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"data.table data.frame object length equal povline vector variables povline pov_gap. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty gap from microdata — pipmd_pov_gap","text":"","code":"# Example 1: Basic poverty gap calculation pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_gap #> [1] 0.0673906 #> #> # Example 2: Returning data.table format, multiple povline. pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_gap #> #> 1: 1.3 0.06739060 #> 2: 1.2 0.05631327 # Example 3: Returning atomic format pipmd_pov_gap(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.0673906"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"Non-vectorized poverty gap microdata function. Use vectorized function pipmd_pov_gap","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"","code":"pipmd_pov_gap_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_gap_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty gap using microdata — pipmd_pov_gap_nv","text":"numeric: Poverty gap","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty headcount from microdata — pipmd_pov_headcount","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"Calculate poverty headcount microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"","code":"pipmd_pov_headcount( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"data.table data.frame object length equal povline vector variables povline pov_headcount. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty headcount from microdata — pipmd_pov_headcount","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_headcount #> [1] 0.208561 #> #> # Example 2: Returning data.table format, multiple povline. pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_headcount #> #> 1: 1.3 0.2085610 #> 2: 1.2 0.1917473 # Example 3: Returning atomic format pipmd_pov_headcount(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.208561"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"Non-vectorized poverty headcount microdata function. Use vectorized function pipmd_pov_headcount","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"","code":"pipmd_pov_headcount_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_headcount_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty headcount using microdata — pipmd_pov_headcount_nv","text":"numeric: Poverty headcount ratio","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty severity from microdata — pipmd_pov_severity","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"Calculate poverty severity microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"","code":"pipmd_pov_severity( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"data.table data.frame object length equal povline vector variables povline pov_severity. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate poverty severity from microdata — pipmd_pov_severity","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$pov_severity #> [1] 0.02972097 #> #> # Example 2: Returning data.table format and multiple povline pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline pov_severity #> #> 1: 1.3 0.02972097 #> 2: 1.2 0.02413119 # Example 3: Returning atomic format pipmd_pov_severity(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.02972097"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"Non-vectorized poverty severity microdata function. Use vectorized function pipmd_pov_severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"","code":"pipmd_pov_severity_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_pov_severity_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate poverty severity using microdata — pipmd_pov_severity_nv","text":"numeric: Poverty severity","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Get quantile at specified shared of population - micro data — pipmd_quantile","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"pipmd_quantile returns quantile (.e., monetary value) corresponds share population lives threshold.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"","code":"pipmd_quantile( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"Returns data.table data.frame object two variables: quantile value. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"basically inverse estimating poverty rate (headcount population share) poverty line. case, provide headcount pipmd_quantile returns \"poverty line\". quantiles calculated function mean distribution times x factor. Basically, quantile x times mean. default, mean equal 1, implies , mean value provided, return value equal x.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get quantile at specified shared of population - micro data — pipmd_quantile","text":"","code":"# Example 1: Calculating quintiles. pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, format = \"list\") #> $`20%` #> [1] 1.266062 #> #> $`40%` #> [1] 1.945387 #> #> $`60%` #> [1] 2.986672 #> #> $`80%` #> [1] 4.836562 #> #> $`100%` #> [1] 18.01952 #> # Example 2: Calculating deciles with data.table format. pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 10, format = \"dt\") #> quantile values #> #> 1: q_10% 0.8454755 #> 2: q_20% 1.2660622 #> 3: q_30% 1.6202722 #> 4: q_40% 1.9453871 #> 5: q_50% 2.3513837 #> 6: q_60% 2.9866717 #> 7: q_70% 3.6777302 #> 8: q_80% 4.8365623 #> 9: q_90% 7.3149182 #> 10: q_100% 18.0195166 # Example 3: Calculating quantiles at specific population shares and format atomic. specific_popshares <- seq(from = 0, to = 1, length.out = 100) pipmd_quantile(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"atomic\") #> 10% 20% 30% 40% 50% 60% 70% #> 0.8454755 1.2660622 1.6202722 1.9453871 2.3513837 2.9866717 3.6777302 #> 80% 90% 100% #> 4.8365623 7.3149182 18.0195166"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantile welfare share — pipmd_quantile_welfare_share","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"pipmd_quantile_welfare_share returns share welfare held particular quantile. Notice pipmd_welfare_share_at get share welfare held particular share population, sense cumulative share. Instead, pipmd_quantile_welfare_share returns proportion welfare specified quantile holds.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"","code":"pipmd_quantile_welfare_share( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"Returns data.table data.frame object two variables: quantile share_at. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_quantile_welfare_share.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantile welfare share — pipmd_quantile_welfare_share","text":"","code":"# Example 1: Basic usage with default quantiles (10) pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> quantile share_at #> #> 1: q_10% 0.01599470 #> 2: q_20% 0.03758688 #> 3: q_30% 0.04517520 #> 4: q_40% 0.06755463 #> 5: q_50% 0.06777595 #> 6: q_60% 0.10813059 #> 7: q_70% 0.08360875 #> 8: q_80% 0.14695423 #> 9: q_90% 0.18607431 #> 10: q_100% 0.24114476 # Example 2: Specifying a different number of quantiles pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, # For quintiles format = \"list\") #> $`20%` #> [1] 0.05358158 #> #> $`40%` #> [1] 0.1127298 #> #> $`60%` #> [1] 0.1759065 #> #> $`80%` #> [1] 0.230563 #> #> $`100%` #> [1] 0.4272191 #> # Example 3: Using specific population shares specific_popshares <- seq(from = 0.1, to = 1, by = 0.1) # Deciles pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"dt\") #> quantile share_at #> #> 1: q_10% 0.01599470 #> 2: q_20% 0.03758688 #> 3: q_30% 0.04517520 #> 4: q_40% 0.06755463 #> 5: q_50% 0.06777595 #> 6: q_60% 0.10813059 #> 7: q_70% 0.08360875 #> 8: q_80% 0.14695423 #> 9: q_90% 0.18607431 #> 10: q_100% 0.24114476 rm(specific_popshares) # Example 4: Returning atomic format pipmd_quantile_welfare_share(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 4, # For quartiles format = \"atomic\") #> 25% 50% 75% 100% #> 0.0840979 0.1499895 0.2535388 0.5123738"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Watts index from microdata — pipmd_watts","title":"Calculate Watts index from microdata — pipmd_watts","text":"Calculate Watts index microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Watts index from microdata — pipmd_watts","text":"","code":"pipmd_watts( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Watts index from microdata — pipmd_watts","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1 format atomic character vector: specifies format output, either \"dt\", \"list\", \"atomic\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Watts index from microdata — pipmd_watts","text":"data.table data.frame object length equal povline vector variables povline pov_severity. See format change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate Watts index from microdata — pipmd_watts","text":"","code":"# Example 1: Basic poverty headcount calculation pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"list\") #> $pl1.3 #> $pl1.3$watts #> [1] 0.09129307 #> #> # Example 2: Returning data.table format pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = c(1.3, 1.2), format = \"dt\") #> povline watts #> #> 1: 1.3 0.09129307 #> 2: 1.2 0.07527149 # Example 3: Returning atomic format pipmd_watts(welfare = pip_md_s$welfare, weight = pip_md_s$weight, povline = 1.3, format = \"atomic\") #> pl1.3 #> 0.09129307"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Watts index using microdata — pipmd_watts_nv","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"Non-vectorized Watts index microdata function. Use vectorized function pipmd_watts","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"","code":"pipmd_watts_nv( welfare, weight = rep(1, length = length(welfare)), povline = fmean(welfare, w = weight) * times_mean, times_mean = 1 )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"welfare numeric: vector income consumption values weight numeric: vector population weights. NULL, vector 1s used give equal weight observation. povline numeric: Poverty line international dollars, units welfare. times_mean numeric factor multiplies mean create relative poverty line. Default 1","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_watts_nv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Watts index using microdata — pipmd_watts_nv","text":"numeric: Watts index","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":null,"dir":"Reference","previous_headings":"","what":"Welfare share by quantile in micro data — pipmd_welfare_share_at","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"pipmd_welfare_share_at returns share welfare held specified share population parameter popshare. Alternatively, can select number quantiles (10 default), estimate corresponding share welfare .","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"","code":"pipmd_welfare_share_at( welfare, weight = rep(1, length = length(welfare)), n = 10, popshare = seq(from = 1/n, to = 1, by = 1/n), format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"welfare welfare vector weight population weight vector n numeric: number equi-spaced quantiles popshare numeric atomic vector: quantiles return. used n = NULL format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"Returns data.table data.frame object two variables: quantile share_at. Check format argument change output format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipmd_welfare_share_at.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Welfare share by quantile in micro data — pipmd_welfare_share_at","text":"","code":"# Example 1: Basic usage with default quantiles (10) pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight) #> quantile share_at #> #> 1: q_10% 0.1088235 #> 2: q_20% 0.2070236 #> 3: q_30% 0.2993178 #> 4: q_40% 0.4131093 #> 5: q_50% 0.4988916 #> 6: q_60% 0.6124656 #> 7: q_70% 0.7001452 #> 8: q_80% 0.8032207 #> 9: q_90% 0.9117696 #> 10: q_100% 1.0000000 # Example 2: Specifying a different number of quantiles pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 5, # For quintiles format = \"list\") #> $`20%` #> [1] 0.2070236 #> #> $`40%` #> [1] 0.4131093 #> #> $`60%` #> [1] 0.6124656 #> #> $`80%` #> [1] 0.8032207 #> #> $`100%` #> [1] 1 #> # Example 3: Using specific population shares specific_popshares <- seq(from = 0.1, to = 1, by = 0.1) # Deciles pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, popshare = specific_popshares, format = \"dt\") #> quantile share_at #> #> 1: q_10% 0.1088235 #> 2: q_20% 0.2070236 #> 3: q_30% 0.2993178 #> 4: q_40% 0.4131093 #> 5: q_50% 0.4988916 #> 6: q_60% 0.6124656 #> 7: q_70% 0.7001452 #> 8: q_80% 0.8032207 #> 9: q_90% 0.9117696 #> 10: q_100% 1.0000000 # Example 4: Returning atomic format pipmd_welfare_share_at(welfare = pip_md_s$welfare, weight = pip_md_s$weight, n = 4, # For quartiles format = \"atomic\") #> 25% 50% 75% 100% #> 0.2641149 0.4988916 0.7536647 1.0000000"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":null,"dir":"Reference","previous_headings":"","what":"pipster: Poverty and Inequality methodology of WB methodology — pipster","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"higher-level package estimate socioeconomic indicators poverty inequality using methodology World Bank. packages mainly wrapper lower-level package wbpip","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"","code":".datatable.aware"},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"object class logical length 1.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/pipster.html","id":"pipster-functions","dir":"Reference","previous_headings":"","what":"pipster functions","title":"pipster: Poverty and Inequality methodology of WB methodology — pipster","text":"pipster functions divided X groups. first, important set functions estimate specific indicators using input welfare weights vector microdata group data.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":null,"dir":"Reference","previous_headings":"","what":"Return data according to format — return_format","title":"Return data according to format — return_format","text":"Return data according format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return data according to format — return_format","text":"","code":"return_format( ld, var, povline = NULL, complete = FALSE, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return data according to format — return_format","text":"ld list data var character: name variable returned. povline numeric: poverty line complete logical: format = \"list\" complete = TRUE gives complete information output. format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return data according to format — return_format","text":"data.table, list, atomic vector","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":null,"dir":"Reference","previous_headings":"","what":"Return data according to format - microdata — return_format_md","title":"Return data according to format - microdata — return_format_md","text":"Return data according format - microdata","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return data according to format - microdata — return_format_md","text":"","code":"return_format_md( ld, var, povline, complete = FALSE, format = c(\"dt\", \"list\", \"atomic\") )"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return data according to format - microdata — return_format_md","text":"ld list data var character: name variable returned. povline numeric: poverty line complete logical: format = \"list\" complete = TRUE gives complete information output. format character: either \"dt\" data.table, \"list\" \"atomic\" single numeric vector, whose names corresponding selected Lorenz value. Default \"dt\"","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return data according to format - microdata — return_format_md","text":"determined format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":null,"dir":"Reference","previous_headings":"","what":"return md dist data format — return_format_md_dist","title":"return md dist data format — return_format_md_dist","text":"return md dist data format","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"return md dist data format — return_format_md_dist","text":"","code":"return_format_md_dist(p, name, format = \"atomic\")"},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"return md dist data format — return_format_md_dist","text":"p object md_dist functions name character: name indicator format character: \"dt\", \"list\", \"atomic\", giving format output","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/return_format_md_dist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"return md dist data format — return_format_md_dist","text":"depending format.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":null,"dir":"Reference","previous_headings":"","what":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"functions uses heuristic round sum closest integers, possible vectors intended sum 1, fail precision.","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"","code":"sum_up_to_one(x, digits = 0)"},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"x numeric: vector whose elements might sum 1 100 digits numeric: threshold sum. Default 0 decimals","code":""},{"path":"https://pip-technical-team.github.io/pipster/reference/sum_up_to_one.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check if elements of vector sum up to 1 or (100) — sum_up_to_one","text":"logical","code":""}]