hello,
I have the following program, which firs runs regressions and creates series of residuals. I need to regress the residuals series on each other (bivariate) whereby I chose the dependent variable randomly. I did it by creating a group, but am told that it is too complicated and could be done by putting the names of the series into a table and picking them up from that table. I dont know how to do that, however, so would appreciate your views.
smpl 1 100
for %y ser1 ser2 ser3 ser4 ser5 ser6 ser7 ser8 ser9 ser10
series {%y}=@rnd
next
for %x ser2 ser3 ser4 ser5 ser6 ser7 ser8 ser9 ser10
equation ser1{%x}.ls ser1 {%x} c
ser1{%x}.makeresid ser1{%x}leftover
next
group gres *over
for !i=1 to gres.@count
residuals (!i,1)=gres.@seriesname(!i)
next
!x=@round(@runif(1,10))
for !i= 1 to gres.@count
%iname=gres.@seriesname(!i)
%xname=gres.@seriesname({!x})
if !i<>{!x} then
equation _eq{!i}.ls {%xname} {%iname} c
endif
next
choosing variable randomly via a table vs group
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: choosing variable randomly via a table vs group
Hello,
I confess that I don't see how your program could be simplified by using a table to store series names instead of using a group. If there was going to be a table containing the series names anyway (third for loop?), perhaps holding results, then the group would be redundant. Otherwise, if this is truly a one-or-the-other choice, then I believe the group implementation is actually simpler (primarily because you can create it and fill it with the series names in a single statement).
I confess that I don't see how your program could be simplified by using a table to store series names instead of using a group. If there was going to be a table containing the series names anyway (third for loop?), perhaps holding results, then the group would be redundant. Otherwise, if this is truly a one-or-the-other choice, then I believe the group implementation is actually simpler (primarily because you can create it and fill it with the series names in a single statement).
Re: choosing variable randomly via a table vs group
Thank you, Matt, for your view.
Who is online
Users browsing this forum: Google [Bot] and 67 guests