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
OLS with Variable Independent Variables
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: OLS with Variable Independent Variables
Code: Select all
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
And to check it works, run this:
Code: Select all
create u 100
series y=nrnd
series x=nrnd
%dependent = "y"
%currentseries = "x"
equation eq.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
Re: OLS with Variable Independent Variables
Hi Gareth,
Can you explain why the following works? I don't get it.
%dependent = "y"
%currentseries = "x"
So now this works...BUT what should I do if I want to see the names of my independent variables in each "eq" output? Now they're all X's.
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
series y = nrnd
series x = nrnd
%dependent = "y"
%currentseries = "x"
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
next
Can you explain why the following works? I don't get it.
%dependent = "y"
%currentseries = "x"
So now this works...BUT what should I do if I want to see the names of my independent variables in each "eq" output? Now they're all X's.
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
series y = nrnd
series x = nrnd
%dependent = "y"
%currentseries = "x"
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
next
Last edited by Jun on Wed Mar 16, 2011 5:07 pm, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
OLS with Variable Independent Variables
I don't understand your question.
Re: OLS with Variable Independent Variables
I think I got it...thanks
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
series y = {%dependent}
series x = {%currentseries}
%dependent = "y"
%currentseries = "x"
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
next
for !i=1 to @wcount(%independent)
%currentindependent=@word(%independent,!i)
%currentseries=@wlookup(%currentindependent,"series")
series y = {%dependent}
series x = {%currentseries}
%dependent = "y"
%currentseries = "x"
equation eq{!i}.ls(cov=hac) {%dependent} c {%currentseries}(0 to -12)
next
Who is online
Users browsing this forum: No registered users and 1 guest
