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