Ops, the problem occurs while generating "resid2"...
Best,
Artur
From: artur.bala.tn
Date: 2014-02-12 11:25
To: Gretl list
Subject: subsampling in a progressive loop
Dear all,
I encounter a problem in a progressive loop while estimating probit models on different
subsamples.
In its first run the loop works fine. In the second run gretl stops executing pointing out
that "dataset is subsampled, model is not. Can't retrieve yhat: data set has
changed".
As a roundabout solution I attempted to run the same script several times outside the loop
and there's absolutely no error coming out: it just works fine.
The script looks like this :
\<hansl>
loop 250 --progressive
smpl full
matrix alldata = {dataset}
alldata = resample(alldata)
# some coding to create series from the alldata matrix
...
# estimate the first probit model and retrieve $yhat
probit V1 const V2
genr resid1 = $yhat
...
# subsample, estimate the 2nd probit model en retrieve $yhat
smpl V4 = 1 --restrict
probit V5 const V6
genr resid2 = $yhat
...
endloop
Best,
Artur