Hi again.
Thanks for your advice Allin and Henrique.
Allin - I've tried your suggestion. When the traditional file is created it does create 2 files - dat and hdr. Then I have saved a plain text file named mydata.lbl (in exactly the format you suggested) in the same user folder with the newly created ones. But, when I re-open mydata.dat it doesn't open with the descriptive labels - it's just the variable names as before. I think gretl isn't reading the text file. Do you have suggestions?
Henrique - thanks. I have tried this and it works well. However, I have 185 variables so I am trying to give the variables descriptive labels all at once rather than enter them one at a time. I have tried to copy and paste a script with all 185 variables but I can't paste into gretl from outside. Do you have suggestions on that?
Thanks so much!!
Shaianne
Dear Allin and Shaianne,
I have another suggestion: why don't you use a script file? I use this procedure very often and I think it helps a lot:
<script>
open mydata.xls
setinfo gdp60 -d "GDP per adult, 1960"
setinfo gdp85 -d "GDP per adult, 1985"
save mydata.gdt --gzipped
</script>
I hope this helps ;)
Henrique2009/10/1 Allin Cottrell <cottrell@wfu.edu>
Welcome to the gretl list, and no, your question is fine.
On Thu, 1 Oct 2009, Shaianne Osterreich wrote:
> I am new to gretl and I am sorry if this is too rudimentary a question.
You can do this but it's a bit of an "expert trick"; perhaps we
> 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?
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
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users