Econ 508
Econometrics Group
Home | Faculty | Students | Alumni | Courses | Research | Reproducibility | Lab | Seminars | Economics | Statistics | Fame
Applied Econometrics
Econ 508 - Fall 2007

e-Tutorial 14: Measures of Inequality

Welcome to the fourteenth issue of e-Tutorial. This time we focus on measures of inequality. We will suggest some basic methods to calculate the Hill estimator, the Lorenz curve, and the Gini coefficient. The data set to be used is the same from the problem set 4. You can use the instructions to download the data provided in e-Tutorial 13.
 

Hill Estimator

I suggest a STATA do-file to compute the Hill estimator mentioned in Prof. Koenker's "Appendix A - Concentration of Productivity in Phuzics Scholarship". You can download this do-file here, or see below the code. The idea is to calculate the index of concentration "alpha" for the years between 1970 and 1990, and check if there is any unbiased trend. As mentioned in the note, if there is an unbiased positive trend, you can infer that phuzics productivity is becoming less concentrated, and the field is becoming less scientific (according to Parzen's definition of the term). An unbiased negative trend would mean the reverse. The code below can calculate the alpha-coefficient of concentration for a given year (say, 1970). You are expected to adjust the code such that you can reproduce the experiment for the other periods:

**Start here**
use "C:\phuzics01.dta", clear
drop if yr~=70 
gsort -Y 
gen Yratio=Y/Y[11] 
drop if Y<Y[10] 
gen a=log(Yratio) 
egen b=sum(a) 
scalar alpha=(b/10)^(-1) 
scalar list 
**End here**
 

Using the data set phuzics01.dta, the results are as follows:

. use "C:\phuzics01.dta", clear
. drop if yr~=70 
(10533 observations deleted)
. gsort -Y 
. gen Yratio=Y/Y[11] 
. drop if Y<Y[10] 
(80 observations deleted)
. gen a=log(Yratio) 
. egen b=sum(a) 
. scalar alpha=(b/10)^(-1) 
. scalar list 
     alpha =  3.2099756
end of do-file

Hence, the alpha-coefficient of concentration is about 3.2. You need to go ahead and calculate similar coefficients for the remaining years, and then plot the coefficients along time.
 
 

Bootstrap Bias-Correction for the Hill Estimator:

In STATA, you can implement the bootstrap bias correction for the Hill estimator, suggested in Prof. Koenker's "Appendix A - Concentration of Productivity in Phuzics Scholarship", by using the command bsample. I will do that for one year, say, 1970, and then you can replicate the experiment for other years. The strategy is as folows:

Numerator:

The first step is to calculate the numerator of the formula on page 2 of the note "Appendix A - Concentration of Productivity in Phuzics Scholarship",  called alpha_N. This is done as follows. 

1) Open the original data set;
2) Drop all obervations not included in your interval of interest, say not included in 1970-1990;
3) Compute the Hill estimator for this pooled sample.

Here is the code for that:

**Start here**
use "C:\phuzics01.dta", clear
drop if yr<70 | yr>90
gsort -Y 
gen Yratio=Y/Y[11] 
drop if Y<Y[10] 
gen a=log(Yratio) 
egen b=sum(a) 
scalar alpha=(b/10)^(-1) 
scalar list 
**End here**

 The final result is going to be used as the Hill estimator for the pooled sample for all years of interest. This corresponds to Appendix A's "alpha_N".
 

Denominator:

1) Open the original data set;
2) Drop all obervations not included in your interval of interest, say not include in 1970-1990;
3) Summarize your data set by year and take note of the sample size of the respective year of interest;
4) Generate a bootstrapped sample (with replacement) of the same size of the year you are working with. For example, because 1970 has 90 observations, you type bsample[90], and this will generate a bootstrapped sample with 90 observations drawn from the pooled sample. (If you were working with another year, say, 1971, you should have typed bsample[105], as 1971 has 105 observations. And so on.);
5) Calculate the Hill estimator for this bootstrapped sample.

For example, here is a sequence of these preliminary commands and results:
 

**Start here**
use "C:\phuzics01.dta", clear
drop if yr<70 | yr>90
sort yr
by yr: summarize Y
bsample[90]
gsort -Y 
gen Yratio=Y/Y[11] 
drop if Y<Y[10] 
gen a=log(Yratio) 
egen b=sum(a) 
scalar alpha=(b/10)^(-1) 
scalar list
**End here**

This routine will give you one bootstrapped alpha for the year 1970. You need to repeat the experiment "B" times (say, 20 times), and get "B" (say, 20) different bootstrapped alphas for 1970. After that, take the average of those "B" (say, 20) alphas and use this number as the denominator of the formula on page 2 of Prof. Koenker's "Appendix A - Concentration of Productivity in Phuzics Scholarship". 

Finally, you need to apply the formula: multiply the original Hill estimator of 1970 by the pooled Hill estimator (here called "numerator") and divide it by the average bootstrapped estimator for 1970 (here called "denominator"), so that you find a bias-corrected Hill estimator for the year 1970.

This procedure is required for every year in the period 1970-1990. Each year will have its respective  corrected alpha. The final step is to plot those corrected alphas along time, and check if there is any trend. 
 

Lorenz Curves and Gini Coefficient

STATA provides add-ins to calculate these statistics. You can type 
help Lorenz
help glcurve

This will provide a menu of add-in programs related to the topic. You need to install the selected package and the help files. I will let you free to decide whether to use add-ins or to write your own code. The most important thing, though, is to understand the theoretical background of such measures, which we will discuss in class.

 

 Last update: November 13, 2007