Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Weighted averages


From   "Pavlos C. Symeou" <[email protected]>
To   [email protected]
Subject   st: Weighted averages
Date   Tue, 25 Sep 2007 17:28:50 +0100

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index