Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: Stata matrix to Mata matrix form - Turn lower diagonal matrix


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: Re: Stata matrix to Mata matrix form - Turn lower diagonal matrix
Date   Thu, 1 Nov 2012 12:14:37 -0500

On Thu, Nov 1, 2012 at 11:46 AM, Bianca B. <[email protected]> wrote:
>
> mat_S2[1,2] is the name of the matrix.
>
>   mat_S2
>
>    1   2
>    +---------+
>  1 |  0      |
>    |  1   0
>    |
> > >+---------+
> I found this old post
> http://www.stata.com/statalist/archive/2007-02/msg00156.html
>
> where there is exactly my same question that is to turn my lower-triangular matrix, named mat_S2, into a symmetrical matrix by reflecting the lower triangular elements across the diagonal.
>
It already is - the upper triangle is not displayed but it does exist.

For example:

mata
a = 0,1 \ 1,0
a
a[1,2]
a[2,1]
vec(a)
end

 Scott
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index