{"word_count": 238, "character_count": 1959}
In the course on inequality measure, we've seen how to compute various (standard) inequality indices, based on some sample of incomes (that can be binned, in various categories). On Thursday, we discussed the fact that incomes can be related to different variables (e.g. experience), and that comparing income inequalities between coutries can be biased, if they have very different age structures.So we've seen quantile regressions. I can mention some old slides (used in a crash course at McGill three years ago)., as well as a more technical discussion on ties, and non-unicity of the regression line.In order to illustrate, consider  the following dataset&#62; salary &#60;- read.table("http://data.princeton.edu/wws509/datasets/salary.dat",header=TRUE)&#62; plot(salary$yd,salary$sl)&#62; abline(lm(sl~yd,data=salary),col="blue")We have here the stndard regression line, obtained using ordinary least squares. Here we have the expected income given the experience. But we can also use a quantile regression,&#62; library(quantreg)&#62; Q10 &#60;- rq(sl~yd,data=salary,tau=.1)&#62; Q90 &#60;- rq(sl~yd,data=salary,tau=.9)&#62; abline(Q10,col="red")&#62; abline(Q90,col="purple")A classical tool to describe inequalities is the ratio of the 90% quantile over the 10% quantile (among so many others,&#62; ratio9010 = function(age){+   predict(Q90,newdata=data.frame(yd=age))/+   predict(Q10,newdata=data.frame(yd=age))+ }For instance, among people with 5 years of experience, there is an inequality index of&#62; ratio9010(5)1.401749while for people with 30 years of experience, it would be&#62; ratio9010(30)1.9488If we plot the evolution of this 90-10 ratio, as a function of the experience, we get the following increasing trend&#62; A=0:30&#62; plot(A,Vectorize(ratio9010)(A),type="l",ylab="90-10 quantile ratio")So clearly, comparing inequalitis ceteris paribus between two groups, should be performed carefully, and probably including some covariates.