Lab 2

Materials for class on Friday, January 12, 2018

Contents

Gini coefficients

Recall that the Gini coefficient is the area between the line of equality and the Lorenz curve, or \(\frac{A}{A + B}\). Also, recall the shortcut using the covariance and mean of the income distribution, where \(x\) = income, \(y\) = cumulative proportion of the population, and \(\mu_x\) = mean of income:

\[ \frac{2}{\mu_x} \text{Cov}(x, y) \]

Calculating Gini coefficients in Excel

Cacluating Gini coefficients with R

## [1] 0.1123363

## [1] 0.2888986

## [1] 0.424258

Perecnt change

To calculate the percent change (i.e inflation rate, growth rate), use the following formula:

\[ \frac{\text{Current} - \text{Previous}}{\text{Previous}} \] Pay attention to the time periods in data from FRED.Or anywhere, really.

Datasets like GDP are reported quarterly, while the CPI is monthly. If you need to calculate the annual change (or annual inflation), make sure you either (1) use the same month or quarter as your current and previous times (i.e. January 2016 and January 2017), or (2) add all the percent changes within the year (i.e. add the rates from January 2016, April 2016, July 2017, and October 2017).