Bookmark and Share

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


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

st: AW: How to print and append to file akin to -display-?


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: How to print and append to file akin to -display-?
Date   Wed, 16 Jun 2010 09:53:43 +0200

<> 

An easy solution is provided by -ssc d esttab- by Ben Jann:


*************

sysuse auto, clear

capture which estout
if _rc ssc install estout

local regressors mpg rep78 headroom trunk weight

eststo clear

foreach var of varlist `regressors' {
	quietly {
		eststo, tit("`var'"):regress price `var'
		}
}

esttab * using myfile.txt, compress t drop(_cons) /* 
*/  noobs mtit nonum replace

!start myfile.txt
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Misha Spisok
Gesendet: Mittwoch, 16. Juni 2010 05:10
An: [email protected]
Betreff: st: How to print and append to file akin to -display-?

Hello, Statalist,

I'd like to know how I can print and append my own "output" to a file.

For example,

sysuse auto, clear
local regressors mpg rep78 headroom trunk weight
foreach var of varlist `regressors' {
	quietly {
		regress price `var'
		}
	display in yellow "coef `var'" _column(24) _b[`var']
	display in white  "t-stat `var'" _column(24) _b[`var']/_se[`var']
}

Rather than displaying these, I want to print what follows -display-
to a file (pardon me if this is the incorrect terminology).

Thanks for your time.

Best,

Misha
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index