header labels

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
terrya
Posts: 41
Joined: Mon Aug 24, 2009 6:05 pm

header labels

Unread post by terrya »

I want to put a particular set of labels in a header. The labels are different from the variable names. Following the example on graphing impulse response functions in the user guide, I set up the following.

Code: Select all

compute varlabels=|| $
    "Australia",$ 
    "Canada",$
    "France",$
    "Germany",$
    "Italy",$
    "Japan",$
    "NZ",$
    "UK",$
    "USA"||

declare vect[strings] varlabels(9)

...........
compute counter = 0
While counter < 10
{ dofor p = LAUS LCAN LFRA LGER LITA LJAP LNZ LUK LUS
   compute counter = counter + 1
   graph(header = "RGDP per capita: "+varlabels(counter),vlabel="Natural log") 1
  # p
end dofor}
end while

I got the following error message at the declare step.
## SX1. Identifier VARLABELS is Already in use as a(n) RECTANGULAR[STRING]

I can't see how this set-up is different from the IRF example. I've used the dofor instruction instead of the while function in various attempts.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: header labels

Unread post by TomDoan »

Do the DECLARE first (you don't have to put a dimension on it). When you do a

compute something=||....||

if RATS hasn't seen <<something>> before, it gets classified as a RECT[type] since that's more general.
terrya
Posts: 41
Joined: Mon Aug 24, 2009 6:05 pm

Re: header labels

Unread post by terrya »

Thanks for quick response. Worked perfectly.
Post Reply