I use Eviews 11, Sept 2019 built, 64bit.
Using the workfile created by the example code below, what is the easiest approach to create a valuemap and apply it to the values of the variable "crossid" in the page "data", by using the labels in "label" corresponding to the codes in "code" as defined in the page "valuelables"?
One approach could be to group "label" and "code", freeze the group as a table and create a valuemap by for-looping through the rows of the table as implemented in the code. I am wondering, however, whether there is a more straightforward approach.
mamo
Code: Select all
wfcreate(page=data) a 2000 2010 3
pagestruct(none)
crossid=crossid^2
pagestruct crossid @date(dateid)
pagecreate(page=valuelabels) u 3
series code=@obsid^2
alpha label="label_"+@str(code)
' Here follows a cumbersome approach to create and assign the valuemap
' Can this be simplified ?
freeze(mode=overwrite, tab) code label
valmap vmap
!nr=tab.@rows
for !r=3 to !nr
!value=@val(tab(!r,2))
%label=tab(!r,3)
vmap.append !value %label
next
pageselect data
copy valuelabels\vmap vmap
crossid.map vmap