Javier Escobal
> I need to construct a number of summary statistics for clustered data
> with a particular twist: for each observation the summary statistics
> should be constructed without taking into the account the reference
> observation.
>
> I have a data base that has the following form:
>
> id cluster X
> 1 1 0.5
> 2 1 0.7
> 3 1 0.4
> . . .
> . . .
> . . .
> 100 3 0.6
> 101 3 0.6
> 102 3 0.8
> 103 3 0.2
>
> that is observations can be grouped in clusters (of different size). I
> am interested in constructing different statistics: for example for each
> observation "i" I need to capture the average and standard deviation of
> all observations that belong to the same cluster where "i" belongs
> excluding observation "i".
>
> Can somebody help me with a simple way of constructing this aggregates?
>
Ulrich Kohler has made several very helpful suggestions.
In addition, please check out the FAQ
How do I create variables summarizing for each individual properties
of the other members of a group?
at
http://www.stata.com/support/faqs/data/members.html
Nick
n.j.cox@durham.ac.uk
*
* 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/