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

st: RE: Matrix question.


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: Matrix question.
Date   Thu, 28 Jul 2005 21:18:49 -0500

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/



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