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]

Re: st: Running 1000 regressions comparing the t-statistics


From   Nick Sanders <[email protected]>
To   [email protected]
Subject   Re: st: Running 1000 regressions comparing the t-statistics
Date   Tue, 24 May 2011 09:38:47 -0700

I largely agree with Nick . . . however there are times when you don't want to have to manually calculate the 95% CI or other such handy values created by parmby, and for that situation I suggest the following combination of the commands parmby, tempfile, and append:


********
clear
save testimates, emptyok replace

tempfile tests

use data.dta

preserve

foreach x in foo1 {
foreach y in foo2 {
foreach z in foo3 {

restore
preserve

parmby "newey exret L1.underberg_`x'_`y'_`z', lag(10)", saving('tests', repl=
ace)

use testimates, clear

append using 'tests'

save testimates, replace

}
}
}

restore, not

********

That should generate a file containing all 1000 regression outputs. You can m=
odify it accordingly to keep only the t-stats of the relevant variables.

-Nick

On May 24, 2011, at 3:51 AM, Nick Cox wrote:

> . help postfile
> 
> -append- is not going to help much here.
> 
> Nick
> 
> On Tue, May 24, 2011 at 10:30 AM,  <[email protected]> wrote:
> 
>> I´ve got a problem concerning a do-file. A short wrap up of the problem: I want to make more than 1000 newey-west regressions each using a different dependent variable and compare afterwards the t-statistics of all of them to distinguish the most significant dependent varibale.
>> 
>> I tried to do it with th command:
>> 
>> parmby "newey exret L1.underberg_`x'_`y'_`z', lag(10)", saving(testimates, replace)
>> 
>> Instead of rplacing everytime the testimates.dta I want to have one .dta which includes the t-statistics of all newey-west regressions. Do you have any ideas to solve this problem? May the command: "append" be useful and is it linkable with the parmby command?
> 
> *
> *   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