Statalist


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

st: &Agr;&Pgr;: -mean- over id, save to a new dta, then variance matrix


From   dimitris pavlopoulos <dimitris.pavlopoulos@ceps.lu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: &Agr;&Pgr;: -mean- over id, save to a new dta, then variance matrix
Date   Thu, 18 Oct 2007 13:27:12 +0200

Why don't you check the "statsby" command? I think it may do what you want.

best,
Dimitris

________________________________________
&Agr;&pgr;&oacgr;: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] &Egr;&kgr; &mgr;&eacgr;&rgr;&ogr;&ugr;&sfgr; &tgr;&ogr;&ugr; nicola.baldini2@unibo.it [nicola.baldini2@unibo.it]
&Agr;&pgr;&ogr;&sgr;&tgr;&ogr;&lgr;&eeacgr;: &Pgr;&eacgr;&mgr;&pgr;&tgr;&eegr;, 18 &Ogr;&kgr;&tgr;&ohgr;&bgr;&rgr;&iacgr;&ogr;&ugr; 2007 12:54 &mgr;&mgr;
&Pgr;&rgr;&ogr;&sfgr;: statalist@hsphsun2.harvard.edu
&THgr;&eacgr;&mgr;&agr;: st: -mean- over id, save to a new dta, then variance matrix

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/

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept 
**********************************************************************



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