Hi,

I'm trying to do the CUSUM test through separated regressions but the result differs slightly froms gretl's cusum command.

I can't see where the trick is... Any suggestion?

cheers,

artur 

 

 

<script> 

# CUSUM test
open "C:\Program Files\gretl\data\data3-6.gdt"
ols Ct const Yt --quiet
cusum --quiet

# separated regressions
scalar step = 0
loop 34 --progressive
    step +=1   
    scalar end_smpl = 1959 + step
    smpl ; end_smpl
    ols Ct const Yt --quiet
    scalar res = Ct[end_smpl+1] - ($coeff(const) + $coeff(Yt) * Yt[end_smpl+1])
    store cusum_out.gdt res
    print res
endloop



Pieddemail