Great, that did the trick.
However, I have a follow up question. I should outline my broader objective here, I guess. I'm trying to create a subroutine that performs a load of regressions, and takes as some inputs the lag parameters for the independent variables. As per before, I want a method that can call all possible permutations of up to 4 lags. Before your post, I tried to write something that would do it for the permutations that involved successive numbers (e.g. 1 2 3 4, 3 4, 1 2 etc) by writing something like:
Code: Select all
subroutine regress (matrix aics, series pi, series og, scalar x, scalar y)
equation eq1.ls pi pi(1) og(-x to -y)
aics(1,1) = @aic
endsub
The routine is more complex, with more regressions, but you get the idea. Incidentally, this didn't work; the regressions were only performed for the xth lag. I don't get this, as when I run:
Code: Select all
equation eq1.ls pi pi(1) og(-1 to -4)
it worked fine.
Anyway, do you have any ideas how I could construct my subroutine to cover all possible permutations? I hope I'm making some sense. Failing this, is there a way of fixing my subroutine code above so that it works for the "consecutive" lags type?
Thanks, as ever,
Nikhil