Announcement

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

  • How to obtain aggreate result using lincom command from seperated margins command

    Dear Everyone

    I am trying to replicate do file from the nonlinear difference-in-differences paper (2022) purpose by Prof. Wooldridge.

    I am struggling to use command "lincom" after the margins command since the lincom command does not provide standard error in this case.

    For example

    margins, dydx(w) at(d4 = 1 d5 = 0 d6 = 0 f02 = 0 f03 = 0 f04 = 1 f05 = 0 f06 = 0) ///
    subpop(if d4 == 1) noestimcheck vce(uncond) post
    scalar tau44 = _b[1.w]
    di tau44
    estimates restore beta
    .
    .
    .

    margins, dydx(w) at(d4 = 0 d5 = 0 d6 = 1 f02 = 0 f03 = 0 f04 = 0 f05 = 0 f06 = 1) ///
    subpop(if d6 == 1) noestimcheck vce(uncond) post
    scalar tau66 = _b[1.w]
    di tau66

    scalar tauavg = (tau44 + tau45 + tau46 + tau55 + tau56 + tau66)/6
    di tauavg

    How can I use lincom command to aggregate "tauavg" and also get a standard error including its z score and intervals. I am only be able to get the just scalar result.
    In the past, I only use lincom but just after one margins command, not the sequence command.

    Any suggestion or sample will be greatly appreciated.

    Thank You.

    Panyapon P.

  • #2
    Is this a balanced panel? And using linear regression?

    Comment


    • #3
      To Fernando Rios-Avila

      Unfortunately, it is unbalanced panel and nonlinear (count outcome), that reason why I try to implement Prof. Wooldridge method.
      I have tried "jwdid" you provided, and I am very appreacited. However, It fails many times to converg even the linear one.
      Possibly, maybe my data set is long T.

      Any idea to recommended?

      Thanks

      PS, I found your easter egg (a bit late). Congratulation...;-)

      Comment


      • #4
        Thank you!
        and do you have controls? Or just without them?
        I think you can still use jwdid but slightly modified

        Comment


        • #5
          I do have contols, just 3 variables, all of them are time-invariant.

          I will send the email to you.

          Thanks again.

          Comment

          Working...
          X