value of last observation
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
value of last observation
I know this is simple but I can't find the answer in the manual. Whats the command that will give me the value of the last observation in a series?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: value of last observation
Series.@last
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: value of last observation
I tried that but it gives me the date of the last observation, not the value.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: value of last observation
@last(seriesname)
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: value of last observation
It says cannot assign numeric expression to string variable. The observations are dates, maybe that's the problem.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: value of last observation
Sounds like you're trying to assign the value into a string, not a number.
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: value of last observation
My series is a list of observations and I'm trying to figure a way to use the first/last in the list to change the sample range, any idea on how to do that?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: value of last observation
Grab the date as a number, the use @datestr to convert to a string that smpl will understand
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: value of last observation
Do you mean something like
smpl 2000 @datestr(@last(seriesname))?
That gives me an error saying its an illegal date.
smpl 2000 @datestr(@last(seriesname))?
That gives me an error saying its an illegal date.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: value of last observation
Code: Select all
%date = @datestr(@last(seriesname))
smpl 2000 {%date}
-
miorinnovo
- Posts: 199
- Joined: Sun Mar 01, 2015 5:01 pm
Re: value of last observation
Thanks Gareth
Who is online
Users browsing this forum: No registered users and 1 guest
