Apply ranks from one matrix to another

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

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

DBW
Posts: 9
Joined: Wed Jul 24, 2019 3:37 am

Apply ranks from one matrix to another

Postby DBW » Mon May 17, 2021 4:54 am

Hi there,

I'm wondering if there's a quick way to sort the elements of a one matrix according to another?

I currently have two matrices, one containing rates of change for a class of variable (rows = date of observation, columns = variable) and the other containing the weights that apply to each of those variables. I'd like to re-order the columns of this second matrix according to the rank of each variable in the first for each month.

I think @rapplyranks will get me there if I loop through each row, extracting, sorting and @matplace-ing. But I was hoping there might be a shortcut.

Thanks very much.

DBW
Posts: 9
Joined: Wed Jul 24, 2019 3:37 am

Re: Apply ranks from one matrix to another

Postby DBW » Tue May 18, 2021 1:57 am

Sorry, forgot to mention that I'm running EViews 11.

EViews Matt
EViews Developer
Posts: 557
Joined: Thu Apr 25, 2013 7:48 pm

Re: Apply ranks from one matrix to another

Postby EViews Matt » Tue May 18, 2021 10:09 am

Hello,

It sounds like you'll have different orderings for different groups of rows in the matrix, so there's really no better way than to loop through the rows yourself.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 6 guests