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

Re: st: n-way tabulation


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: n-way tabulation
Date   Tue, 01 Nov 2005 19:18:22 +0900

I wrote:

You can get the cross-tabulation counts by using

preserve
contract religion gender age ethnicity
list, noobs separator(0)
restore

The cell counts are in the variable _freq.

--------------------------------------------------------------------------------

I forgot to mention that, if you suspect that some cell counts are zero
(that is, if some combinations are not represented among the original data)
and if you want those listed, then you would make placeholders for the
combinations by inserting a -fillin religion gender age ethnicity- command
after -contract-, fill in the missing values of _freq with zeroes, and
then -sort- again before -list-.

Joseph Coveney

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