Announcement

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

  • How to output a table of mediation analysis; mediate

    I am doing mediation analysis in stata.
    but I did well only the "mediate" but i dont know how to make it a table in excel or dta or est , etc....

    mediate (conv_wkday sex age $par hinc $fe) (parenttime_wkday sex age $par hinc) (grandcare) if age<=12 & htype!=6, nointeraction
    : this is my commend.

    What I want is I wanna show only the MIE, NDE,. TE results of it, not whole result.
    but when i did
    outreg2 using "$table/med.xls", replace dec(3) drop(sex age $par hinc $fe)

    I can see all of the resultis like this;
      (1) (2) (3) (4) (5)
    VARIABLES NIE NDE TE conv_wkday parenttime_wkday
               
    1.grandcare -2.993 -36.851**
    (4.010) (17.935)
    parenttime_wkday 0.058***
    (0.003)
    r1vs0.grandcare -2.137** -2.993 -5.129
    (1.044) (4.010) (4.117)
    Constant 61.486** 361.900***
    (30.604) (30.747)
    Observations 8,874 8,874 8,874 8,874 8,874
    Robust standard errors in parentheses
    *** p<0.01, ** p<0.05, * p<0.1
    I dont wanna show the (4) & (5) columns, and i wanna show the only three effect results at once,

    Also, I need to add other dependent variables' results at one sheet......
    Help me plz.....
    Nobody solves this problem until now.....

    Thank you

  • #2
    You can use the etable command (available from Stata 17 onwards) to create the table. Consider this:

    Code:
    webuse birthweight, clear
    
    mediate (lbweight age, logit) ///
            (ncigs age sespar, poisson) ///
            (ses, continuous(8 4 12)), ///
            nointeraction
    
    etable, equations(NIE NDE TE) showeq
    which produces:

    Code:
    --------------------------------------------
                                        lbweight
    --------------------------------------------
    NIE                                         
      Socioeconomic status score (0–20)         
        (1 vs 0)                           0.111
                                         (0.012)
        (2 vs 0)                          -0.021
                                         (0.004)
    NDE                                         
      Socioeconomic status score (0–20)         
        (1 vs 0)                           0.099
                                         (0.023)
        (2 vs 0)                          -0.067
                                         (0.010)
    TE                                          
      Socioeconomic status score (0–20)         
        (1 vs 0)                           0.211
                                         (0.024)
        (2 vs 0)                          -0.088
                                         (0.007)
    Number of observations                  2000
    --------------------------------------------
    etable also has an export option using which you can export the table to an Excel file (or PDF, Word, LaTeX, etc).

    Comment

    Working...
    X