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

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

From   "Nick Cox" <>
To   <>
Subject   RE: st: .do file = sort by t-score?
Date   Wed, 18 Nov 2009 15:46:41 -0000

No. This code has a particular example dataset and variable names wired into it. You must change those details to match your problem. 


Thank you kindly for your reply!

I must admit I am a neophyte when it comes to Stata programming so I  
apologize for the perhaps dumb question, but do I simply paste the  
below into the do file below the bivariate regression commands?

I have tried to do this but get a "invalid 'tempname'" error.  I  
assume I am missing something relatively straightforward, due to my  
lack of experience in this area and would be grateful for an  
explanation, as this would prevent me from having to go through line  
by line of text to pick out the significant t-scores.

Quoting Scott Merryman <>:

> 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,  <> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index