On Tue, 15 Feb 2005, Renju Jacob wrote:

> Thanks a lot, Allin. I am using gretl on a Windows machine. So, do I
> wait till the Windows build is available?

There's a new Windows build at

ftp://ricardo.ecn.wfu.edu/pub/gretl/gretl_install.exe

> Also, is there a command to print out the variable name (e.g 
> x1..x2 ..). cos if u say outfile x1, it prints out the entire 
> dataset for x1

I'm not sure I understand the question right but here's a little 
example of what you can do, which might be helpful.  Suppose we have 
a data file, unknown.csv.  We know that it contains a variable y, 
and a bunch of variables x1,...,xn, but we don't know how many 
x's there will be.  We want to run a simple regression of y on each 
of the x's in turn.  Then we can do:

open unknown.csv
# minus 2 below to allow for the constant and y
genr nx = $nvars - 2
loop i=1..nx
    ols y 0 x$i
endloop

If we want output to go to a separate file for each regression, we 
could do:

open unknown.csv
genr nx = $nvars - 2
set echo off
loop i=1..nx
    outfile --write x$i.out
    ols y 0 x$i
    outfile --close
endloop

In the context of a loop of this sort, the string "$i" is replaced 
by the string representation of the current value of the loop 
counter, before any other processing of the line takes place.

Allin Cottrell





Reply via email to