On Wed, 1 Jun 2022, John Paravantis wrote:
I am talking about adding the values of a qualitative variable, e.g.
country codes, as labels.
As an example from my megacity research, imagine a scatter plot of carbon
footprint (y-axis) vs city population (x-axis). In such a plot, it would be
very useful if the data points were labeled with the megacity name.
Sven has given you good answers. I'll just add a couple of points.
* If you have an Excel file with string-valued variables that gretl
won't load, please post it (offlist, perhaps) so we can see what's
going wrong. Note that in gretl a single series cannot mix string
and numeric values (but a series containing nothing but city names
should be fine).
* Gretl's plotting apparatus supports showing observation markers as
labels, but suppose the strings of interest do not take the form of
observation markers -- they're just a string-valued series. In that
case you can add obs markers with the same content. In the example
below I assume that the series named "city" is string valued:
<hansl>
strings S = array($nobs)
loop i=1..$nobs
S[i] = city[i]
endloop
markers --from-array=S
</hansl>
Allin