I've got an other question on the panel data set from my previous post.
I've reshaped it so that I now have
date state score time <other stuff>
I want to add a variable normalized_score = score - average_for_day
Where average_for_day = sum(score * count + score[n-7] * count[n-7]
+score[n+7] * count[n+7] ... ) / sum(count + count[n-7] + count[n+7]
... )
It seems a bit complicated to do this with loops. Is there a simpler way?
-Claudius
*
* 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/