I call this class of problems "everybody else" problems.
I suggest starting with
How do I create variables summarizing for each individual
properties of the other members of a group?
http://www.stata.com/support/faqs/data/members.html
Note that means are easy, by virtue of
sum of the others = sum of all - this value
after which
mean of the others = sum of the others / (#values - 1)
Some of the other "everybody else" problems are
a fair bit nastier than that.
Nick
[email protected]
[email protected]
With the looping I intend to generate peer-group variables ( means) using a PISA-like dataset ( with info on same school (peers)) for each pupil separately, but the observation (pupil) itself left-out (dropped) since otherwise it would not be a peer-group. In case you are interesetd in helping / willing to help me to find a more efficient way to do that, pls tell me.
*
* 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/