Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: RE: Re: Stata 12: wish list

From   Amy Dunbar <>
To   "" <>
Subject   st: RE: Re: Stata 12: wish list
Date   Tue, 2 Nov 2010 13:41:24 +0000

Looking at it from capturing share of the market, it may make sense "standardize" table output.  I spent the better part of a weekend trying to figure out how to output tables, and yes, now I know how to do it, but many users aren't willing to put that time in. If another product provides a more intuitive way to create table output, the other product may be more attractive. (OK, maybe not; I love Stata.)  I get the impression that the Latex users are daily users of Stata, so they can probably figure out just about anything.  Someone like me has to struggle understanding the Stata commands.  For example, it was nonintuitive to me that some output required -estpost- and some required -eststo-.  Undoubtedly some of you are thinking that is obvious, but I may be representative of a lot of Stata users.  

I am providing my code below simply to show how "nonintuitive" this code is to an occasional user; now imagine that user having to come up with this code.  I have no doubt that my code can be improved, but I sweat bullets over this code.  I received a lot of helpful comments from statalist users, so thank you once again!  And thank goodness for this link,

*TABLE 3 and 3matrixfull - Correlations*

egen rETR1 = rank (GAAP_ETR) 
egen rETR2 = rank (CURR_ETR) 
egen rETR3 = rank (CASH_ETR) 
egen rETR4 = rank (LR_CASH_ETR) 
egen rBTD  = rank (w_totalBTD) 
egen rpBTD = rank (w_permBTD) 
egen rDTAX = rank (w_DTAX) 
egen raBTD = rank (w_abnBTD) 
egen rSHELTER = rank (w_SHELTER) 

estpost correlate GAAP_ETR CURR_ETR CASH_ETR LR_CASH_ETR w_totalBTD w_permBTD w_DTAX w_abnBTD w_SHELTER, matrix quietly

esttab . using "table3.rtf", replace notype unstack compress noobs nogaps nostar ///
      title({\b Table 3, Panel A:} {\i Unadjusted Correlations}) ///
	  label varwidth(8) modelwidth(7) ///
	  nonotes nonumbers ///
	  addnote("Pearson (Spearman) correlation coefficents are reported below (above) the diagonal. See Table 1 for variable definitions.")

*thanks to Nick, I figured out how to output a correlation table that had spearman, but I still have to do a cut and paste to get the final table.  
* Output full matrix to enable easy cut and paste into upper half of pwcorr correlation matrix.

estpost correlate rETR1 rETR2 rETR3 rETR4 rBTD rpBTD rDTAX raBTD rSHELTER, matrix nohalf quietly

esttab . using "table3matrixfull.rtf", replace notype unstack compress noobs nogaps nostar ///
      title({\b Table 3, Panel B:} {\i Unadjusted Spearman Rank Correlations}) ///
	  varwidth(8) modelwidth(7) ///
	  nonotes nonumbers ///
	  addnote("See Table 1 for variable definitions.")

*TABLE 4 - Summary Stats*
estpost tabstat `xlist', stat(n mean sd p25 med p75) columns(statistics)  

esttab . using "table4.rtf", replace cells("mean(fmt(%9.4f)) sd p25 p50 p75") noobs nogaps ///
      title({\b Table 4, Panel A:} {\i Descriptive Statistics}) ///
	  label varwidth(10) modelwidth(10) ///
	  addnote("See Table 1 for variable definitions.")

*TABLE 6 - Regression Output*
eststo clear
eststo ETR1: quietly ivreg2 GAAP_ETR medGAAP_ETR lagGAAP_ETR, robust cluster(gvkey fyear)

esttab using "table6.rtf",replace se ar2 unstack nogaps compress nonumbers ///
  title({\b Table 6} {\line}{\pard \qc Multivariate Regressions \par}) ///
  label varwidth(14) modelwidth(8) ///
  stat(N r2_a, labels("N" "Adj. R2")) ///
  addnote("See Table 1 for variable definitions.")

-----Original Message-----
From: [] On Behalf Of nshephard
Sent: Tuesday, November 02, 2010 5:35 AM
Subject: st: Re: Stata 12: wish list

Thomas Speidel wrote:
> One common response I hear is that solutions exists in the form of 
> user written programs.  There is a large number of great work (Ian 
> Watson, John Gallup, Michael Lokshin, Ben Jann, Roger Newson to name a 
> few authors).  But these tend to be ad-hoc solutions:  some only 
> handle a certain type of data, some will display p-values but no 
> confidence intervals, etc etc. This in my view has the side effect of 
> forcing the user to either write his or her program, or produce the 
> tables from scratch in Excel/OpenOffice/Latex.

The problem with this though is that there is no way of anticipating what an individual will think is most appropriate.  Personally I'd plump for LaTeX, but I'm sure others wouldn't.  There will always be something that one person uses that isn't supported and "should be".

The user-written commands are very flexible and exceptionally useful and I'm very grateful to the various authors for developing them in the first instance, sharing them and continuing to develop them.

Having to write your own program to produce the desired table is not a bad thing, and after you've done it once you'll find you can re-use your code. 
It may even evolve into a ado-file that you can then share with the rest of the world.

This is a good thing to my mind.

Personally I would rather see Stata development focus on statistical issues than presentation issues as they are far more common to all users.

Thomas Speidel wrote:
> Making more estimates available after estimation and more results  
> stored in locals in general could perhaps be a good starting point.   

Most commands leave behind a lot of results in scalars and matrices that can be utilised afterwards.  See -man return- for full details.  I rarely find there is anything lacking from these.


View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index