Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: estpost tabulate


From   Miranda Kim <mk@mrc.soton.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: estpost tabulate
Date   Mon, 12 Apr 2010 12:33:50 +0100

I am trying to add an extra column and row in a table using estpost as follows:

sysuse auto, clear
xtile mpg3 = mpg, nq(3)
xtile weight3 = weight, nq(3)

eststo: estpost tabulate mpg3 weight3, nototal
esttab, cell(b pct(fmt(3))) unstack noobs nonum coll(none)

I would like to add to following percentage totals:
mat totU = el(e(pct),1,4) + el(e(pct),1,7) + el(e(pct),1,8)
mat totL = el(e(pct),1,2) + el(e(pct),1,3) + el(e(pct),1,6)
mat totD = el(e(pct),1,1) + el(e(pct),1,5) + el(e(pct),1,9)

where totU would be in row 1 column 4
totL in row 4 column 1
and totD in row 4 column 4
But I have not succeeded in adding these extra column 4 and row 4 into the table.
I have tried using estadd, but have not achieved it yet.
I tried
mat colname totU = 4:1
estadd mat totU: est1

Any suggestions on this would be of great help!
Thanks a lot!
Best wishes,
Miranda


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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index