Announcement

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

  • To generate AICs and BICs for a Difference-in-Difference Regression model

    Is it possible to generate AICs and BICs for a Difference-in-Difference Regression model that was fitted using didregress module in STATA?
    Thanks.
    Last edited by Kehinde Atoloye; 09 Mar 2023, 11:29.

  • #2
    EDITED: Since didregress always reports clustered standard errors, it makes sense that no log-likelihood information is reported. See https://www.stata.com/support/faqs/s...od-ratio-test/. In case you want to calculate the statistics without clustering, use regress. Also, see https://www.statalist.org/forums/help#spelling on spelling Stata.

    Code:
    use "https://www.stata-press.com/data/r17/hospdd.dta", clear
    didregress (satis)(procedure), group(hospital) time(month) aequations
    regress satis procedure i.month, absorb(hospital) 
    estat ic
    Res.:

    Code:
    . didregress (satis)(procedure), group(hospital) time(month) aequations
    
    Number of groups and treatment time
    
    Time variable: month
    Control:       procedure = 0
    Treatment:     procedure = 1
    -----------------------------------
                 |   Control  Treatment
    -------------+---------------------
    Group        |
        hospital |        28         18
    -------------+---------------------
    Time         |
         Minimum |         1          4
         Maximum |         1          4
    -----------------------------------
    
    Difference-in-differences regression                     Number of obs = 7,368
    Data type: Repeated cross-sectional
    
                                   (Std. err. adjusted for 46 clusters in hospital)
    -------------------------------------------------------------------------------
                  |               Robust
            satis | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    --------------+----------------------------------------------------------------
    ATET          |
        procedure |
    (New vs Old)  |   .8479879   .0321121    26.41   0.000     .7833108     .912665
    --------------+----------------------------------------------------------------
    Controls      |
            month |
        February  |  -.0096077   .0184317    -0.52   0.605    -.0467311    .0275158
           March  |   .0219686    .018251     1.20   0.235    -.0147907    .0587279
           April  |  -.0032839   .0221028    -0.15   0.883    -.0478013    .0412335
             May  |  -.0094027   .0232399    -0.40   0.688    -.0562103    .0374048
            June  |  -.0038375   .0190634    -0.20   0.841    -.0422332    .0345581
            July  |  -.0111941   .0230029    -0.49   0.629    -.0575244    .0351361
                  |
            _cons |   3.444675    .011354   303.39   0.000     3.421807    3.467543
    -------------------------------------------------------------------------------
    Note: ATET estimate adjusted for group effects and time effects.
    
    . 
    . regress satis procedure i.month, absorb(hospital) 
    
    Linear regression, absorbing indicators         Number of obs     =      7,368
                                                    F(7, 7315)        =     146.83
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.5333
                                                    Adj R-squared     =     0.5299
                                                    Root MSE          =     .72384
    
    ------------------------------------------------------------------------------
           satis | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
       procedure |   .8479879   .0342191    24.78   0.000     .7809086    .9150672
                 |
           month |
       February  |  -.0096077   .0292119    -0.33   0.742    -.0668715    .0476561
          March  |   .0219686   .0292119     0.75   0.452    -.0352952    .0792324
          April  |  -.0032839   .0324936    -0.10   0.920    -.0669806    .0604129
            May  |  -.0094027   .0324936    -0.29   0.772    -.0730995     .054294
           June  |  -.0038375   .0324936    -0.12   0.906    -.0675343    .0598592
           July  |  -.0111941   .0324936    -0.34   0.730    -.0748909    .0525026
                 |
           _cons |   3.444675   .0168655   204.24   0.000     3.411614    3.477736
    ------------------------------------------------------------------------------
    
    . 
    . estat ic
    
    Akaike's information criterion and Bayesian information criterion
    
    -----------------------------------------------------------------------------
           Model |          N   ll(null)  ll(model)      df        AIC        BIC
    -------------+---------------------------------------------------------------
               . |      7,368  -8531.297  -8046.947       8   16109.89   16165.13
    -----------------------------------------------------------------------------
    Note: BIC uses N = number of observations. See [R] BIC note.
    
    .
    Last edited by Andrew Musau; 09 Mar 2023, 12:18.

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      EDITED: Since didregress always reports clustered standard errors, it makes sense that no log-likelihood information is reported. See https://www.stata.com/support/faqs/s...od-ratio-test/. In case you want to calculate the statistics without clustering, use regress. Also, see https://www.statalist.org/forums/help#spelling on spelling Stata.

      Code:
      use "https://www.stata-press.com/data/r17/hospdd.dta", clear
      didregress (satis)(procedure), group(hospital) time(month) aequations
      regress satis procedure i.month, absorb(hospital)
      estat ic
      Res.:

      Code:
      . didregress (satis)(procedure), group(hospital) time(month) aequations
      
      Number of groups and treatment time
      
      Time variable: month
      Control: procedure = 0
      Treatment: procedure = 1
      -----------------------------------
      | Control Treatment
      -------------+---------------------
      Group |
      hospital | 28 18
      -------------+---------------------
      Time |
      Minimum | 1 4
      Maximum | 1 4
      -----------------------------------
      
      Difference-in-differences regression Number of obs = 7,368
      Data type: Repeated cross-sectional
      
      (Std. err. adjusted for 46 clusters in hospital)
      -------------------------------------------------------------------------------
      | Robust
      satis | Coefficient std. err. t P>|t| [95% conf. interval]
      --------------+----------------------------------------------------------------
      ATET |
      procedure |
      (New vs Old) | .8479879 .0321121 26.41 0.000 .7833108 .912665
      --------------+----------------------------------------------------------------
      Controls |
      month |
      February | -.0096077 .0184317 -0.52 0.605 -.0467311 .0275158
      March | .0219686 .018251 1.20 0.235 -.0147907 .0587279
      April | -.0032839 .0221028 -0.15 0.883 -.0478013 .0412335
      May | -.0094027 .0232399 -0.40 0.688 -.0562103 .0374048
      June | -.0038375 .0190634 -0.20 0.841 -.0422332 .0345581
      July | -.0111941 .0230029 -0.49 0.629 -.0575244 .0351361
      |
      _cons | 3.444675 .011354 303.39 0.000 3.421807 3.467543
      -------------------------------------------------------------------------------
      Note: ATET estimate adjusted for group effects and time effects.
      
      .
      . regress satis procedure i.month, absorb(hospital)
      
      Linear regression, absorbing indicators Number of obs = 7,368
      F(7, 7315) = 146.83
      Prob > F = 0.0000
      R-squared = 0.5333
      Adj R-squared = 0.5299
      Root MSE = .72384
      
      ------------------------------------------------------------------------------
      satis | Coefficient Std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      procedure | .8479879 .0342191 24.78 0.000 .7809086 .9150672
      |
      month |
      February | -.0096077 .0292119 -0.33 0.742 -.0668715 .0476561
      March | .0219686 .0292119 0.75 0.452 -.0352952 .0792324
      April | -.0032839 .0324936 -0.10 0.920 -.0669806 .0604129
      May | -.0094027 .0324936 -0.29 0.772 -.0730995 .054294
      June | -.0038375 .0324936 -0.12 0.906 -.0675343 .0598592
      July | -.0111941 .0324936 -0.34 0.730 -.0748909 .0525026
      |
      _cons | 3.444675 .0168655 204.24 0.000 3.411614 3.477736
      ------------------------------------------------------------------------------
      
      .
      . estat ic
      
      Akaike's information criterion and Bayesian information criterion
      
      -----------------------------------------------------------------------------
      Model | N ll(null) ll(model) df AIC BIC
      -------------+---------------------------------------------------------------
      . | 7,368 -8531.297 -8046.947 8 16109.89 16165.13
      -----------------------------------------------------------------------------
      Note: BIC uses N = number of observations. See [R] BIC note.
      
      .
      Thank you very much. This is very helpful.

      Comment


      • #4
        Originally posted by Kehinde Atoloye View Post

        Thank you very much. This is very helpful.
        Please, is didregress appropriate for categorical outcomes?

        Comment


        • #5
          Please, is didregress appropriate for categorical outcomes?

          Comment


          • #6
            If the outcome is ordered and has several levels, you may be fine with didregress. Otherwise, no. See some references on attempts at nonlinear DID: https://stats.stackexchange.com/ques...ic-regressions

            Comment

            Working...
            X