New Series By Sort

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

New Series By Sort

Postby diggetybo » Sat Feb 06, 2016 2:14 am

Hey again,

I'm aware of the command

Code: Select all

x.sort(-)
for sorting a series in descending order. However, when I try creating a new series based off that sorted series, it doesn't keep the order. Is there anyway to generate a new series that is a sorted (ascending or descending) version of the original series?

Or alternatively, is there a way to sort the original series so that the sort order sticks and is retrieved as hard values, rather than just for display?

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

Re: New Series By Sort

Postby EViews Gareth » Sat Feb 06, 2016 10:17 am

The only way I think is by converting to vectors, or by doing it element by element.

Wanting to reverse the order of observations is somewhat alien in time series.

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: New Series By Sort

Postby diggetybo » Sat Feb 06, 2016 10:36 am

For sure, it's not for estimation or anything. I'm doing this data manipulation purely for a supplementary visualization.

I have unstructured/undated data, and would like to sort them from high to low (value-wise). How would a vector help with that? I noticed vector and matrix objects don't support the .sort extension. Or is it something different?

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

Re: New Series By Sort

Postby EViews Gareth » Sat Feb 06, 2016 10:43 am


diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: New Series By Sort

Postby diggetybo » Sat Feb 06, 2016 10:46 am

Cool now I'm on to something :)

Thanks to you

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: New Series By Sort

Postby diggetybo » Sat Feb 06, 2016 10:57 am

Maybe I'm not out of the woods yet... If @rapplyranks needs a vector with unique integers, then I will need to fill that vector with the right numbers. Does eviews have a way to retrieve an element's magnitude rank within the sample?

Say if I have a continuous series that ranges from 100 (min)to 1000(max) with 200 observations, I'd need some command to know how large that element was. Say if the element was 1000, then it'd be the highest, so 1. Or if it was 945, maybe it'd be something like 7, and so forth all the way to x=100, which should be the lowest, so 200 -- in keeping with the descending order example. Otherwise I'd have no way to assign the right value to the order vector for the @rapplyranks command.

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

Re: New Series By Sort

Postby EViews Gareth » Sat Feb 06, 2016 12:46 pm

@ranks (as mentioned in the example)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests