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

st: transpose of matrix

From   Christopher F Baum <>
Subject   st: transpose of matrix
Date   Mon, 1 Aug 2005 09:09:28 -0400

Amadou wants to "transpose" a column vector--but what he really means is to reverse the order of its elements.

Elementary row and column operations, my dear Watson. The mirror image of an identity matrix does what he wants.

mat j = J(5,5,0)
forv i = 1/5 {
mat j[`i',5-`i'+1] = 1
mat list j
mat list b
mat c = j*b
mat list c

Kit Baum, Boston College Economics

* For searches and help try:

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