Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Flip a matrix around


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Flip a matrix around
Date   Wed, 2 Aug 2006 16:49:29 -0400

Danielle--
I'm sure there's a more elegant solution, but
something like this might be easy:

. matrix T= (1,2,3,4\5,6,7,8)
. di T[2,3]
7
  /*oops, I wanted the column third from last,
    not the third column */
. di T[2,colsof(T)-2]
6

On 8/2/06, dferry <dferry@nber.org> wrote:
The problem is that the results of dfgls for each lag are listed in reverse order (i.e., results for lag m are listed first and results for lag 1 are listed last). So, the line "local T = r[`optlag', 5]" does not grab the right row. Can I flip the matrix r around so (or re-sort the rows) so that the first row corresponds to the results for lag 1 and the row m corresponds to results for lag m? Or is there perhaps a better way to approach this?

Thanks,
Danielle
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index