OLS with Variable Independent Variables
Posted: Wed Mar 16, 2011 3:50 am
When I tried to run the following OLS procedure, I got the error message "%CURRENTSERIES(0 TO -12) is not a valid string or scalar name."
And when I place the "(0 TO -12)" outside the braces i.e. {%currentseries}(0 to -12), I get the error message "0TO is not defined." The message is "0TO" and not "0 TO -12" so I guess the brackets () are not read by the program.
Basically I'm trying to regress {%independent} on {%currentseries} with up to 12 lags.
Anyway around this or do I have to create another group for the lags first?
%independent=@wlookup("d?_*","series")
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries(0 to -12)}
next
And when I place the "(0 TO -12)" outside the braces i.e. {%currentseries}(0 to -12), I get the error message "0TO is not defined." The message is "0TO" and not "0 TO -12" so I guess the brackets () are not read by the program.
Basically I'm trying to regress {%independent} on {%currentseries} with up to 12 lags.
Anyway around this or do I have to create another group for the lags first?
%independent=@wlookup("d?_*","series")
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries(0 to -12)}
next