Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Yitzhaki index


From   "Frank Elgar, Dr." <frank.elgar@mcgill.ca>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Yitzhaki index
Date   Fri, 15 Mar 2013 22:13:40 +0000

Thank you Sandu, and more accurately Bill Gould, for this posting. I did
not find by searching 'Yatzhaki' but it is, in fact, the Yitzhaki index of
relative deprivation of individual affluence (FASt) in a reference group
(schoolID):

sort schoolID FASt
gen sumdiff = .
mata:
st_view(schoolID=.,     ., "schoolID")
st_view(FASt=.,     ., "FASt")
st_view(sumdiff=.,     ., "sumdiff")
obs = panelsetup(schoolID, 1)
for (g=1; g<=rows(obs); g++) {
	for (i=obs[g,1]; i<=obs[g,2]; i++) {
			sum = 0
            for (j=obs[g,1]; j<=obs[g,2]; j++) {
                    if (FASt[j]>FASt[i]) sum = sum + (FASt[j]-FASt[i])
            }
            sumdiff[i] = sum
     }
}

end
bysort schoolID: gen Yitz=sumdiff/(_N-1)





Frank J Elgar
McGill University


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index