Statalist The Stata Listserver


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

st: triangular matrices


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: triangular matrices
Date   Thu, 16 Nov 2006 21:40:45 -0500

In response to Brendan's desire to generate a Stata matrix from its lower triangle: if this is meant to be a 4x4 matrix, what is on the diagonal? I have put zeroes on the diagonal:

clear
input v1 v2 v3
1 1 0
1 2 12
1 3 13
1 4 14
2 2 0
2 3 23
2 4 24
3 3 0
3 4 34
4 4 0
end
mkmat v3,mat(a)
mata: st_matrix("b",invvech(st_matrix("a")))
mat list b


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