Statalist


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

Re: st: -table- command and percentages


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: -table- command and percentages
Date   Fri, 25 Jan 2008 16:27:17 -0500

you can get column percentages via -tablecol- which can be downloaded from ssc

Rich

krishanu karmakar wrote:

Dear Stata Users,

I am creating a few tables from my data. This dataset contains details
of morbidity about some individuals. As an example a few of my
variables of interest are,

education (a categorical variable with four values (codes) 1,2,3,4
giving the educational qualification of the individual)
sex(coded as 1 = Male, 2= Female)
Income_group (a categorical variable with five values (codes)
1,2,3,4,5 telling which income quintile the individual belongs to)
ill_30 (whether the individual has been ill in last 30 days or not,
coded as 1 = yes, 2=no)
medical (whether any medical advice taken, coded as 1=yes, 2 = no and
set missing for those individuals who were not ill in last 30 days,
i.e. for whom "ill_30" takes the value 2.

I have already created some tables using -table-, -tab- and -tab2-.
However, I am facing trouble in the following.
I want to create a table where "Income_group" will be on the rows,
"sex" the column variable and "education" the supercolumn variable.
The tabulation will be over medical==2 i,e, my command should be like

-table cmd- Income_group sex education if medical==2

If I use -table- as the -table cmd- then the cell figures are some
statistic as enlisted in the -clist- for -table- (help table). I get
the following table
------------------------------------------------------------------------------------
              |                       education and Sex
              | -- Illierate -    --- Primary --    -- Secondary -
- Higher Sec -
    Income_group |   Male  Female      Male  Female      Male  Female
    Male  Female
--------------+---------------------------------------------------------------------
Very Poor 20% |     56      70        26      21        10      11
            3
     Poor 20% |     60      56        40      27        16       9
    1       4
   Middle 20% |     54      40        32      31        32      25
    4       4
   Richer 20% |     64      59        47      49        49      35
   11       5
  Richest 20% |     45      50        53      46        50      48
   15      16
------------------------------------------------------------------------------------


I, however, want them as percentage figures (percentage of all those
for whom medical==2). Since either relative frequency or percentage
does not figure out in -clist- or -table- and -tabulate- or -tab2-
cannot handle supercolumn variables (as far as I know) is there any
other way out? I would sincerely welcome any hint. If this type of
question has already been answered or discussed then even a direction
to that will be welcome.

I gratefully acknowledge the help of all those who might have an answer.

Regards

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