Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: SV: AW: Output from tabulate to a matrix


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: SV: AW: Output from tabulate to a matrix
Date   Thu, 21 Jan 2010 13:35:51 -0000

In Mata, yes. In Stata, no; use string variables or string scalars or
macros. 

Nick 
[email protected] 

Tomas Lind

Tanks Martin, it works fine.

Another question.

Is it possible to store names in a matrix for example "east", "west",
"north", "south" and then display the one that I want, for example the
3:rd
element "north"?

Martin Weiss

Those two missing column totals should read "4500" and "1000", I guess.
Ben`s -ssc d estout- may be helpful for you:

webuse nhanes2b, clear

capture which estout
if _rc ssc install estout

estpost svy: tab race diabetes, col
mat l e(row)
di _b[Total:White]
di _b[Total:Black]
di _b[Total:Other]

Tomas Lind

This syntax-

svy : tabulate area  kon , count

produces a table like this (with 4 rows shown (fake data)).

area  men    women   Total
--------------------------
aa    1200    1300    2500
bb    1100     900    2000
cc		4500		
dd		1000
--------------------------
Total                10000  
Key:  weighted counts


Is it possible to divide all rowtotals with "totaltotal" (10000) and
store
all these values in a matrix for later use? 

How can I display a specific element of the stored values?

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



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