Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Matrix question again.


From   adiallo5@worldbank.org
To   statalist@hsphsun2.harvard.edu
Subject   st: Matrix question again.
Date   Mon, 1 Aug 2005 01:40:19 -0400

Hi,
I've been struggling all this week-end with this
problem.
I have a question on how to "transpose" a matrice.
Suppose, I have the following matrice:

B[5,1]
.1
.3
.5
.7
.9

I want to reverse it into:

B[5,1]
.9
.7
.5
.3
.1

I've tried the following:

local n = rowsof(B)
forval i =1/`n' {
  local nu = `n' - `i' + 1
  scalar ele = el(B,`nu',1)
  mat A= nullmat(A) \ ele
}

But it is not giving me what I want.
Any better idea?

Best regards.

Amadou Bassirou DIALLO.
Poverty and Health Specialist.
PREM, The World Bank.


*
*   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