Thanks Sven. I took a look at it, but it doesn't help.
My case:
I followed an R-Script, where (because it is R) you can directly work with strings as
factors. Now, I want to load the data in Gretl and perform some similar analysis there.
Gretl converts the strings to numerics. In some cases, it keeps them (individual codes)
but not if they are factors. For example, country names are changed to numerical factors.
I cannot find this information in the new Gretl data-set. From the log, this corresponds
to:
A minimum working example:
You may try with the following Data Set from Gesis:
(ZA3778: EVS - European Values Study 1999 - Germany)
https://dbk.gesis.org/dbksearch/download.asp?db=E&id=50392
In this case, after opening it with Gretl, the version number is transformed and the
string is stored (double klick the variable to see it). But for all the (factorial) items
from the questionary, only the new code is saved, the mapping is only visible in the
string_table.
Best
Frederik
-----Original Message-----
From: gretl-users-bounces(a)lists.wfu.edu <gretl-users-bounces(a)lists.wfu.edu> On
Behalf Of Sven Schreiber
Sent: Donnerstag, 3. Januar 2019 09:44
To: gretl-users(a)lists.wfu.edu
Subject: Re: [Gretl-users] script: open Stata data file - save string-table
Am 03.01.2019 um 03:04 schrieb Cottrell, Allin:
On Wed, Jan 2, 2019 at 1:50 PM Frederik.Schaff(a)ruhr-uni-bochum.de
<Frederik.Schaff(a)ruhr-uni-bochum.de> wrote:
>
> Happy new year!
>
> Is there a recommended way to automatically (i.e., in a script) save the
automatically generated string-table to a) an icon in the session b) a file in the
(script’s) working directory? Perhaps via an optional command to ‘open’ ?
Hi, but what do you need the string table for? I find that chapter 15 of the guide
explains how to see the numeric codes for the strings (print city --byobs --numeric) and
that you can access them apparently as a vector with curly braces ({city}).
From that you can re-build your string table if needed. Also I see in that chapter that
if you copy the string series you get the numeric codes (only) in the new series (series
citycodes = city).
And finally there's the strvals() function which retrieves all the string values in a
series and puts them in a strings array.
Note that ten minutes ago I didn't know any of these things. I just searched for
"string table" in the user guide. I'm glad you asked the question so I could
learn a new aspect of gretl, so I'm not saying you shouldn't have asked. I think
such questions are perfectly OK. I just want to point out (or repeat) that the
documentation we have is really in good shape.
cheers,
sven
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users