Announcement

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

  • #16
    xtdidregress imposes a single coefficient, which is often too restrictive. Can you show exactly what you did?

    Comment


    • #17
      Professor, could you please explain what you mean by "You seem to know these dates from the variable CSO. Call this variable 'first_treat.' Then, you need to define this as the first year that a unit is treated. Set first_treat = 0 for a unit that is never treated."

      The variable CSO is not consistent, so we code 0 for the firm year when we do not have CSO and 1 when we have CSO. For example, for a specific company over the years, the sequence can be 00000111111000.

      Can you explain what you mean by "You seem to know these dates from the variable CSO. Call this variable 'first_treat'?"

      Comment


      • #18
        Almost all the newer canned did programs automatically account for N/T fixed effects.

        xthdidregress was the recommendation, not xtdidregress.

        Comment


        • #19
          please i use xthdidregress

          firstly it give me error

          units in time period 2004 cannot be treated


          after that i

          replace csopresence1 = 0 if year < 2005

          nvalid treatment
          The treatment is assumed to be staggered. Once a unit is treated, it should remain treated.

          HTML Code:
          . xthdidregress twfe (hard_final_Exact_new Firm_Size_w ROA_w Leverage_w Market_book_four_w Non_pension_CFO_w STD_CFO_w Board_Inde
          > pendence_w BoardSize_w Gender_Diversity_w Fund_Status_w FUNDING_RATIO_w Platn_Size_w CSR_Committee SustainabilityScore_w i.year
          >  i.ff_12) (csopresence1), group(id)
          note: variable _did_cohort, containing cohort indicators formed by treatment variable csopresence1 and group variable id, was
                added to the dataset.
          units in time period 2004 cannot be treated
              The first time period in the estimation sample is 2004. This implies units are either always treated or are switching
              between treatment and control, which violates the model's assumptions. You may look at variable _did_cohort to diagnose
              this behavior.
          r(498);
          
          . replace csopresence1 = 0 if year < 2005
          (2,516 real changes made)
          
          . xthdidregress twfe (hard_final_Exact_new Firm_Size_w ROA_w Leverage_w Market_book_four_w Non_pension_CFO_w STD_CFO_w Board_Inde
          > pendence_w BoardSize_w Gender_Diversity_w Fund_Status_w FUNDING_RATIO_w Platn_Size_w CSR_Committee SustainabilityScore_w i.year
          >  i.ff_12) (csopresence1), group(id)
          note: variable _did_cohort, containing cohort indicators formed by treatment variable csopresence1 and group variable id, was
                added to the dataset.
          invalid treatment
              The treatment is assumed to be staggered. Once a unit is treated, it should remain treated.
          r(498);

          Comment


          • #20
            do you think that there is a way to solve this problem ?
            or any type of Difference in difference that can work

            Comment


            • #21
              I'd create a simple dataset that matches all the interesting characteristics of your data --everything needed to estimate a model (include one X var).

              I created a toy dataset and discovered that xthdidregress does not seem to permit an on-off-on treatment.

              Comment


              • #22

                I am trying to do a difference-in-difference analysis. My dependent variable is the Pension Freeze. This variable takes the value of 1 if a firm 'i' freezes its pension plan in time 't'. then there are a few control variables. The treatment variable is, CSO. Which takes the value of 1 if a firm has appointed a CSO in time 't' and 0 otherwise. Now, I am trying to run DID with the treatment variable of CSO. A specific problem with my case is, that CSO is a time-variant. Therefore, xthdidtregress doesn't work as CSO is switching (firm i may have CSO=1 in time t, but 0 in t+1 and again 1 in t+2). Would you help me in the implementation of DID in this case?
                Last edited by hussein bataineh; 05 Aug 2024, 06:04.

                Comment

                Working...
                X