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

Fw: st: RE: Matrix question.


From   [email protected]
To   [email protected]
Subject   Fw: st: RE: Matrix question.
Date   Mon, 1 Aug 2005 01:36:40 -0400

Scott,
Thanks a lot for this helpful program.
I wasn't aware of matsum. The package
is great.
Cheers.
Amadou.


[email protected] wrote: -----

To: <[email protected]>
From: "Scott Merryman" <[email protected]>
Sent by: [email protected]
Date: 07/28/2005 10:18PM
Subject: st: RE: Matrix question.

sysuse auto,clear
tab rep fore [aw = mpg], matcell(A) col nof
matsum A, col(colA)
matrix C1 = (A[1...,1]/colA[1,1])*100
matrix C2 = (A[1...,2]/colA[1,2])*100
matrix D = C1, C2
matrix list D, format(%9.2f)

This uses Jeroen Weesie's -matsum- which is part of -matfunc- (STB-39
dm49).

Hope this helps,
Scott


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of [email protected]
> Sent: Thursday, July 28, 2005 4:36 PM
> To: [email protected]
> Subject: st: Matrix question.
>
> Hi,
> I have a question.
> Suppose I have the following output.
>
> . tab quint hv206 [aw=(hv005/1000000)*hv012], nof col matcell(A)
>          5 |
>  quantiles |    Has electricity
>   of weal  |        No        Yes |     Total
> -----------+----------------------+----------
>          1 |     40.41      19.90 |     20.06
>          2 |     23.27      20.08 |     20.11
>          3 |     17.71      21.55 |     21.52
>          4 |     18.61      21.69 |     21.67
>          5 |      0.00      16.78 |     16.65
> -----------+----------------------+----------
>      Total |    100.00     100.00 |    100.00
>
> . mat li A
> A[5,2]
>            c1         c2
> r1  18.265146   1178.444
> r2  10.519946  1189.0882
> r3  8.0043542  1275.6853
> r4   8.409607  1284.3561
> r5          0      993.22724
>
> How to obtain a matrix that contains only the rate of access, not
> frequencies?
> (i.e. 19.90, 20.08, 21.55, etc...)
>
> Best regards.
>
> Amadou Bassirou DIALLO.
>
>
> *
> *   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/


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

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