Hello,
I have a 2 x N matrix, such as the following...
2 3 5 10 6
1 2 8 13 6
I would like to write a loop, such as foreach or forvalues, that will
take the first and second element of each column, and use them for
some operation, and then move on to subsequent columns.
For examle,
foreach column i...
multiply row a times row b.
Such that the above matrix would be turned into the vector
2 6 40 130 36.
Is there a straightforward way to accomplish this without using Mata?
Thanks,
Nathan
--
"Imagination is more important than knowledge..."
-- Albert Einstein
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/