Announcement

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

  • How to get 95% CI after ppml_fe_bias

    Dear Joao Santos Silva and Tom Zylkin

    I am using the latest version of ppml_fe_bias to estimate the anticiatory and phased-in effects of PTAs. However, the command produces the bias corrected coefficient estimates (β) and their standard errors (SE), It does not report 95% CI. In my case, I want to plot treatment leads and lags of PTAs along with their 95% CI's, I am not sure how to obtain 95% CI after ppml_fe_bias. I can obtain the upper and lower limit using CI=β± 1.96×SE, but it would be an hectic exercise in my case.

    Is there any way to obtain 95% CIs after ppml_fe_bias and If you can show me the code how to plot treatment leads and lags estimates along with the 95% CI, that would be really helpful.

    Thanks and regards,
    (Ridwan)

  • #2
    Dear Ridwan Sheikh,

    I believe that the command saves the corrected results in the matrices e(b) and e(V). So, you can just write a loop to construct the confidence intervals based on the elements extracted from those matrices.

    Best wishes,

    Joao

    Comment


    • #3
      Thank you Joao Santos Silva

      I am using the following post-estimation codes after running the ppml_fe_bias, though I am able to obtain the 95% CIs, but I am still unable to use estout to obtain the 95% CIs, in a the compitable table format. I am running the following codes:


      Code:
      ppmlhdfe trade ptalead_5 ptalead_4 ptalead_3 ptalead_2 ptalead_1 pta ptalag_1 ptalag_2 ptalag_3 ptalag_4 ptalag_5 ptalag_6 ptalag_7 ptalag_8 ptalag_9 ptalag_10 gatt wto eu, a(exp_id#year imp_id#year exp_id#imp_id glob#year) cluster(exp_id#imp_id) d
      matrix beta = e(b)
      predict lambda
      
      ppml_fe_bias trade ptalead_5 ptalead_4 ptalead_3 ptalead_2 ptalead_1 pta ptalag_1 ptalag_2 ptalag_3 ptalag_4 ptalag_5 ptalag_6 ptalag_7 ptalag_8 ptalag_9 ptalag_10 gatt wto eu, i(exp_id) j(imp_id) t(year) lambda(lambda)
      
      ppml_fe_bias trade ptalead_5 ptalead_4 ptalead_3 ptalead_2 ptalead_1 pta ptalag_1 ptalag_2 ptalag_3 ptalag_4 ptalag_5 ptalag_6 ptalag_7 ptalag_8 ptalag_9 ptalag_10 gatt wto eu, i(exp_id) j(imp_id) t(year) lambda(lambda)  beta(beta)
      After that I extract bias-corrected coefficient estimates and variance matrix using the following loop (as you said in the post above), compute the standard errors, 95% CI, and display results as:

      Code:
      // Extract bias-corrected estimates and variance matrix
      
      matrix b_corrected = e(b)   // Bias-corrected coefficients
      matrix V_corrected = e(V)   // Bias-corrected variance matrix
      
      // Compute standard errors (fix type mismatch)
      
      matrix se = J(1, colsof(b_corrected), 0)  // Create empty row vector
      forvalues i = 1/`=colsof(b_corrected)' {
          matrix se[1, `i'] = sqrt(V_corrected[`i', `i'])  // Extract diagonal variance and take sqrt
      }
      
      // Compute 95% confidence intervals
      
      matrix lower = b_corrected - 1.96 * se
      matrix upper = b_corrected + 1.96 * se
      
      // Display results
      
      mat list b_corrected
      mat list se
      mat list lower
      mat list upper
      The codes untill now worked fine, as it lists coefficeint estimates, standard errors, lower and upper CIs. But I am not sure how to proceed forward to obtain the event-study plot that shows coeffient estiamtes with 95% CI bars. In particular, I am unable to use estout to store results in compitable format (I mean a table showing coefficient estimates, standard error, lower and upper CI).

      Any help in this regard will be greatly appreciated Clyde Schechter Tom Zylkin

      Comment


      • #4
        Sorry, but I can't help here. I use neither -ppml_fe_bias- nor -estout- myself. So I don't have any idea about how they do or don't play together.

        Comment


        • #5
          Looks like you'll have to get into ppml_fe_bias.ado and modify the outreg command. Or take what you've stored and create your own output table, which would not be hard.

          Comment


          • #6
            Thank you Clyde Schechter and George Ford .

            I have managed to create the CIs and event-plot following a bit lengthy procedure.

            Comment

            Working...
            X