Hi,

I'm trying to run multiple OLS's over many data sets and try to figure out the best R square. Therefore, in a loop, I want to issue ols command multiple times and store the r-square for each command result in a dataset. Later I'll sort this dataset and see the max R-square and the associated dataset .

Following a similar pattern in Lee C. Adkins' book, "Using gretl for Principles of Econometrics, 3rd Edition", I tried to use the store command like in the example in the book, on page 30 (pdf page 44), below:

#Monte Carlo
open "c:\Program Files\gretl\data\poe\food.gdt"
set seed 3213789
loop 100 -- progressive
genr u = 88*normal()
genr y1 = 80 + 10*x + u
ols y1 const x
genr b1 = $coeff(const)
genr b2 = $coeff(x)
print b1 b2
store coeff.gdt b1 b2
endloop

I applied this method to my script however the store command wouldn't work resulting in an error like "is not the name of a series". 
I checked the source to see what I'm missing but it seems store command on accept series data, not scalars:

   if (!ok && cmd->err == 0) {
      if (gretl_is_scalar(s) || gretl_is_matrix(s)) {
          gretl_errmsg_sprintf(_("'%s' is not the name of a series"), s);
          cmd->err = E_DATATYPE;
      } else {
          gretl_errmsg_sprintf(_("'%s' is not the name of a variable"), s);
          cmd->err = E_UNKVAR;
      }
http://gretl.sourcearchive.com/documentation/1.9.6-1/interact_8c_source.html
Some recommendations on previous posts don't work for me either. Like outfile. http://lists.wfu.edu/pipermail/gretl-users/2009-June/003339.html 
Since the book has such an example, I conclude that store command  used to accept the scalars to set in a series, but later this functionality was removed. 
So, any help is appreciated. How can I treat a set of scalars like a series in order to run statistical operators on (like max, min, avg, and more) ?

Best regards,
Bulent Erdemir