Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: programming question: obtaining statistics from clustered data


From   "Javier Escobal" <jescobal@grade.org.pe>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: programming question: obtaining statistics from clustered data
Date   Tue, 25 Jun 2002 22:30:54 -0500

Dear Stata listers

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?

I appreciate the response

Javier


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index