Description Usage Arguments Value Author(s) References Examples
See vignette for details, but very simple one line algorithm that computes gini for a pos or zero data vector. This does not work with negative values. Additionally, this is not for a sample, the vector is the population. Also note while the highest equality is 0, the greatest inequality only asymptotes to 1, but equals to (n-1)/(n+1).
1 | ff_dist_gini_vector_pos(ar_pos)
|
ar_pos |
array of numeric values that are all non-negative |
a scalar value of the gini coefficient
Fan Wang, http://fanwangecon.github.io
https://fanwangecon.github.io/REconTools/reference/ff_dist_gini_vector_pos.html https://fanwangecon.github.io/REconTools/articles/fv_dist_gini_vector_pos.html https://github.com/FanWangEcon/REconTools/blob/master/R/ff_dist_gini.R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ar_equal_n2 = c(1,1)
ar_ineql_alittle_n2 = c(1,2)
ar_ineql_somewht_n2 = c(1,2^3)
ar_ineql_alotine_n2 = c(1,2^5)
ar_ineql_veryvry_n2 = c(1,2^8)
ar_ineql_mostmst_n2 = c(1,2^13)
# Beta draw testing
ar_beta_mostrich_n1000 = rbeta(1000, 5, 1)
ar_beta_mostpoor_n1000 = rbeta(1000, 1, 5)
ar_beta_manyrichmanypoor_nomiddle_n1000 = rbeta(1000, 0.5, 0.5)
ff_dist_gini_vector_pos(ar_equal_n2)
ff_dist_gini_vector_pos(ar_ineql_alittle_n2)
ff_dist_gini_vector_pos(ar_ineql_somewht_n2)
ff_dist_gini_vector_pos(ar_ineql_alotine_n2)
ff_dist_gini_vector_pos(ar_ineql_mostmst_n2)
ff_dist_gini_vector_pos(ar_beta_mostrich_n1000)
ff_dist_gini_vector_pos(ar_beta_mostpoor_n1000)
ff_dist_gini_vector_pos(ar_beta_manyrichmanypoor_nomiddle_n1000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.