Statalist


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

RE: st: Any ways to specify the regression output to 2 decimal places?


From   Roy Wada <roywada@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Any ways to specify the regression output to 2 decimal places?
Date   Mon, 18 May 2009 03:28:55 -0700

 
> Is there any way to specify the regression results to 2 decimal places? 
>
> Charles

Nick is correct that this is not something that is provided by Stata.
 
You can always hack, of course. Place the following codes at the top 
of your do-file. Then run regressions as you would normally, except 
for -mystuff- at the beginning.
 
 
findfile _coef_table.ado
filefilter `"`r(fn)'"' regMine1.ado, from("program _coef_table") to("program regMine") replace
filefilter regMine1.ado _regMine.ado, from(" %9.0g %9.0g %8.2f %5.3f %9.0g %9.0g") to("%7.2f %7.2g %8.2f %5.2f %7.2f %7.2g") replace
cap erase regMine1.ado
prog drop _all
prog define mystuff
 version 9
 qui `0'
 _coef_table_header
 regMine
end
 

sysuse auto, clear
reg mpg price trunk weight
mystuff reg mpg price trunk weight

 
I did not bother getting the sum-of-square stuff back in.
 
It might be fun to do a full-scale hack and send it to ssc, with 
appropriate thanks and apologies to Stata Corp, of course.

On the other hand, if you wanted something that looks like 
regression table but in Excel format with two decimal places, 
you can always use -logout-.

cap log close
logout, save(myfile) excel replace dec(2): reg mpg price trunk weight
 
Roy
 
_________________________________________________________________
Hotmail® goes with you. 
http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
*
*   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   |   What's new   |   Site index