Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -mean- over id, save to a new dta, then variance matrix


From   nicola.baldini2@unibo.it
To   statalist@hsphsun2.harvard.edu
Subject   st: -mean- over id, save to a new dta, then variance matrix
Date   Thu, 18 Oct 2007 12:54:24 +0200

I have one dta of 17 columns and 354 rows. The first column, named id, contains the panel identifier (an integer from 1 to 63). I would like to produce a new dta file with 17 columns (keeping the original names) and 63 rows, containing the id variable, and the mean of the remaining 16 columns calculated by the id variable. 
I know that I can have such means by -mean- and -tabstat-, but how can easily export the results in a new dataset? Next, I would like to calculate the variance matrix for such new dta and saving it in one more new dta.
How can I do?
Nicola

*
*   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