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

Re: st: Percentages in cross-tabulation


From   Edwin Leuven <[email protected]>
To   [email protected]
Subject   Re: st: Percentages in cross-tabulation
Date   Tue, 24 Sep 2002 14:25:01 +0200

On Tue Sep 24, 2002 14:15, Kazi Ali Toufique wrote:
> Hello,
> I would like to crosstabulate a categorical row variable (say sex) and a
> categorical column variable (say religion) and the cells would be sum of
> income (total income of male of a particular religion and so on). The
> problem is how do I get column percentages of income without transferring
> the tabulation results to XL?
> Toufique

collapse (sum) income, by(sex religion)
egen total = sum(income), by(religion)
replace income = 100*income/total
table sex religion, c(m income)



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