For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
- Posts: 423
- Joined: Fri Apr 15, 2011 5:35 am
Why is the code below generating an error? I thought the @iif command only does the calculation if a is not equal to 0...?
I have been inspired by the code in forum post viewtopic.php?f=5&t=10303&p=36003&hilit=splice#p36003
. However, many of my "a"-series hold zero values and are thus creating these error messages. what is the best way of overcoming this problem?
Code: Select all
wfcreate q 1970 2020
smpl @first 2000
smpl 2000 @last
%if =%first + " " +%first
genr aux=@iif(a<>0, @mean(b,%if)/@mean(a,%if)*a,b)
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 12386
- Joined: Tue Sep 16, 2008 5:38 pm
I don't get an error message if I run that code.
But, note, a test of a<>0 will return "na" if a=na, and so the @iif will return NA whenever a=na.
Return to “Data Manipulation”
Who is online
Users browsing this forum: No registered users and 0 guests