<>
Is there a reason for the - local name "`var'"- line? I could also omit it
and pass -("`var'")- to the -postfile- and be just as happy, I think...
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Merryman
Sent: Mittwoch, 18. November 2009 16:14
To: [email protected]
Subject: Re: st: .do file = sort by t-score?
Here is oneway:
sysuse auto
tempname memhold
tempfile results
postfile `memhold' str12 name double t using `results', replace
foreach var of varlist head-gear {
local name "`var'"
qui reg mpg `var'
matrix e =e(b)
matrix v = e(V)
local t = abs(e[1,1]/sqrt(v[1,1]))
post `memhold' ("`name'") (`t')
}
postclose `memhold'
use `results'
gsort -t
l
Scott
On Wed, Nov 18, 2009 at 8:37 AM, <[email protected]> wrote:
> I am running a very basic .do file which performs bi-variate regressions
for
> roughly 200 variables. I would like to somehow receive an output that
would
> sort the independent variables by the highest t-score. Alternatively, if
> one knows of a simple way to export the output into excel and then sort by
> t-score that is fairly straightforward, that would work as well (if I
import
> the text file using delimiters to excel, it is a bit tedious and
cumbersome
> to get the list of variables sorted by t-score). Many thanks.
*
* 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/