Announcement

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

  • creating margins plot following gsem

    Hi i would like to create a margins plot similar to this (screenshot) but need help with the code, not sure if I've written it out correctly:

    Code:
    gsem (score1 <- preopscore1, ologit) ///
    (score2 <- preopscore2, ologit) 
    (score3 <- preopscore3, ologit) 
    (score4 <- preopscore4, ologit) 
    (C <- procedure) [fw=fw], lclass(C2)
    
    ///Margings plot
    marginsplot 
    margins, predict(outcome(score1) class(1)) ///
    predict(outcome(score2) class(1))
    predict(outcome(score3) class(1))
    predict(outcome(score4) class(1))
    I would like to plot each score for each procedure = 1 and procedure = 0 on the same graph







    Attached Files

  • #2
    I don't know if i've explained myself clear above

    I would like to produce the trajectories for each class showing change from preopscore* to score* for each procedure = 0 and procedure = 1
    Ultimately I would have 4 separate graphs with a red = procedure= 1 and blue = procedure= 0 with the different trajectories as seen in the screenshot


    Click image for larger version

Name:	Screenshot 2024-02-12 at 20.11.35.png
Views:	1
Size:	969.9 KB
ID:	1743014

    Comment

    Working...
    X