NA in series

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

NA in series

Postby stefanp » Mon Mar 13, 2017 9:10 am

Hey there,

I have a series that, on purpose, contains a couple of "NA"s.

I need to extract the numerical value from series A if series B assumes the smallest value. This value in turn should be assigned to a scalar. I though of something like this

Code: Select all

if B=@minsby(B,identifier) then scalar=A endif
However, I end up with the found NA in matrix error message. Any ideas how to proceed?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: NA in series

Postby EViews Gareth » Mon Mar 13, 2017 9:15 am

Not entirely sure I follow, but I think something like:

Code: Select all

smpl if b=@min(b) scalar myscalar = @min(a)
(note that second @min is arbitrary).

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Re: NA in series

Postby stefanp » Mon Mar 13, 2017 9:39 am

I am using a Panel and hence, each cross-section has its own minimum. Since I am looping through the cross-sections, I thought @minsby instead of @mins would be appropriate because the former allows to specify an identifier.

is there another way to solve my problem without changing the current sample?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: NA in series

Postby EViews Gareth » Mon Mar 13, 2017 9:54 am

Can you describe in words what you're trying to do?

If there's a panel, why is there a scalar? What are you taking the minimum over? (Time, cross-sections, both?)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests