--- Kristian Karlson wrote
> I want to create a large, multiway contingency table in Stata. I
> need to reduce the table for a latent class analysis in another
> program. However, with the table and tabulate commands in Stata
> I only have the opportunity to cross two variables. With the
> userwritten command tab3way, I can cross three variables.
> However, I need to cross around eight polytomous variables and
> get the output into a data file / text file.
One possible solution would be to use -contract- to create a
dataset with this cross classification and their counts, and
export it in your favorite format afterwards:
*------------- begin example -----------------
sysuse nlsw88, clear
gen marstat = married + 2*never_married
label define marstat 0 "widowed/divorced" ///
1 "married" ///
2 "never married"
label value marstat marstat
tab marstat
contract race marstat union, zero nomiss
list
*------------ end example -------------------
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/