Announcement

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

  • Multiple Plots in One FIgure following Mixed Effects Logistic Model

    All,

    I need some help generating a graph to look the way I want using estimates based on a mixed effects logistic regression model. I am estimating the probability of drug use over time, treating time as a categorical predictor (because I want to examine the effects of time relative to one specific time point). Observations are nested within participant and the model includes a random intercept term for each participant. Post-estimation, I want to show the marginal effects over time by serostatus (3 categories) and I want this plot repeated 3 times, once per recruitment cohort. So graph one represents the effects of time by serostatus for cohort 1, the second represents time by serostatus for cohort two, etc.

    What I want looks like this graph: https://www.statcon.de/shop/images/stata/stata_05.gif

    where each individual plot would be side by side with one title and one legend and the y-axis labeled only once. The best I have gotten so far is 3 graphs on the same plot but with two at the top and one at the bottom and to the left, leaving a gap on the lower right side. Can anyone help me with the margins and margins plot commands to get a graph that looks like this example graph? If there is a way to use predict to get the correct values and then combine the graphs using twoway, that would work also (I think).

    Thanks in advance for any help.
    Regards,
    James
Working...
X