Hi folks,
I use the following code to re-estimate all my equations. I would change the end of the sample date to 2012 but I do not want to change the start date (which varies from eqn to eqn). Is there an easy way to do this? At present some eqn's will have their end date specified, some will be @last. I tried getting the third word out of the string with the sample but I think I may be on the wrong track!
Thanks in advance
Code to estimate all equations
%eqlist=@wlookup("*","equation") 'make a list of all equations in workfile
%s = @pagesmpl
for !i=1 to @wcount(%eqlist) 'cycle through the list one at a time
%eq = @word(%eqlist,!i) 'current equation name
%estcmd = {%eq}.@command 'current equation's estimation command
%s = {%eq}.@smpl
smpl {%s}
{%eq}.{%estcmd} 're-estimate current equation with its command
next
smpl 1950 2025
changing last year of sample
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: changing last year of sample
You're on the right track.
Assuming that all equations' samples are simple sample statements with a start date and end date (no if conditions, and no intra-day specifications), then you just need to do something like:
Assuming that all equations' samples are simple sample statements with a start date and end date (no if conditions, and no intra-day specifications), then you just need to do something like:
Code: Select all
%eqsmpl = eq.@smpl
%eqstart = @word(%eqsmpl, 1)
%s = %eqstart + " 2012"
smpl {%s}
Re: changing last year of sample
Thanks so much - that worked perfectly. I am cross with myself I was so very nearly there!!
Cheers
Cheers
Who is online
Users browsing this forum: No registered users and 2 guests
