Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: How can I filter the results with FE regression?


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: How can I filter the results with FE regression?
Date   Tue, 25 Apr 2006 08:50:00 +0200

Ilker Kaya asked:
> > I am currently running thousands of fixed effect regressions with panel
> > data time series but the independent variable I am interested in is same
> > across all regressions. Right now I am manually reviewing all results
> > and trying to get the significant ones at alpha= 0.05 level. This
> > process is taking a lot of time so is there any way to report only the
> > results that satisfy this significance level only for that variable? For
> > example I have 20 independent variables (1 to 20) and I am running all
> > possible combinations but I only care about variable 4. How can I only
> > see the results that variable 4 are significant in?  I would really
> > appreciate any help on this problem. Thanks in advance....
> >
> > Ilker Kaya

I would propose to display or collect the coefficients in a loop. 

Here is a starter for the display approach:

---------------------
forvalues i=1/1000 {
	quietly xtreg depvar indep1 indep2 indep3 indep4 if xyz == `i'
	display _b[indep4] " " _se[indep4]  " " _b[indep4]/_se[indep4] <= 1.96
}
-----------------------

This displays the coefficient of independent variable 4, along with its 
standard error and a 0 or 1 depending on whether the coefficient is 
significant or not.

Here is a starter for the collect approach:

-----------------
postfile coefs i b se t using results
forvalues i=1/1000 {
	quietly xtreg depvar indep1 indep2 indep3 indep4 if xyz == `i'
	post coefs (`i') (_b[indep4]) (_se[indep]) (_b[indep4]/_se[indep4])
}
postclose coefs
-----------------

This saves the coefficients in questions, their standard errors and their 
t-value in the Stata file "results.dta". You can open this file with -use 
results, clear- and do what ever you like. 

The major problem will be to set up the loop for the 1000 regressions. We need 
more information to help you with that. Please do carefully read the help on 
-foreach- and -forvalues-. In addition you might profit from reading "Cox, 
N.J. Speaking Stata: How to face lists with fortitude. The Stata Journal , 
2002, 2, 202-222 ". There is also a section on -foreach- and -forvalues- in 
the book  "Data Analysis Using Stata", written by Frauke Kreuter and myself, 
which is available at the Stata bookstore.

Uli

-- 
[email protected]
+49 (030) 25491-361
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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