Announcement

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

  • margins after gsem ; if command

    Hello I have performed a latent class analysis

    Code:
    gsem (q1 q2 q3 <-, ologit) (C <- preq1 preq2 preq3), lclass(C 3)
    This was run on a dataset which consists of procedure == 1 (treatment) and procedure ==0 (control) variable, which have been weighted using IPTW and have pweights

    I want to find out how the -earlyimprovers CLASS 1 - varied to the -late improvers CLASS 3- for both treatment and control; procedure ==1 and procedure == 0

    I then proceeded to plot graphs:

    Code:
    //Class 1 (this consist of both treatment and control)
    
    margins, predict(outcomeq1) class(1) ///
    predict(outcomeq1) class(1)
    predict(outcomeq1) class(1)
    
    marginsplot, recast(line) title ("Class 1" title("") ///
    xlabel(1 "q1" 2 "Pain" 3 "kneel" 4 "walk", angle(45)) title ("") ylabel(0(25)125) name(class1)
    This plots the data for both treatment and control

    1. Is there a way to plot the graphs for PROCEDURE ==1 treatment only
    and overlaying the same graph for procedure==0 control

    I understand the ... -if- command, eg
    if procedure== 1
    or
    if procedure == 0

    does not work with -gsem-

    2. Is there a way to take into consideration the already produced -weights- ?

Working...
X