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]
st: Creating a varible equal to the means of subpopulations
From
Fredrik Vest <[email protected]>
To
[email protected]
Subject
st: Creating a varible equal to the means of subpopulations
Date
Sun, 16 Feb 2014 15:51:42 +0100
Hi,
I have a panel with 19 regions over 25 years, and I want to generate a
variable equal to the mean of X in all regions except one. To be more
precise; all observations should equal the mean of X that year,
excluding the region corresponding to that cell.
Something like this: For observation "region 1, year 1": my variable
should equal the mean of X for year 1 for all regions but region 1.
For observation "region g, year t": my variable should equal the mean
of X for year t for all regions but region g.
The idea is to compare the value of an observation in a region with
the mean of the observations in all the other regions within the same
year.
Any suggestions?
Fredrik Bakkemo
*
* 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/