Page 1 of 1
how to sort only one series
Posted: Thu May 14, 2009 3:00 am
by sliang
dear all,
can you help me to sort only one series in ascending order in version 5?
i think series.sort is not available in version 5.
thanks,
sliang
Re: how to sort only one series
Posted: Thu May 14, 2009 3:17 am
by trubador
I think the correct syntax would be:
Re: how to sort only one series
Posted: Thu May 14, 2009 8:12 am
by EViews Gareth
Unfortunately that would sort the other series in the workfile by the target series too.
Other than by copying that single series into a new page, sorting that page, then copying it back, I cannot think of a way to do this in EViews 5.
Re: how to sort only one series
Posted: Thu May 14, 2009 9:05 am
by trubador
How about this?
Code: Select all
stom(series_y,vector_y)
vector sort_y = @sort(vector_y)
mtos(sort_y,series_y)
delete vector_y sort_y
Edit: Gareth was right and I corrected the mistake.
Re: how to sort only one series
Posted: Thu May 14, 2009 9:05 am
by EViews Gareth
That works in 6 (although I think you've got the second mtos wrong - you probably want sort_y not vector_y), but @sort was not implemented in EViews 5.
Re: how to sort only one series
Posted: Thu May 14, 2009 7:46 pm
by sliang
Thank you for your reply.
I wrote part of the program like this,
1. pagecopy(page=temp) x
2. sort x
3. copy x dest_name
4. pageselect untitled
I cannot figure out how to copy the sorted series
x in the newly created page, i.e., temp, back to
the original page, i.e., untitled.
In other word, how to refer the dest_name to the
original page in the third line above.
Re: how to sort only one series
Posted: Thu May 14, 2009 7:57 pm
by EViews Gareth
You want something like this:
Re: how to sort only one series
Posted: Thu May 14, 2009 8:08 pm
by sliang
It did not work because I've got an error message that says 'temp\x' is not defined.
Re: how to sort only one series
Posted: Thu May 14, 2009 8:13 pm
by EViews Gareth
A full set of commands would be something like:
Code: Select all
pagecopy(page=temp) x
sort x
copy temp\x untitled\x
pagedelete temp
I presume you have EViews 5.1?
Re: how to sort only one series
Posted: Thu May 14, 2009 8:19 pm
by sliang
I bought and installed it around July 2004.
I am not so sure which version is it.
Re: how to sort only one series
Posted: Thu May 14, 2009 8:34 pm
by EViews Gareth
help->about EViews
Re: how to sort only one series
Posted: Thu May 14, 2009 8:56 pm
by sliang
Eviews 5.0
Re: how to sort only one series
Posted: Thu May 14, 2009 9:05 pm
by EViews Gareth
Re: how to sort only one series
Posted: Thu May 14, 2009 9:18 pm
by sliang
It worked.
Thank you very much.