Announcement

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

  • Excluding mlogit baseoutcome from marginsplot

    Hi there,

    I have patient data and I am trying to see if the value of a biometric is predictive of disease severity. I have 3 group categories; control (1), low (2) and high (3), where 1 contains healthy controls, and 2 and 3 are diseased patients with differing levels of severity. Age is a confounding variable of biometric.

    I have the following code:

    mlogit group biometric age, baseoutcome(1)
    margins, at(biometric=(0(0.1)6))
    marginsplot, recast(line) recastci(rarea)
    This generates a graph of the probability of being in each group across a continuum of the biometric value, which is what I want. However, I don't want the graph to include the control group (1), only the disease groups (2 & 3), i.e. I want to plot a graph of in-group probability at increasing levels of biometric for diseased patients only.

    I am quite new to stats and to stata, so I was hoping you might be able to give me some guidance. How can I exclude the control category? Does it make sense to not include the baseoutcome control category in the marginsplot, or would this mean I should also exclude the control group from the mlogit - if my goal is to model whether biometric levels can predict disease severity, would it be better to not calculate the margins relative to the control category at all?

    Thanks so much for your help!

    Very best,
    Liz



  • #2
    If your purpose is to see the ability of the biometric variable to predict disease severity among those with disease (i.e. you don't want to consider absence of disease as 0 severity), then, yes, you should omit the controls from the entire analysis. Removing it from -mlogit- will result in its disappearance from the -marginsplot- output as well.

    As far as I am aware, it is not possible to restrict -marginsplot- to some subset of the levels. To do that (without removing that level from the preceding regression) I believe you would have to save the -margins- results in a data file, -use- that data set, and then write your own -graph -commands to create what you want from that data.

    Comment


    • #3
      I will note that margins has the -predict(outcome())- option, that is another way to exclude a level of the outcome.

      Code:
      mlogit group biometric age, baseoutcome(1)
      margins, at(biometric=(0(0.1)6)) predict(outcome(2)) predict(outcome(3))
      marginsplot, recast(line) recastci(rarea)

      Comment


      • #4
        Andrew Musau is right. That is a way to selectively calculate the margins for only those outcomes you want.

        That said, if the goal really is to assess biometric's predictive validity for severity, and severity is really not applicable to controls, it still makes more sense to exclude it from the -mlogit- analysis in the first place.

        Comment


        • #5
          Thank you both so much!
          Andrew - that's really useful code to know, thank you!
          Clyde - thanks for the advice, I'll have a rethink about how I approach the analysis.

          Very best,
          Liz

          Comment

          Working...
          X