ranking problem with @ranks
Posted: Thu Jul 19, 2012 11:29 am
Hi,
I want to convert a whole bunch of series into ranked series. Assuming I have gdp growth of three
countries like this:
Year ca_gdp jp_gdp uk_gdp
1995 NA NA 20
1996 20 NA 40
1997 -20 NA 30
1998 10 15 20
I combined the three series and used eviews @ranks and it eventually gave me a ranked matrix like this:
Year ca_gdp_rank jp_gdp_rank uk_gdp_rank
1995 2 2 1
1996 2 3 1
1997 3 2 1
1998 3 2 1
The above ranking matrix is wrong in the way that NA in the matrix was deemed as zero and receive
a rank. Is there a way to let eviews rank among only those who have data?
(( the correct ranking I was expecting is:
Year ca_gdp_rank jp_gdp_rank uk_gdp_rank
1995 NA NA 1
1996 2 NA 1
1997 2 NA 1
1998 3 2 1 ))
The key command I use is
rowvector r5=@ranks(r3, "d", "f" )
this command take NA as zero instead of ignoring it.
Is there a way I can let eviews to rank with NA in?
Thank you in advance.
I want to convert a whole bunch of series into ranked series. Assuming I have gdp growth of three
countries like this:
Year ca_gdp jp_gdp uk_gdp
1995 NA NA 20
1996 20 NA 40
1997 -20 NA 30
1998 10 15 20
I combined the three series and used eviews @ranks and it eventually gave me a ranked matrix like this:
Year ca_gdp_rank jp_gdp_rank uk_gdp_rank
1995 2 2 1
1996 2 3 1
1997 3 2 1
1998 3 2 1
The above ranking matrix is wrong in the way that NA in the matrix was deemed as zero and receive
a rank. Is there a way to let eviews rank among only those who have data?
(( the correct ranking I was expecting is:
Year ca_gdp_rank jp_gdp_rank uk_gdp_rank
1995 NA NA 1
1996 2 NA 1
1997 2 NA 1
1998 3 2 1 ))
The key command I use is
rowvector r5=@ranks(r3, "d", "f" )
this command take NA as zero instead of ignoring it.
Is there a way I can let eviews to rank with NA in?
Thank you in advance.