[Gretl-devel] resampling the full dataset

Allin Cottrell cottrell at wfu.edu
Sat Mar 15 12:51:13 EDT 2008


A while back, Andreas asked that the facility for resampling (with 
replacement) the entire dataset be (a) documented, and (b) make 
reversible.

In current CVS and Windows snapshot I have implemented (b).  You 
can do, for example,

dataset resample 100
# do stuff
dataset restore

The "dataset restore" command will attempt to re-establish the 
original dataset.  Modified values of scalar variables and newly 
added scalars will be carried back, but any series added while 
resampled will be discarded (as will any changes to pre-existing 
series values).

I'm not going to document this for the 1.7.4 release because I 
consider it experimental.  Meanwhile I'd appreciate if people
can test this feature.  Here's a little sample script:

open data4-1
scalar x = 4
ols 1 0 2
# over-sampling: the original dataset has n = 14
dataset resample 200
genr newseries = normal()
ols 1 0 2 
ess = $ess 
x = 5
dataset restore
print -o        # note: 'newseries' is gone
print x ess     # new scalar values are preserved

Allin.



More information about the Gretl-devel mailing list