Page 1 of 1

variables and path with the same name

Posted: Tue Mar 13, 2018 8:57 am
by RDS
I am saving results of regressions containing x1, then, x2 and then x3, in subfolders with the respective names. This implies that for every regression I have two make two changes: the variable and the path name.

genr y = x1
'genr y = x2
'genr y = x3

%path ="P:Tables\x1"
'%path ="P:Tables\x2"
'%path ="P:Tables\x3"

Is it possible to have all in one go? Such as:
%path ="P:Tables\y"
but "P:Tables\y" should be "P:Tables\x1", "P:Tables\x2" or "P:Tables\x3" depending on the definition of y.

Re: variables and path with the same name

Posted: Tue Mar 13, 2018 9:28 am
by EViews Matt
Hello,

You can create a program variable containing the series name and use it to specify both y and %path. Taking this idea one step further, you could loop through all the series names:

Code: Select all

for %series x1 x2 x3 genr y = {%series} %path = "P:Tables\" + %series ... next