Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: matsum - matrix sums of rows


From   Fabrizio Gilardi <Fabrizio.Gilardi@unil.ch>
To   statalist@hsphsun2.harvard.edu
Subject   st: matsum - matrix sums of rows
Date   Thu, 24 Aug 2006 15:06:14 +0200

Dear Statalist,

I've been using the -matsum- command written by Jeroen Weesie. I would like to access the results (notably the sums of rows) to use them in further operations: how can I do this? I've perused the help and Statalist's archives, but I couldn't find a solution.

Example:

. matrix A=(1,2,3 \ 4,5,6)

. matrix list A

A[2,3]
c1 c2 c3
r1 1 2 3
r2 4 5 6

. matsum A, r(r) d

row-wise sums of matrix A[2,3]

c1
r1 6
r2 15


How can I access the sum of the first row of A (i.e. 6) and that of the second row of A (i.e. 15)?

I'm still using Stata 7, but I should receive Stata 9 soon.

Thank you very much in advance,

Fabrizio Gilardi


------------------------------------------------------------
Fabrizio Gilardi, PhD
Institut d'Etudes Politiques et Internationales
Université de Lausanne
Bâtiment Humense
CH-1015 Lausanne
Phone +41 21 692 31 48
Fax + 41 21 692 31 45
fabrizio.gilardi@unil.ch
http://wwwpeople.unil.ch/fabrizio.gilardi/
------------------------------------------------------------



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