Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Modified Two-Way Tables?


From   ROBERT RYAN ARCIAGA <[email protected]>
To   [email protected]
Subject   st: Modified Two-Way Tables?
Date   Fri, 21 Mar 2014 22:35:13 +0800

Sorry if the subject seems vague, but I honestly don't know what I'm
trying to do is called. Basically I want to produce a Two-Way Table
but for each column, I want to put two variables.
Sorry if the subject seems vague, but I honestly don't know what I'm
trying to do is called. Basically I want to produce a Two-Way Table
but for each column, I want to put two variables.

I'm using Stata 12.0/IC.

I have exercise data on an experiment using ANCOVA. Each "person" is
assigned to take 3 (at a randomized order) of the possible "treatment"
options to alleviate allergy symptoms. "x" is a measure of of the
allergy severity before treatment. "y" is a measure of allergy
severity after treatment. I basically want to combine this table:

. table person treatment, c(mean x)

-------------------------------------
          |         treatment
   person | Placebo   Drug A   Drug B
----------+--------------------------
        1 |      15       12       10
        2 |      12       10       12
        3 |      19        8        8
        4 |      12        4        6
        5 |       9        7       13
        6 |      17        3        5
-------------------------------------

...with this table:
. table person treatment, c(mean y)

-------------------------------------
          |         treatment
   person | Placebo   Drug A   Drug B
----------+--------------------------
        1 |      13       16       18
        2 |      10       11       17
        3 |      18        9       15
        4 |      14        7       14
        5 |      12       12       19
        6 |      16       17       12
-------------------------------------

...such that I'd display the corresponding "x" and "y" for each
category of the treatment as a separate column. So it would look
something like:

-------------------------------------
           |         treatment
person | Placebo   Drug A   Drug B
           |   x    y       x   y      x   y

   I did manage do this though! It's not exactly what I wanted though...

. table person treatment, c(mean x mean y)

-------------------------------------
          |         treatment
   person | Placebo   Drug A   Drug B
----------+--------------------------
        1 |      15       12       10
          |      13       16       18
          |
        2 |      12       10       12
          |      10       11       17
          |
        3 |      19        8        8
          |      18        9       15
          |
        4 |      12        4        6
          |      14        7       14
          |
        5 |       9        7       13
          |      12       12       19
          |
        6 |      17        3        5
          |      16       17       12
-------------------------------------

Thank you everyone for your time!

-Robert Arciaga
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index