Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Tab a variable by several other variables (but not a multiple-way crosstab)


From   Max <maxliving@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Tab a variable by several other variables (but not a multiple-way crosstab)
Date   Thu, 14 Mar 2013 10:42:50 -0400

Hello,

I'd like to have a tab of one variable (say, x1) with several y variables
(say, y1..yn). Ideally, it would look like this (not sure how well this is
going to show up):

            |          y1           |           y2
        x1 |         0          1 |        0             1
-----------+--------------------+--------------------
         0 |       160        171  |   130          201
         1 |       167        177  |    180         164
-----------+--------------------+--------------------
     Total |       327        348 |  310            365

So far the closest I could find was using -table x1 y1 y2, c(freq)- but the
problem is that it cross-tabs y1 and y2 as well. I just want a table that
looks as though you stuck a bunch of individual tabs next to each other
(w/o the overall from each). Does anyone know how to do this?

Thanks,
Max
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index