Page 1 of 1

Using 'crossid' to name "panel units" (region)

Posted: Fri Mar 17, 2017 11:28 am
by Marc150
Hi,
I am trying to create a panel data set, and I want to assign names to the regions for which I have data. My code looks something like this:

wfcreate(wf=annual) a 1981 2015 10
alpha region
if crossid=1 then
region=region_name
endif

However, this doesn't work to assign names to the region variable, as I would like, and I don't understand why. What's strange is that if I create some other series, say q, assign it some arbitrary value, and use it in lieu of 'region', then the code works fine. However, that does not work if, rather than assigning it an arbitrary value, I set it equal to crossid.

Thanks,
Marc

Re: Using 'crossid' to name "panel units" (region)

Posted: Fri Mar 17, 2017 11:30 am
by EViews Gareth

Code: Select all

wfcreate(wf=annual) a 1981 2015 10 alpha region smpl if crossid=1 then region="region_name" endif

Re: Using 'crossid' to name "panel units" (region)

Posted: Fri Mar 17, 2017 11:49 am
by Marc150
Thanks Gareth. Sorry if I'm missing something, but when I try that I get the error message "endif found outside of loop or IF statement".

Re: Using 'crossid' to name "panel units" (region)

Posted: Fri Mar 17, 2017 2:02 pm
by Marc150
Nvm. Thanks, again.

FYI (for anyone else reading this), the code that works is

wfcreate(wf=annual) a 1981 2015 10
alpha region
smpl if crossid=1
region="region_name"