Statalist


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

st: RE: Percentage calculation by groups


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Percentage calculation by groups
Date   Thu, 19 Jun 2008 17:41:31 +0100

Is -tab, cell- what you want? 

Nick
[email protected] 

Leonor Saravia

I�m 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index