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

Re: st: .do file = sort by t-score?

From   Scott Merryman <>
Subject   Re: st: .do file = sort by t-score?
Date   Wed, 18 Nov 2009 09:13:36 -0600

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


On Wed, Nov 18, 2009 at 8:37 AM,  <> 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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index