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: RE: RE: -esttab- label and -estpost- Spearman


From   Amy Dunbar <Amy.Dunbar@business.uconn.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: -esttab- label and -estpost- Spearman
Date   Mon, 18 Oct 2010 14:24:14 +0000

Thank you! Worked great.  Here's my final code.

egen rETR1 = rank (GAAP_ETR_t), unique
egen rETR2 = rank (CURR_ETR_t), unique
egen rETR3 = rank (CASH_ETR_t), unique
egen rETR4 = rank (LR_CASH_ETR_t), unique 
egen rBTD  = rank (w_totalBTD), unique
egen rpBTD = rank (w_permBTD), unique
egen rDTAX = rank (w_DTAX), unique 
egen raBTD = rank (w_abnBTD), unique
egen rSCOR = rank (w_SHELTER), unique

* correlate gives same results as pwcorr
* The columns of the matrix are stored in separate equations. Hence, use the unstack option in esttab or estout to print the matrix.

estpost correlate GAAP_ETR_t CURR_ETR_t CASH_ETR_t LR_CASH_ETR_t 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 Correlations}) ///
	  label varwidth(8) modelwidth(7) ///
	  nonotes nonumbers 
* correlate gives same results as spearman when correlating ranked variables.  Output full matrix to  enable easy cut and paste into upper half of pwcorr correlation matrix above.

estpost correlate rETR1 rETR2 rETR3 rETR4 rBTD rpBTD rDTAX raBTD rSCOR, matrix nohalf quietly
esttab . using "table3.rtf", append notype unstack compress noobs nogaps nostar ///
      title({\b Table 3, Panel B:} {\i Spearman Rank Correlations}) ///
	  varwidth(8) modelwidth(7) ///
	  nonotes nonumbers 

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Sunday, October 17, 2010 11:21 AM
To: 'statalist@hsphsun2.harvard.edu'
Subject: st: RE: -esttab- label and -estpost- Spearman

You can always get Spearman rank correlations by ranking the variables and then running -correlate-. That's what they are. 

Nick 
n.j.cox@durham.ac.uk 

Amy Dunbar

3. Is there a way to estimate Spearman correlations using -estpost-?


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

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