Statalist


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

st: Format and Export(Excel) of 3-way table results


From   Green Alexandra <[email protected]>
To   [email protected]
Subject   st: Format and Export(Excel) of 3-way table results
Date   Thu, 30 Jul 2009 07:00:14 +0800

Dear StataListers,

I am trying to create a table to follow the trends in some over time.
In this case, I have monthly data on rainfall by state over time, 1960
to 2000. Status is a dummy that tracks  if rainfall in that month is
above (A) or below (B) average for that month over time. So I want the
table to show frequencies for the number of months that are A and B,
over the sample period.

2 Questions:
1. using tab3way seems to give me what I wish for (see partial output
below), but since I have to cover a space of 40 years over all the
states, the output wraps around the result window and is very
unsightly.
=> Is there a way for me to ask stata to export the results, so I can
recreate a table that's more reader-friendly say in Excel?

. tab3way  state status year
Table entries are cell frequencies
Missing categories ignored
----------------------------------------------------------------------------
          |                   year and status
          | -- 1990 --    -- 1991 --    -- 1992 --    -- 1993 --
  state |   A     B      A     B        A     B        A     B
----------+----------------------------------------------------------------
        1 |    1     2             3         1     2       1     2
        2 |    1     1             1                         1
----------------------------------------------------------------------------


2. Is there a way to have stata output frequencies for months that are
above average and months that are below average for the same state on
2 rows in an alternating fashion (such as in the "wanted" result)?
Wanted:

----------------------------------------------------------------------------
          |                   year and status
          | -- 1990 --    -- 1991 --    -- 1992 --    -- 1993 --
  state |   A     B      A     B        A     B        A     B
----------+----------------------------------------------------------------
        1 |    1             3               2                2
           |           2             3               2                2
        2 |    1             0               0                1
           |           1             1               0                1
----------------------------------------------------------------------------


Thank you very much for any suggestions.


Regards,
Alexandra
*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index