Sample automatically updates when using "smpl if"

For questions regarding programming in the EViews programming language.

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

jbourque
Posts: 7
Joined: Tue Jul 05, 2011 8:26 am
Location: Ottawa, Ontario (Canada)
Contact:

Sample automatically updates when using "smpl if"

Postby jbourque » Tue Jul 05, 2011 8:40 am

Hello,
In 2 separate workfiles where I use an if statement within the smpl command (ie: smpl if a1 = na).
In both cases, I use this command to identify data holes in my time series and fill them in.
In one workfile, the sample size updates automatically after filling in the holes with data, while the other doesn't.
For example, in case 1:
smpl if a1 = na
(a1 contains data from 1986 to 2010 so smpl becomes 1980-1985 and 2011-2015)
a1 = a2
(a2 contains data for 1980-1985 so smpl automatically becomes 2011-2015 only)
a1 = a1(-1)
(smpl become empty)

Whereas in case 2:
smpl if a1 = na
(a1 contains data from 1986 to 2010 so smpl becomes 1980-1985 and 2011-2015)
a1 = a2
(a2 contains data for 1980-1985 BUT SMPL REMAINS 1980-1985 AND 2011-2015)

How can that be? I run both programs on the same version of Eviews 7 (Jan 7 2010 build). But since it works with one and not the other I'm guessing that isn't the problem.
Thanks for your help.

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

Re: Sample automatically updates when using "smpl if"

Postby EViews Gareth » Tue Jul 05, 2011 8:48 am

Hard to tell without seeing it.

jbourque
Posts: 7
Joined: Tue Jul 05, 2011 8:26 am
Location: Ottawa, Ontario (Canada)
Contact:

Re: Sample automatically updates when using "smpl if"

Postby jbourque » Wed Jul 06, 2011 6:53 am

Hi Gareth,
Do you mean the workfiles of the programs?

I found a quick fix in the meanwhile:
smpl if a1 = na
(a1 contains data from 1986 to 2010 so smpl becomes 1980-1985 and 2011-2015)
a1 = a2
smpl if a1 = na
(a2 contains data for 1980-1985 so smpl becomes 2011-2015 only)
a1 = a1(-1)
(smpl become empty)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests