-1

I am trying to use the tabout command in Stata to produce a table showing summary statistics of the age variable. What I want is something similar to summarize age, detail output but to produce output similar to MS Word format.

tabout age using table111.txt, c(skewness age kurtosis age mean age median age sd age) f(0c) sum h3(nil) npos(both)

does not produce the results I want.

Any suggestions on how the code should be adjusted? Also what if I want to include a second variable in the table and the summary statistics of same?

TheSquirrel
  • 137
  • 2
  • 8
  • What do you want your results to look like and how does what `tabout` produces deviate from that? Without that information we have to guess at what you want to achieve. – Maarten Buis Jun 14 '13 at 13:48
  • I wonder why I had points deducted for this question when it was legitimate and answered appropriately – TheSquirrel Jul 23 '13 at 14:51
  • A late response, but whoever downvoted this (I don't know who it was) presumably thought more or less as @Maarten Buis commented. It remains true that "does not reproduce the results I want" is a poor problem report. – Nick Cox Jan 15 '15 at 11:34

3 Answers3

5

You can do something like that with the estout package. There you would type:

estpost summarize age, detail
esttab . using table111, cells("skewness kurtosis mean p50 sd") noobs rtf

You can read more here: http://repec.org/bocode/e/estout/hlp_estpost.html#summarize

If you want to include a second variable, say hours, to that table, you just type:

estpost summarize age hours, detail
esttab . using table111, cells("skewness kurtosis mean p50 sd") noobs rtf
Maarten Buis
  • 2,684
  • 12
  • 17
1

The publish command is a very useful package if your ultimate goal is to format this in word. It will look prettier than text:

publish open example.doc ,doc
publish table age, c(mean age... )
honk
  • 9,137
  • 11
  • 75
  • 83
user49724
  • 11
  • 1
  • 1
0

Alternatively you can try the following command into Excel:

local savedirectory "C:\yourdirectory\yourfile"

logout, save(`savedirectory') excel replace : summarize age
Nick Cox
  • 35,529
  • 6
  • 31
  • 47