Announcement

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

  • Can margins command be used in a case-control data?

    Can the post estimation margins dydx command be used for a case-control data? (logistic regression, continuous by binary interaction).

  • #2
    No, the marginal effects are influenced by the constant, and the constant is meaningless (fixed by the design of the study and not representing empirical information) in a case control study.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you very much Maarten for the quick reply. What alternative do you recommend would be the best way to visualize interaction in this scenario? Ideally I would want the log odds of the outcome (Y) on the y axis and continuous variable (X) on the x axis, stratified by the third binary variable (Z). I used the following code but i am getting weird graphs. (I ran linear and non linear logit models (RC splines) and my linear model has significantly better fit than the non linear ones)

      Code:
      logit Y Z##c.X c1 c2 c3 c4
      predict xb
      twoway (line xb X if Z==0, sort) ///
      (line xb X if Z==1, sort lpatt(dash)), ///
      legend(order(0 "a" 1 "b"))
      Thanks
      Last edited by Thekke Purakkal; 11 Jan 2016, 02:40.

      Comment


      • #4
        The whole point of a case control study is that you cannot estimate either the probability or the odds of the event occuring, only the odds ratio can be estimated. So the graph you are looking for is impossible, unless you have other information outside your data on the prevalence of the event in the population.
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Thanks for pointing that out . I made a mistake. I wanted to say... Ideally I would want the odds ratio on the log scale on the y axis and continuous variable (X) on the x axis, stratified by the third binary variable (Z). log odds ratio is possible, right?

          Comment


          • #6
            What you mentioned here is exactly what I want to do. http://www.stata.com/statalist/archi.../msg00299.html Plotting an interaction as a line graph on the log scale with confidence interval. However, I am not understanding how to get the data set with odds ratios and CI's and the code with specifics you mentioned.

            Comment


            • #7
              I think i got few options from here. Visualizing Interactions for Logistic Models

              Comment

              Working...
              X