On Thu, 1 Oct 2009, Shaianne Osterreich wrote:

> I am new to gretl and I am sorry if this is too rudimentary a question.

Welcome to the gretl list, and no, your question is fine.

> I am trying to append my data set (already imported) with
> another file that contains the descriptive labels.  I know how
> to do it one variable at a time in the gretl console but is
> there some way to add all the labels for all the variables at
> once?

You can do this but it's a bit of an "expert trick"; perhaps we
should write this up in the "Cheat sheet" chapter of the Gretl
User's Guide.

The first thing to do is save your dataset in the "traditional"
format of ESL, gretl's ancestor. Do this in a script or in the
gretl console:

open mydata
store mydata.dat --traditional

This will create either two or three files: mydata.dat (plain text
data only), mydata.hdr (basic info on how to read the data) and,
possibly, mydata.lbl, which will contain descriptive strings for
the variables, if any.

Now either edit or create mydata.lbl to add the labels you want:
mydata.lbl should be a plain text file, each line of which
has the name of a variable followed by its label, e.g.

gdp60 GDP per adult, 1960
gdp85 GDP per adult, 1985
gdpgrow Average growth of GDP, 1960 to 1985

(with no quotation marks or special punctuation).

Now open the "traditional" dataset in gretl

open mydata.dat

The labels should be in place; you can now re-save the dataset in
the current standard gretl format.

Allin Cottrell

Reply via email to