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

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

tvonbrasch
Posts: 359
Joined: Fri Apr 15, 2011 5:35 am

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

Postby tvonbrasch » Tue Jan 17, 2017 9:38 am

Hi

I have downloaded the TED database "All data flat file - Adjusted version" from https://www.conference-board.org/data/economydatabase/index.cfm?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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11836
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 17, 2017 9:45 am

Is your copy up to date? I don't get an error when I do the pagestruct. It seems to work just fine.
Follow us on Twitter @IHSEViews

tvonbrasch
Posts: 359
Joined: Fri Apr 15, 2011 5:35 am

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

Postby tvonbrasch » Tue Jan 17, 2017 9:51 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11836
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 17, 2017 10:00 am

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.
Follow us on Twitter @IHSEViews

tvonbrasch
Posts: 359
Joined: Fri Apr 15, 2011 5:35 am

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

Postby tvonbrasch » Tue Jan 17, 2017 10:33 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11836
Joined: Tue Sep 16, 2008 5:38 pm

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

Postby EViews Gareth » Tue Jan 17, 2017 10:57 am

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.
Follow us on Twitter @IHSEViews

tvonbrasch
Posts: 359
Joined: Fri Apr 15, 2011 5:35 am

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

Postby tvonbrasch » Wed Jan 18, 2017 2:12 am

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 1732 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
Last edited by tvonbrasch on Wed Jan 18, 2017 2:48 am, edited 1 time in total.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 3 guests