Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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... )

Alternatively you can try the following command into Excel:

local savedirectory "C:\yourdirectory\yourfile"

logout, save(`savedirectory') excel replace : summarize age
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top