Description Usage Arguments Details Value Author(s) References Examples
View source: R/stats_from_distribution.R
Estimates the mean, variance, standard deviation, Gini coefficient, and Theil index from a smoothed distribution.
1 | stats_from_distribution(binFit)
|
binFit |
A list as returned by |
The mean and variance are calculated from the CDF. For details on the other statistics, see gini
and theil
.
A vector of five statistics.
David J. Hunter and McKalie Drown
Paul T. von Hippel, David J. Hunter, McKalie Drown. Better Estimates from Binned Income Data: Interpolated CDFs and Mean-Matching, Sociological Science, November 15, 2017. https://www.sociologicalscience.com/articles-v4-26-641/
1 2 3 4 5 6 7 8 9 | # 2005 ACS data from Cook County, Illinois
binedges <- c(10000,15000,20000,25000,30000,35000,40000,45000,
50000,60000,75000,100000,125000,150000,200000,NA)
bincounts <- c(157532,97369,102673,100888,90835,94191,87688,90481,
79816,153581,195430,240948,155139,94527,92166,103217)
stepfit <- stepbins(binedges, bincounts, 76091)
splinefit <- splinebins(binedges, bincounts, 76091)
stats_from_distribution(stepfit)
stats_from_distribution(splinefit) # More accurate
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.