Am 03.01.2019 um 14:09 schrieb Sven Schreiber:
Am 03.01.2019 um 13:35 schrieb Schaff, Frederik:
>
> For example, with R you get the information right away. R imports the
> data in its own data field type. I agree, it seems to be a feature
> request then. As it seems to be a special request, I would not open a
> ticket for it, if no one else sees a need for this feature.
>
There's no harm in opening a ticket, as this is not a guarantee it will
be implemented. It just serves to be reminded of it.
Actually I just realized that in section 15.5 of the guide there is
already something very similar in terms of description of this missing
feature (referring to Stata files and the value labels):
"We could check such variables [meaning the labels AFAICS] and import
them as string-valued series if they satisfy the criteria stated in
section 15.2 but we don’t at present."
The thing is, gretl already reads this information alright, so it
wouldn't be a whole new thing. However, the question is how to store
that information, because essentially it amounts to having different
categories of missings, which gretl doesn't have. String-valued series
are not the answer, because the majority of values in those imported
series are numeric and must be interpreted as such.
In principle one needs some nested bundles I guess
The above comment in the guide inspires a different approach to store
those labels, namely as a companion string-valued series, possibly like
in this example (monospaced font best here):
Stata's value-label mapping (readable from the original file):
-1 -> no answer
-3 -> not applicable
Implied series pair:
original_var gretl_label_series
1998 NA
-1 "no answer"
2001 NA
1996 NA
-3 "not applicable"
Then you could for example restrict the sample with the help of
ok(gretl_label_series), or you could set to missing (NA) all the values
in original_var which have a label in the companion gretl_label_series.
In principle it would already be doable I guess by capturing the output
from 'open' in a buffer string (with outfile ... --buffer), and working
on that. But it would be complicated and error-prone.
cheers,
sven