Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Odds ratio for more than two categorical variables

    Hi, everyone. Stata has a straightforward panel concerning odds ratio in a classic 2x2 table. However, I am working on a paper with a 2 X 3 table... There are three categories for age, and two in the columns, those who quit the treatment versus those who did not quit. Is there a way to determine the odds ratio for discontinuing the treatment for EACH age category? I appreciate any help you can provide. Thank you !

  • #2
    Do a logistic regression:

    Code:
    logistic quit_treatment i.age_category
    The output will give you the odds ratio for quit_treatment comparing each of two of the age categories to the third, omitted, reference category. If you want to compare those two to each other after that, use the -lincom- command.

    If you need specific help adapting this code to your specific data, or with using -lincom-, you will need to show example data using the -datatex- command. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Comment


    • #3
      Thank you very much, Clyde! I wrote the code you mentioned above and got two lines of the odds ratio. What I don't follow is... What is the omitted category? Is the mean of the crude age variable, with all the patients? By the way, my STATA is version 13. Thank you so much for your support!

      Comment


      • #4
        The output will show you what the two non-omitted groups are. The omitted category is whichever one wasn't shown in the output.

        Comment


        • #5
          Got it, Clyde! I was reading another thread about this subject. The omitted category, in my case, is the "younger" patients (concerning my paper), and the two lines are odds ratios for each one compared to these "younger" patients. These are the "middle-aged" and "older" patients. It is adequately for me, concerning my conclusions! Thank you very much!

          Comment

          Working...
          X