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

st: RE: Matrix Calculations


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Matrix Calculations
Date   Wed, 31 Jul 2002 12:43:13 +0100

christopher@fergusson030481.freeserve.co.uk
>
> I have two 2*1 matrices set up. I want to multiply these
> together to get a 2*1 matrix. Impossible, yes.  However i
> do not want to treat the matrices as real matrices, infact
> i only want to multiply the 1st row in matrix 1 with the
> 1st row in matrix 2, and the 2nd row in matrix 1 with the
> 2nd row in matrix 2.  Is this possible?  From my days as a
> c++ programmer I recall a function that would do this, and
> I was hoping somebody could point me to a similar function in stata.

It sounds as you want element-wise multiplication.

For this and other such add-ons, the FAQ

How do I perform element-by-element operations on matrices?
http://www.stata.com/support/faqs/data/matrix.html

explains the principles and points you to user-written
canned versions. Typing

search matrix element

would also point you to these resources.

Nick
n.j.cox@durham.ac.uk

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