Statalist The Stata Listserver


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

st: vec of upper triangle


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: vec of upper triangle
Date   Wed, 9 Aug 2006 08:27:10 -0400

Edwin wants to put the upper triangle of a (symmetric?) matrix into a vector:

. mat list Ed

symmetric Ed[3,3]
c1 c2 c3
r1 1
r2 2 4
r3 3 5 6


. mata: st_matrix("Edv",vech(st_matrix("Ed")))

. mat list Edv

Edv[6,1]
c1
r1 1
r2 2
r3 3
r4 4
r5 5
r6 6


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index