Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: AW: Fwd: loop and postfile with decreasing number of variables


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Fwd: loop and postfile with decreasing number of variables
Date   Mon, 8 Mar 2010 15:59:54 +0100

<> 



*************
help rolling
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Maximiliano
Méndez Parra
Gesendet: Montag, 8. März 2010 15:52
An: statalist@hsphsun2.harvard.edu
Betreff: st: Fwd: loop and postfile with decreasing number of variables

Dear all,

I am trying inside a loop to postfile a couple of results from
different regressions. The problem is this. When I use postfile you
need to predefine (in postfile) all the variables that will be
created. However, my program decreases the lag length of the dependent
variable in every loop. Therefore, when you post the results in the
second iteration of the loop, post is looking for a value to paste in
fe4 that does not exist.

What I need at the end is for the 4 regressions (one for each loop) I
want to get the significance of each lag in a file. So in the
regression with a lag up to 4 I want to get the t-stat for the first,
second, third and fourth lag; in the regression with a lag up to 3,
the t-stat for the first, second and third lag; and so on.

Here is my code. Any ideas? Thanks in advance.



tempname aa
tempfile bb
postfile `aa' fe4 fe3 fe2 fe1 using `bb'
forvalues i=4(-1)1 {
reg y ????? l(1/`i').y
sca ee`i'=(_coef[l`i'.y])/_se[l`i'.y]
post `hdle' (ee`i')
}
postclose  `hdle'

--
Maximiliano Méndez Parra

--
Maximiliano Méndez Parra
maximilianomp@gmail.com



-- 
Maximiliano Méndez Parra
maximilianomp@gmail.com

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index