Comparing series with missing values

For questions regarding programming in the EViews programming language.

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

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Comparing series with missing values

Postby paues » Sun Dec 30, 2012 5:07 pm

I need to write an if statement that compares if some series are identical, but I am having some troubles with series that contain missing values. What I would like to write is this

Code: Select all

!error=0 for %s {%series} 'If all observations are identical in the two series (irrespective of whether those identical observations are missing or not) if {%s}<>_{%s} then !error=1 endif next
but that returns an error whenever a series contains a missing value. What to do?

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Comparing series with missing values

Postby trubador » Mon Dec 31, 2012 2:37 am

@eqna command does what you want, but you may need few more steps:

Code: Select all

... series comp = @eqna(y1,y2) if @min(comp)=0 then !error = 1 endif ...

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Comparing series with missing values

Postby paues » Mon Dec 31, 2012 3:18 am

Thank you! I tried using @eqna() directly in the if statement without success. I guess it only works on one observation at a time.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest