Dear Statalisters,
I have a panel dataset consisting of 25 years and 150 countries. I have
a variable (var1) whose geometric mean I estimate for every country
separately. That is, I use "bysort country: gmeans var1". This gives me
150 different geometric means; one for each country. I want to divide
var1 with its weighted average for each country for each year and
generate a new variable var1_weighted with the new values but I need a
command that can do this automatically, considering the time required to
do this one by one.
Thank you in advance,
Pavlos
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/