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

st: Re: Table with supercolumn and multiple percent entries in each cell


From   Daniel Egan <[email protected]>
To   [email protected]
Subject   st: Re: Table with supercolumn and multiple percent entries in each cell
Date   Mon, 27 Sep 2004 11:55:52 -0400

I forgot to mention two things: 
1)  A very close approximation can be had by 

bys fnum: tab inum ynum, column row cell (etc)

except that the percentages calculated are broken down by fnum's
denominator, not the whole of ynum's denominator.

2) I would like to be able to get this in a readable format, like I
would get with table, without big breaks for each fnum.


Thanks again. 
Dan

On Mon, 27 Sep 2004 11:30:45 -0400, Daniel Egan <[email protected]> wrote:
> Good morning,
> 
> I feel like maybe I am just overlooking something very simple,
> especially considering the ongoing conversation of tabstat etc, but I
> haven't been able to figure out how to do this myself yet...
> 
> I want a table with a supercolumn with 5 cell entries corresponding to
> the percentage of observations by column.
> 
> for example
> 
> table inum ynum, by(fnum) row
> 
> yields.
> 
>           y1     y2     y3     y4     y5
> ---------------------------------------------------
> f1    i |    11i    12i    13i    14i     15i
>      ii |    11ii   12ii    13ii   14ii    15ii
> ----------------------------------------------------
> f2    i |    21i    22i     23i    24i    25i
>      ii |    21ii   22ii    23ii   24ii    25ii
> ------------------------------------------------------
> Total    T1n     T2n    T3n   T3n   T3n
> 
> I want:
> 
>        |     y1        |  y2         |      y3      |     y4     |     y5
> --------------------------------------------------------------------------
> f1    i |    11i/T1n  |  12i/T2n  |  13i/T3n   |  14i/T4n  |   15i/T5n
>      ii |    11ii/T1n |  12ii/T2n |   13ii/T3n  | 14ii/T4n  |   15ii/T5n
> ----------------------------------------------------------------------------
> f2    i |    21i/T1n  |  22i/T2n  |   23i/T3n   |  24i/T4n  |  25i/T5n
>      ii |    21ii/T1n |  22ii/T2n |   23ii/T3n  | 24ii/T4n  |  25ii/T5n
> --------------------------------------------------------------------------------------------
> Total  |  T1n          |   T2n      |     T3n      |  T3n       |    T3n
> 
> Note: Txx vary considerably, and my IJix are not indicators.
> 
> Is there anyway to do this without creating new variables? Feel free
> to berate me if I am being slow.
> 
> Thanks in advance,
> 
> Dan Egan
>
*
*   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