Statalist


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

st: RE: Percentage calculation by groups


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Percentage calculation by groups
Date   Thu, 19 Jun 2008 17:41:31 +0100

Is -tab, cell- what you want? 

Nick
n.j.cox@durham.ac.uk 

Leonor Saravia

Im working with an employment database, which has data of working
people (self-employment or others), their age and sex (male -1 - or
female -2-). I'd like to calculate the percentage, by range of age, of
males and females who works as self-employed, but I need to calculate
this considering as the 100% of people those who belong to the
categories generated by age and sex (males or females), I mean NOT
considering as the 100% the total of people being self - employed
males or females without taking into account the age.

I'm using the next command (as Maarten Buis adviced me in another, but
similar problem):

noi tab age self-employed if sex == 1, row
noi tab age self-employed if sex == 2, row

But doing it this way Stata gives the percentage of male or female
sel-employed persons by age considering as the 100% the total of males
o females being self - employed, not the 100% of persons satisfying
those conditions AND the range of age.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index