Many thanks, Allin!
-----Original Message-----
From: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] On
Behalf Of Allin Cottrell
Sent: Thursday, August 12, 2010 3:26 PM
To: Gretl list
Subject: Re: [Gretl-users] this is weird
On Thu, 12 Aug 2010, Summers, Peter wrote:
I'm estimating a series of regressions with varying break dates.
I set up a script with the break dates in a vector, then
generate a post-break dummy variable inside a loop, like so:
<script>
matrix breaks = breaks = {1985; 1985; 1986; 1986; 1982; ...}
loop ii=4..29
post = (obs>=obsnum(breaks[$ii-3]))
(run regression, do other stuff)
end loop
</script>
obsnum expects a string argument. This is related to the entry in
http://gretl.sourceforge.net/Backward.html for gretl 1.9.0.
The following will work (tested example):
<script>
open data3-6
matrix breaks = {1965, 1970, 1975}
string brkstr
loop ii=4..6
sprintf brkstr "%d", breaks[ii-3]
post = (obs >= obsnum(@brkstr))
print post -o
end loop
</script>
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users