Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Yitzhaki index
From
"Frank Elgar, Dr." <[email protected]>
To
"[email protected]" <[email protected]>
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/