Announcement

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

  • Question about creating a table and figures from results obtained from logistic regression (with margins)

    Hi,

    I am quite new to Stata, and totally new to this forum. My apologies if I post this in the wrong section or in the wrong way, somehow.

    The thing is that I want to spare some time and I am wondering whether there is a Stata-command that can help me. This is what I have already done: I have used logistic regression to assess the relationship between a medical condition and time (from 1988- present), controlling for this and that in the command. After that I used the margins to find the absolute values for spesific time-points. Next, my goal is to use those results (found f.ex that the insidence rate of the medical condition was 4% in 1988, 4.8% in 1992 and so on), and make both a table showing trends over time, and also a figure. Until now, I have done it the hard way by copying the table from logging, and using that data into a new Stata-window, and then doing the work to make tables and the figures. I am wondering whether there is a easier way to achieve this, using the original dataset?

    Thanks!

    Kind regards,
    Sindre Hoff Petersen

  • #2
    It looks like marginsplot will save you some time, but I don't know what you mean by "Until now, I have done it the hard way by copying the table from logging." Do you mean that you copy a table from a log file? So, you want to capture the estimated incidence rates and the tabulate and plot them? As I said, margins followed by marginsplot will do what you want. You may also want to save the fitted values from the logistic regression using the predict command after your regression. You can then manipulate that variable as you wish.
    Richard T. Campbell
    Emeritus Professor of Biostatistics and Sociology
    University of Illinois at Chicago

    Comment


    • #3
      Welcome to Statalist, and to Stata, Sindra.

      In case as a new user you have overlooked it, let me explicitly mention that in the same way that
      Code:
      help logit
      help logistic
      describe the logit and logistic commands,
      Code:
      help logit postestimation
      help logistic postestimation
      will direct you to commands which can be run following the corresponding estimation command, such as predict and margins. And then
      Code:
      help predict
      help margins
      will give you more details about each individual postestimation command.

      Let me also give you a bit of new Stata user advice I pass out on occasion.

      When I began using Stata in a serious way, I started - as others here did - by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. All of these manuals are included as PDFs in the Stata installation (since version 11) and are accessible from within Stata - for example, through Stata's Help menu. The objective in doing this was not so much to master Stata as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and manual.

      Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get started in a hurry and to work effectively.

      Again, perhaps you have already done this reading, but because the documentation is so valuable I want to be sure it isn't overlooked.

      Comment

      Working...
      X