Replacement variable insidea replacement variable

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

bdamasio
Posts: 20
Joined: Tue Nov 05, 2013 4:49 am

Replacement variable insidea replacement variable

Postby bdamasio » Wed Sep 30, 2015 9:58 am

How can I put a replacement variable inside another one?
I am getting successive errors.
As an psudo-example I am trying a nonsense OLS regression, just for illustration.
For instance, I want to define:

%g="gdp"
%endogenous=" {%g} gfcf unem"

With this formulation I get the error: "{ is not defined in "EQUATION EQ1.LS GDP_CURR C {"GDP"} GFCF UNEM" "

If i write like this:

%g="gdp"
%levels = "%g gfcf unem"

I get the error: "Alpha series in specification - "gdp" "

If i write like this:

%g=gdp
%levels = "%g gfcf unem"

I get the error: "Series assigned to string in "%G=GDP". "



This is important because I want to program a dialog box with the option gdp in constant prices or gdp in current prices.

Can you help me with this please?

Thank you.
bdamasio.

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

Re: Replacement variable insidea replacement variable

Postby EViews Gareth » Wed Sep 30, 2015 10:16 am

Can't you just do:

Code: Select all

%var = "gdp" %endogenous = %var + " gcfc unem"

bdamasio
Posts: 20
Joined: Tue Nov 05, 2013 4:49 am

Re: Replacement variable insidea replacement variable

Postby bdamasio » Thu Oct 01, 2015 1:45 am

Thank you Gareth. It did works.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 3 guests