Statalist The Stata Listserver


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

st: creating a matrix of summary stats


From   Scott Cunningham <scunning@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: creating a matrix of summary stats
Date   Tue, 26 Sep 2006 13:33:32 -0400

I am using data on individuals from the National Longitudinal Survey of Youth 1997, and would like to create a matrix of summary stats wherein the column identifies the year of the survey, and the rows are: 1) the variable's mean; 2) the variable's standard deviation; 3) the number of observations. I believe that I can use -reshape- in combination with -egen- to create means for each of these, followed by dropping all duplications of the mean so that I have a single mean for each variable by year. I could also, in principle, use this same thing to calculate the std deviation and the number of observations. But I was wondering if there existed a more efficient way of doing this in people's minds? For instance, the matrix (or ultiamtely, a TeX file, as that's the final product I am making) would look like this:

1997 1998 ... 2002
vbl1 4.5 5.5 6.5
(2.0) (1.3) (2.3)
200 400 600
vbl2 ...

And so on.

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