Announcement

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

  • Difference in Difference

    Hi All,

    I face a problem when I want to check the estat trendplots there is an issue estat trendplots requires at least two pre-intervention time periods. How do I solve it?
    I have two pre intervention time periods June 2022 and Nov 2022 and one time post intervention June 2023

    Here is the code that I use for my DiD
    xtdidregress (revenue) (did), group(idbanksampah) time(bulan)

    Treatment and time information

    Time variable: bulan
    Control: did = 0
    Treatment: did = 1
    -----------------------------------
    | Control Treatment
    -------------+---------------------
    Group |
    idbanksampah | 40 40
    -------------+---------------------
    Time |
    Minimum | 1 2
    Maximum | 1 2
    -----------------------------------

    Difference-in-differences regression Number of obs = 240
    Data type: Longitudinal

    (Std. err. adjusted for 80 clusters in idbanksampah)
    ------------------------------------------------------------------------------
    | Robust
    revenue | Coefficient std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    ATET |
    did |
    (1 vs 0) | 407319.3 176161.3 2.31 0.023 56678.99 757959.7
    ------------------------------------------------------------------------------
    Note: ATET estimate adjusted for panel effects and time effects.


  • #2
    I don't understand the problem. What error did Stata tell you? Post your dataset using dataex and then show your code, in a code block.



    EDIT: by the way, you have a very short time series with gaps. I know DID can work with this but you only have 2 preintervention periods. Why should anyone take the parallel trends assumption seriously in this case when you're only fitting to two preintervention periods that aren't even consecutive to one another?
    Last edited by Jared Greathouse; 11 Aug 2024, 05:05.

    Comment


    • #3
      aa
      Last edited by Pace Pace; 11 Aug 2024, 11:10.

      Comment


      • #4
        Originally posted by Jared Greathouse View Post
        I don't understand the problem. What error did Stata tell you? Post your dataset using dataex and then show your code, in a code block.



        EDIT: by the way, you have a very short time series with gaps. I know DID can work with this but you only have 2 preintervention periods. Why should anyone take the parallel trends assumption seriously in this case when you're only fitting to two preintervention periods that aren't even consecutive to one another?

        estat ptrend
        estat ptrend requires at least two pre-intervention time periods

        estat trendplots
        estat trendplots requires at least two pre-intervention time periods

        Comment


        • #5
          I'd use the natural log of revenue.

          Comment

          Working...
          X