Welcome to a new 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. 1
The first thing you need is to download the phuzics panel data set, called phuzics10.txt from the Econ 536 web site. Save it in your preferred directory.
The next step is loading the Data in Stata. If you saved it in your hard drive you can load it by typing:
infile id yr phd sex rphd ru y Y s using "phuzics10.txt", clear
drop if id==.
xtset id yr
Here we compute the Hill estimator mentioned in Prof. Koenker’s Lecture 19 and “Appendix A - Concentration of Productivity in Phuzics Scholarship”.The idea is to calculate the index of concentration “\(\alpha\)” for the years between 1970 and 1990, and check if there is a 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 function 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:
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
alpha = .73199431
You are asked to repeat this for the remaining years, and then plot the coefficients along time.
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.
infile id yr phd sex rphd ru y Y s using "phuzics10.txt", clear
drop if id==.
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
alpha = 9.4789316
infile id yr phd sex rphd ru y Y s using "phuzics10.txt", clear
drop if id==.
drop
if yr<70 | yr>90
sort yr
by yr: sum Y
bsample[11]
this will generate a bootstrapped sample with 11 observations drawn from the pooled sample.
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
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". 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. You are
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.
Please send comments to hrtdmrt2@illinois.edu or srmntbr2@illinois.edu↩