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: AW: Fwd: loop and postfile with decreasing number of variables


From   Maximiliano Méndez Parra <[email protected]>
To   [email protected]
Subject   Re: st: AW: Fwd: loop and postfile with decreasing number of variables
Date   Mon, 8 Mar 2010 15:56:10 +0000

Yes, I will try with that since rolling works for range of
observations rather than variables.
Thanks


On 8 March 2010 15:12, Martin Weiss <[email protected]> wrote:
>
> <>
>
> Upon further consideration. Try -estimates store-:
>
>
> *************
> webuse klein, clear
> tsset yr
>
> qui forv i=4(-1)1{
>                reg consump wagegovt L(1/`i').consump
>                est sto laglength_`i'
> }
>
> est table *, t style(oneline)
> *************
>
>
>
> HTH
> Martin
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Maximiliano
> Méndez Parra
> Gesendet: Montag, 8. März 2010 15:52
> An: [email protected]
> 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
> [email protected]
>
>
>
> --
> Maximiliano Méndez Parra
> [email protected]
>
> *
> *   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/
>



-- 
Maximiliano Méndez Parra
[email protected]

*
*   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