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
Unable to refer correctly to a cell
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Unable to refer correctly to a cell
This is a little confusing.
YSS is a string. Strings don't have NAs. They can have missing (i.e. they're empty). Or, I suppose, they can contain the text "NA". Which is the case with you?
YSS is a string. Strings don't have NAs. They can have missing (i.e. they're empty). Or, I suppose, they can contain the text "NA". Which is the case with you?
Re: Unable to refer correctly to a cell
YSS2 is indeed a string. However it contains text referring to a certain series in my workfile. Thus {yss2} means it will use e.g. AJ (which is a time series variable) in the regression below. AJ is the series which contains numerical values and hence can also contain NA. This is what i need to check with the if loop or in some other way.
I appreciate the help!
I appreciate the help!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Unable to refer correctly to a cell
Then you can do something like:
Code: Select all
if (@isna({yss2}(!i))=0)
Re: Unable to refer correctly to a cell
Unfortunately i still get a syntax error.
I have included the workfile and the program, maybe that helps.
Thanks in advance!
I have included the workfile and the program, maybe that helps.
Thanks in advance!
- Attachments
-
- eviews.prg
- Program
- (525 Bytes) Downloaded 186 times
-
- returns.wf1
- Workfile/data
- (1.37 MiB) Downloaded 133 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Unable to refer correctly to a cell
Code: Select all
if (@isna({yss2}(!i))=0) then
Who is online
Users browsing this forum: No registered users and 2 guests
