increasing number of regressors
Posted: Wed Jul 03, 2013 3:37 am
Hi,
I have the following problem:
I have a dependent variable (series) and a number of regressors stored on the columns of a matrix. Once I have created a number of series (say 5 series se1 se2...se5) which correspond to each matrix column/regressor (as I cannot regress onto regressors which are in matrix form - if there is a way of doing so please let me know) I want to regress onto
i) se1
ii) se1 se2
iii) se 1 se2 se3 and so on
I want to specify this within a loop, thus I am looking for a way of setting 5 equations where the regressors increase from se1 to se5, for instance - see below - I am trying to specify this as it is done when including lags of a variable, but it doesn't seem to work. The loop here is crucial as the number of regressors I have is going to be possibly quite large.
equation eq
for !i=1 to 5
eq.ls dependent se(1 to {!i})
next
which I expected to be as follows:
!i = 1 : eq.ls dependent se1
!i = 2 : eq.ls dependent se1 se2
and so on...
another way I tried to approach this problem was to specify the regressors as a string where the elements that the string consists of increased from se1 to se5 but this seemed to be an even more difficult task.
Thanks in advance.
I have the following problem:
I have a dependent variable (series) and a number of regressors stored on the columns of a matrix. Once I have created a number of series (say 5 series se1 se2...se5) which correspond to each matrix column/regressor (as I cannot regress onto regressors which are in matrix form - if there is a way of doing so please let me know) I want to regress onto
i) se1
ii) se1 se2
iii) se 1 se2 se3 and so on
I want to specify this within a loop, thus I am looking for a way of setting 5 equations where the regressors increase from se1 to se5, for instance - see below - I am trying to specify this as it is done when including lags of a variable, but it doesn't seem to work. The loop here is crucial as the number of regressors I have is going to be possibly quite large.
equation eq
for !i=1 to 5
eq.ls dependent se(1 to {!i})
next
which I expected to be as follows:
!i = 1 : eq.ls dependent se1
!i = 2 : eq.ls dependent se1 se2
and so on...
another way I tried to approach this problem was to specify the regressors as a string where the elements that the string consists of increased from se1 to se5 but this seemed to be an even more difficult task.
Thanks in advance.