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

st: RE: Matrix Calculations

From   "Nick Cox" <>
To   <>
Subject   st: RE: Matrix Calculations
Date   Wed, 31 Jul 2002 12:43:13 +0100
> 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?

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

search matrix element

would also point you to these resources.


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index