Get Group Data Parameters
pipgd_params.Rd
Get Parameters and key values derived from the quadratic and Beta Lorenz
parametrization. welfare
and population
must be vectors of a group data
dataset
Arguments
- welfare
numeric vector of cumulative share of welfare (income/consumption)
- weight
numeric vector of cumulative share of the population
- mean
numeric scalar of distribution mean. Default is NULL
- population
numeric scalar with actual size of population. Default is NULL
Value
Returns a pipgd_params
object with Group data parameters accessible
at $gd_params
and the data used accessible at $data
.
References
Datt, G. 1998. "Computational Tools For Poverty Measurement And Analysis". FCND Discussion Paper 50. World Bank, Washington, DC.
Krause, M. 2013. "Corrigendum to Elliptical Lorenz curves". Journal of Econometrics 174 (1): 44.
Villasenor, J., B. C. Arnold. 1989. "Elliptical Lorenz curves". Journal of Econometrics 40 (2): 327-338.
Examples
# 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)