Dear statalisters,
Lets say i have a list of 10 individuals and 10 scores. For each individual
I would like to compute a new variable that is the average of the other 9
scores. Any ideas on how that can be done?
The data for the example look like this:
id score newvar
1 10
2 13
3 12
4 19
5 21
6 9
.
.
.
10 15
The next problem I am having difficulty with is that these 10 individuals
are nested within a community and there are, lets say, 5 communities in
total with 10 individual is each for total N of 50. I would like to compute
the new variable, where the value for a particular individual is the average
of the scores for the other 9 people in the community where they reside. So
I would like to repeat the procedure separately for each community.
Any help is greatly appreciated,
Ritesh
*
* 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/