Announcement

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

  • significant difference among coefficients

    Hello I run the following model

    Code:
    *x1=explanatory variable
    *x2=treatement*girl
    *x3=lagged explanatory variable
    *x4=lagged explanatory variable*girl
    
    reghdfe y x1 x2 x3 x4 girl , absorb(year distid child_age mother_matri child_age#girl_child mother_matri#girl_child distid#c.year state_year) cluster(village_id)
    1. How do I show that the estimated coefficients of x1 and x2 are significantly different from x3 and x4 using Lincom command?

    2. Can I also know how to get the marginal effect on boys and girls separately? Since I also interact the child level controls such as child's age(child_age) and whether mother passed matriculated (mother_matri) with the girl indicator?
    3.Should I have mentioned child_age#girl_child mother_matri#girl_child outside the abs bracket?

  • #2
    Sara:
    is x1=treatment?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Yes,sorry

      Comment


      • #4
        Code:
         
         x1=treatment *x2=treatment*girl *x3=lagged treatment *x4=lagged treatment*girl

        Comment


        • #5
          Sara:
          1)
          Code:
          . use https://www.stata-press.com/data/r18/regress
          
          . g x4=runiform()*1000
          
          . regress y x1 x2 x3 x4
          
                Source |       SS           df       MS      Number of obs   =       148
          -------------+----------------------------------   F(4, 143)       =     71.59
                 Model |  3259.38706         4  814.846764   Prob > F        =    0.0000
              Residual |  1627.53186       143  11.3813417   R-squared       =    0.6670
          -------------+----------------------------------   Adj R-squared   =    0.6576
                 Total |  4886.91892       147  33.2443464   Root MSE        =    3.3736
          
          ------------------------------------------------------------------------------
                     y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                    x1 |   1.450692   1.085356     1.34   0.183    -.6947224    3.596107
                    x2 |   2.220283   .8644489     2.57   0.011     .5115337    3.929032
                    x3 |  -.0061417   .0005586   -11.00   0.000    -.0072458   -.0050376
                    x4 |  -.0000489   .0009381    -0.05   0.958    -.0019033    .0018054
                 _cons |   36.15296   4.507893     8.02   0.000     27.24224    45.06368
          ------------------------------------------------------------------------------
          
          . lincom (x1+x2)-(x3+x4)
          
           ( 1)  x1 + x2 - x3 - x4 = 0
          
          ------------------------------------------------------------------------------
                     y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                   (1) |   3.677166   1.686234     2.18   0.031     .3440007    7.010331
          ------------------------------------------------------------------------------
          .
          2)
          Code:
          . use https://www.stata-press.com/data/r18/margex
          (Artificial data for margins)
          
          . regress y i.sex i.group
          
                Source |       SS           df       MS      Number of obs   =     3,000
          -------------+----------------------------------   F(3, 2996)      =    152.06
                 Model |  183866.077         3  61288.6923   Prob > F        =    0.0000
              Residual |  1207566.93     2,996  403.059723   R-squared       =    0.1321
          -------------+----------------------------------   Adj R-squared   =    0.1313
                 Total |  1391433.01     2,999  463.965657   Root MSE        =    20.076
          
          ------------------------------------------------------------------------------
                     y | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                   sex |
               Female  |   18.32202   .8930951    20.52   0.000     16.57088    20.07316
                       |
                 group |
                    2  |   8.037615    .913769     8.80   0.000     6.245937    9.829293
                    3  |   18.63922   1.159503    16.08   0.000     16.36572    20.91272
                       |
                 _cons |   53.32146   .9345465    57.06   0.000     51.48904    55.15388
          ------------------------------------------------------------------------------
          
          . margins sex
          
          Predictive margins                                       Number of obs = 3,000
          Model VCE: OLS
          
          Expression: Linear prediction, predict()
          
          ------------------------------------------------------------------------------
                       |            Delta-method
                       |     Margin   std. err.      t    P>|t|     [95% conf. interval]
          -------------+----------------------------------------------------------------
                   sex |
                 Male  |   60.56034   .5781782   104.74   0.000     59.42668    61.69401
               Female  |   78.88236   .5772578   136.65   0.000      77.7505    80.01422
          ------------------------------------------------------------------------------
          
          .
          3) I am under the impression that your code is too complicated to obtain results that are easy to disseminate. That said, I would take (more parsimonious) intearctions outside the brackets (and use -fvvarlist- to create them), slim down -fe- to -absorb(panelid year) as the other predictors (village, district and state) seem to be time-invariant (and, as such, wiped out by the -fe- machinery) and woud cluster at -district- level, if helpful.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment

          Working...
          X