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

Re: st: how to create matrix


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: how to create matrix
Date   Sat, 17 Jul 2004 12:27:48 -0400 (EDT)

> I have 3 vectors: a,b,c and a matrix W.
>
> What is the simplest way to create
>
>       | b'b      -2a'b                 -1 |
> A= | c'c      -2b'c     -Tr(W'W) |
>       | b'c  -[a'c+b'b]           0     |
>
> If  you just point me in the right direction that would be great

create the matrix

mat A = J(3,3,0)

and then replace them element by element

mat A[1,1] = b'b

etc.

 ---                                    Stas Kolenikov
 --       Ph.D. student in Statistics at UNC-Chapel Hill
 - http://www.komkon.org/~tacik/  -- [email protected]

* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.

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