Page 1 of 1

invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 9:38 am
by tvonbrasch
Hi

I have downloaded the TED database "All data flat file - Adjusted version" from https://www.conference-board.org/data/e ... m?id=27762.

But when opening this file

Code: Select all

wfopen "..\TED\TED_adjusted.txt"
It holds the country name C“te d'Ivoire in the alpha series countries.

when trying to structure the workfile using the command

Code: Select all

pagestruct(bal=m) indicator_short country @date(year)
i get the error message:
Series specified for unstacking does not have valid values for forming series names in "PAGEUNSTACK SUPERID YEAR @ VALUE".
how do I change the name of the country in the alpha series so that the name is valid?

i tried something like
country=@replace(country,"C“te d'Ivoire","C_te_d_Ivoire")
but then i get the error message:
Unmatched quotes in "GENR COUNTRY=@REPLACE(COUNTRY,"C“TE D"...
I believe the problem arises because C“te d'Ivoire has “ in the name
Thomas

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 9:45 am
by EViews Gareth
Is your copy up to date? I don't get an error when I do the pagestruct. It seems to work just fine.

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 9:51 am
by tvonbrasch
thanks for your quick reply,

yes, my Eviews is up to date. (Dec 27 2016)

try the command

Code: Select all

alpha superid = "_" +indicator_short+ "_" + country pageunstack superid year @ value
then i get the message
Series specified for unstacking does not have valid values for forming series names in "PAGEUNSTACK SUPERID YEAR @ VALUE".
Thomas

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 10:00 am
by EViews Gareth
Yep, you can't have illegal characters in series names, so unstacking using that ID will fail. Not only" characters, but also spaces, parenthesis etc... will cause it to fail.

You can use the @makevalidname function to tidy up the ID series, but it is probably too long still, since the data series will be appended to the names.

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 10:33 am
by tvonbrasch
hi

thanks, the @makevalidname function is perfect.

but now, when i run the following code where i have shortened the names:

Code: Select all

country=@makevalidname(country) country=@left(country, 1)+@mid(country, 4,1)+@mid(country,10,3) pagestruct(bal=se) indicator_short country @date(year) alpha superid = "_" +indicator_short+ "_" + country pageunstack superid year @ value

i get the following error:
Indices do not uniquely identify observations in "PAGESTRUCT(BAL=SE) INDICATOR_SHORT COUNTRY @DATE(YEAR)".
what is it about this dataset that I am missing here? have I done something wrong with the unstack command?

Thomas

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Tue Jan 17, 2017 10:57 am
by EViews Gareth
I think your method of contracting the country names down is not unique - some countries get bound together as one.

For example, your country codes starting with i are:

Code: Select all

II IL IN IO IQ
Which were translated from the countries:

Code: Select all

Iceland India Indonesia Iran Iraq Ireland Israel Italy
It is a shame the source didn't include country ISO codes for you.

Re: invalid name in alpha series: C“te d'Ivoire

Posted: Wed Jan 18, 2017 2:12 am
by tvonbrasch
Aha, that explains it.

in the data, there is an alpha series called indicator_long, holding information about each data series,
indicator_long.JPG
indicator_long.JPG (50.73 KiB) Viewed 6477 times
when using commands such as

Code: Select all

pageunstack iso year @ value alpha superid = "_" +indicator_short+ "_" + iso pageunstack superid @date @ value
to unstack the workpage, how can I change the code so that the information in the alpha series "indicator_long" is included as a description in each of the unstacked series, i.e., the unstacked series "avghr_aus" holds the description "Annual hours worked per worker".

Thomas