Statalist


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

Re: st: -table- command and percentages


From   "krishanu karmakar" <[email protected]>
To   [email protected]
Subject   Re: st: -table- command and percentages
Date   Sat, 26 Jan 2008 04:39:35 +0530

Prof. Ryan,

I have just installed your -tab3way- and from the help file it appears
it is "exactly" what I am looking for.

Thank you very much for writing this useful and beautiful piece of routine.

Regards

Krishanu

On Jan 26, 2008 4:01 AM, Philip Ryan <[email protected]> wrote:
> As long as your table has only 3 dimensions, then -tab3way- might be what you
> are looking for.  It's on the SSC site.
>
> Phil
>
>
> Quoting krishanu karmakar <[email protected]>:
>
> > Thank you very much Mr. Goldstein.
> >
> > Since this gives me column percentages I need to interchange the row
> > variable and supercolumn variables but still it gives me much more
> > than I hoped for.
> >
> > I am now wondering whether there is any command (wrapper more likely)
> > -tablerow- (I did a -findit tablerow- and alas there is none!).   As
> > -tablecol- from ssc helps to get column percentages and analogously
> > -tablerow- would have helped to get row percentages (hopefully). Does
> > any one using Stata have any clue about this?
> >
> > Regards
> >
> > Krishanu
> >
> >
> >
> >
> >
> > On Jan 26, 2008 2:57 AM, Richard Goldstein <[email protected]> wrote:
> > > 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/
> > >
> > *
> > *   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/
> >
>
>
> --
> Philip Ryan
> Professor
> Discipline of Public Health
>
> Director, Data Management and Analysis Centre
> Associate Dean (IT)
> Faculty of Health Sciences
>
> University of Adelaide
> 5005 South Australia
> AUSTRALIA
> CRICOS Provider Number 00123M
> -----------------------------------------------------------
> This email message is intended only for the addressee(s)
> and contains information that may be confidential and/or
> copyright.  If you are not the intended recipient please
> notify the sender by reply email and immediately delete
> this email. Use, disclosure or reproduction of this email
> by anyone other than the intended recipient(s) is strictly
> prohibited. No representation is made that this email or
> any attachments are free of viruses. Virus scanning is
> recommended and is the responsibility of the recipient.
>
> *
> *   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