Brass tacks, i'm doing a multiple regression consisting different dependent variables and independent variables in each equations.
some thing like this:
y1 = c + a + a(-1) + x1 + x1(-1) + e
y2 = c + a + a(-1) + x2 + x2(-1) + e
y3 = c + a + a(-1) + x3 + x3(-1) + e
.
.
.
yn = c + a + a(-1) + xn+ xn(-1) + e
could you help me with the code, also I want to store the r-squared. I've tried using eq{!i}_{!j} but i never succeed.
previously, I managed to do this regrression:
y1 = c + a + a(-1) + b +b(-1) + e
y2 = c + a + a(-1) + b +b(-1) + e
y3 = c + a + a(-1) + b +b(-1) + e
.
.
yn = c + a + a(-1) + b +b(-1) + e
here is the code:
Code: Select all
'create vector to store r-squares
vector(22) r2s
'create empty equation to be used inside the loop
equation eq
''counter of how many equations we have run
!rowcounter=1
'run pairwise regressions between each series
for !i=1 to agr.@count
%iname = agr.@seriesname(!i)
equation eq.ls {%iname} c r_ihsg r_ihsg(-1) r_agr r_agr(-1)
r2s(!rowcounter) = eq.@r2
!rowcounter = !rowcounter+1
next
Code: Select all
'create vector to store r-squares
vector(63) r2s
'create empty equation to be used inside the loop
equation eq
''counter of how many equations we have run
!rowcounter=1
'run pairwise regressions between each series
for !i=1 to bas.@count
%iname = bas.@seriesname(!i)
equation eq.ls {%iname} c r_ihsg r_ihsg(-1) r_bas r_bas(-1)
r2s(!rowcounter) = eq.@r2
!rowcounter = !rowcounter+1
next
regards,
dicuans
