Page 1 of 1

Recoding alpha series to allow panel unstacking

Posted: Tue Dec 21, 2021 6:56 pm
by rjoharanz
Hi,

I'm trying to unstack a panel workfile page, but one of the identifier series (area) contains spaces and special characters, which EViews 11 (12 November 2019 build) does not allow.

I could recode each element of the series individually, as below, but I'm hoping there is a more efficient way.

Code: Select all

alpha area_ area_ = @recode(area="Hawke's Bay","Hawke_s_Bay",area)
I thought I could run the FOR loop below, but the string command doesn't work as the {%y} in the loop don't have quotes around them. Double quotes don't seem to work either.

Code: Select all

for %y "Bay of Plenty" "Manawatu-Wanganui" "West Coast" string a = {%y} string b = @makevalidname(a) area_ = @recode(area_={%y},b,area_) delete a b next
Any suggestions will be much appreciated.

Re: Recoding alpha series to allow panel unstacking

Posted: Tue Dec 21, 2021 7:56 pm
by EViews Gareth

Code: Select all

alpha area_ = @makevalidname(area)
:D

(we should document that function...)

Re: Recoding alpha series to allow panel unstacking

Posted: Wed Dec 22, 2021 1:17 pm
by rjoharanz
Good lord, haha thanks Gareth. Yes it seemed from the documentation that it only works on strings.

Merry Christmas!