On Wed, Jul 13, 2011 at 4:34 PM, Summers, Peter <psummers(a)highpoint.edu> wrote:
Hi all,
I'm writing a script to implement the cointegration-with-break tests in Davidson
& Monticini (2010). The part I've done so far is what they call the
"incremental" version. Basically test for CI over subsamples, with the ending
date increasing by one each time.
The following block works fine in my main script:
<hansl>
# forward incremental
begdate = firstobs(y)
enddate = t0
loop while enddate<=n --quiet
smpl begdate enddate
ols y 0 time x --quiet
z = $uhat
coeffs[enddate,] = $coeff'
stderrs[enddate,] = $stderr'
adf 2 z --ct --test-down --quiet
stats[enddate] = $test
enddate++
endloop
</hansl>
But when I try to put this in a function, the smpl command generates an error:
Bad character 'b' in date string
error in new starting obs
*** error in function minmin
> smpl begdate enddate
I think we need more context here. Perhaps you're trying to set the sample
range, inside the function, outside of the limits of the data as given to the
function?
E.g., if I do "smpl 1990:1 2010:4" before invoking a function, and then
in the function we have
smpl 1989:1 ;
that's an error -- even if the dataset goes back to, say, 1980:1.
Allin Cottrell