Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Creating Descriptive Statistics With Estpost & Tabstat
From
Matthew Krauchunas <[email protected]>
To
[email protected]
Subject
st: Creating Descriptive Statistics With Estpost & Tabstat
Date
Wed, 3 Nov 2010 19:30:50 -0500
Hello,
I am trying to create a table of means and standard deviations (in
parentheses) similar to this format:
Variable_Name 2002 2003 2004
---------------------------------------------------------
rn_hprd .271 .265 .258
(.157) (.159) (.159)
-----------------------------------------------------------
lvn_hprd .60 .62 .64
(.180) (.181) (.186)
-----------------------------------------------------------
I have tried tabstat, but the years are the rows instead of the columns:
. tabstat rn_hprd_adj lvn_hprd_adj, statistics( mean sd) by(year)
columns(variables)
year | rn_~_adj lvn~_adj
---------+--------------------
2002 | .2761311 .6059625
| .1649422 .1979371
---------+--------------------
2003 | .2721822 .6346036
| .168225 .2034016
---------+--------------------
2004 | .264628 .654483
| .1695155 .21293
---------+--------------------
2006 | .2752124 .7032399
| .1779005 .2163748
---------+--------------------
2007 | .276638 .739869
| .1788564 .2327166
---------+--------------------
Total | .2729584 .6676316
| .1719123 .2182212
------------------------------
I have also tried a combination of estpost & tabstat which appears to
be a nice format, but again the same problem:
estpost tabstat rn_hprd_adj lvn_hprd_adj, statistics( mean sd)
by(year) columns(variables)
year | e(rn_hp~) e(lvn_h~)
-------------+----------------------
2002 |
mean | .2761311 .6059625
sd | .1649422 .1979371
-------------+----------------------
2003 |
mean | .2721822 .6346036
sd | .168225 .2034016
-------------+----------------------
2004 |
mean | .264628 .654483
sd | .1695155 .21293
-------------+----------------------
2006 |
mean | .2752124 .7032399
sd | .1779005 .2163748
-------------+----------------------
2007 |
mean | .276638 .739869
sd | .1788564 .2327166
-------------+----------------------
Total |
mean | .2729584 .6676316
sd | .1719123 .2182212
I saw a potential solution to Mr. Nick Cox by transposing a matrix
(http://www.stata.com/statalist/archive/2006-08/msg00335.html), but I
cannot quite figure it out.
Does anyone have any suggestions on how to create this type of table?
Thank you in advance.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/