Unable to refer correctly to a cell
Posted: Mon Feb 01, 2016 6:25 am
Dear all,
I need help to refer to a certain cell. In my regression I refer to a series named e.g. AM, this value is stored in a svector names2. The svector contains a name of a serie which should be included, e.g. the first 10 values are AM then the next 10 are AJ etc.
This all works without a problem, however AJ contains some NA which causes an error. Therefore I included an if loop which should check whether a certain value in AJ is not NA. The data is time series data and some data has a later starting point which is causing the problem.
The problem is this line of code: if (@isna(@{yss2}.(!i))=0). It should check whether e.g. AJ(13) is not NA (Depending on both loops obviously). I am using EViews 8.
If someone could help solving or circumventing this problem it would be much appreciated. (code is below)
!window = 72
!length = @obsrange
matrix(!length-!window,90) AICvalues
matrix(!length-!window,90) BICvalues
matrix(!length-!window,90) AdjR2values
for !j = 1 to 90
string yss= names(!j,1)
string yss2= names2(!j,1)
for !i = 1 to !length-!window
smpl @first+!i-1 @first+!i+!window-2
if (@isna(@{yss2}.(!i))=0)
equation temp.ls {yss} C m10 m3 {yss2}
temp.fit(f=na) ERPf
AICvalues(!i,!j)=temp.@aic
BICvalues(!i,!j)=temp.@schwarz
AdjR2values(!i,!j)=temp.@rbar2
endif
next
next
I need help to refer to a certain cell. In my regression I refer to a series named e.g. AM, this value is stored in a svector names2. The svector contains a name of a serie which should be included, e.g. the first 10 values are AM then the next 10 are AJ etc.
This all works without a problem, however AJ contains some NA which causes an error. Therefore I included an if loop which should check whether a certain value in AJ is not NA. The data is time series data and some data has a later starting point which is causing the problem.
The problem is this line of code: if (@isna(@{yss2}.(!i))=0). It should check whether e.g. AJ(13) is not NA (Depending on both loops obviously). I am using EViews 8.
If someone could help solving or circumventing this problem it would be much appreciated. (code is below)
!window = 72
!length = @obsrange
matrix(!length-!window,90) AICvalues
matrix(!length-!window,90) BICvalues
matrix(!length-!window,90) AdjR2values
for !j = 1 to 90
string yss= names(!j,1)
string yss2= names2(!j,1)
for !i = 1 to !length-!window
smpl @first+!i-1 @first+!i+!window-2
if (@isna(@{yss2}.(!i))=0)
equation temp.ls {yss} C m10 m3 {yss2}
temp.fit(f=na) ERPf
AICvalues(!i,!j)=temp.@aic
BICvalues(!i,!j)=temp.@schwarz
AdjR2values(!i,!j)=temp.@rbar2
endif
next
next