data science

Inequality and Lorenz Curve – R

Inspired by the train-wreck that was yesterday’s post, I was able to find a better solution to calculating inequality and plotting Lorenz Curves using the ineq library in R. EDIT: gini() in the reldist package also works. Installing and loading the Library Download and install Now load the library The Data I have a frequency […]


Sorting Lists for Lorenz Curve – Python

EDIT: This does not really work. Needs lots and lots of fixes. Use R instead. This function will take a list of 100+ numbers, divide them into percentiles, and return a list that can be used to plot a Lorenz Curve. The Function Running the Function First, we make a list full of integers. This […]