Announcement

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

  • Query on ordering coefficients from multiple models when using coefplot

    Hi All

    We need help with using the coefplot command. Briefly, we have run a series logistic regression models (5 models in total with a loop to make it easier). These regression models also include interactions terms between two categorical variables (ACEscore and sexual). This is followed by 'margins' to obtain predicted probabilities of the interaction categories/groups:

    Code:
    foreach var of varlist kesscat docdep selfharm suicide victim {
    svy: logit `var' i.ACEscore##i.sexual
    eststo `var': margins i.ACEscore#i.sexual, post
    }
    We then use 'coefplot' to plot just the predicted probabilities in a figure:

    Code:

    Code:
    coefplot kesscat docdep selfharm suicide victim
    By default, coefplot orders the estimates/margins in the figure (see attached) according to the 'ACEscore' variables' categories. However, we would like to order the margins by model (kesscat docdep selfharm suicide victim). It doesn't seem like the order function is helpful here (unless if we're doing something wrong!).

    Any tips would be really helpful!

    Many thanks
    /Amal
    Attached Files
Working...
X