Announcement

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

  • Help with two way fixed effect and event study?

    Hello,
    I'm currently working on a project where I asses whether or not a program has made an impact on contraception need. The program was installed in many countries at varying years so I was told that I should have a two way FE and that an event study regression was the way to go however I'm not quite sure how to go about (1) making a two way FE and (2) how to code for an event study regression. I have this equation if it helps: Yict= α + β*FP2020ct + δc +𝛾t+ εict where i is individual c is country and t is time. If anyone has any tips or ways about doing this please let me know!
    Thanks so much!

  • #2
    According to your equation, code should be

    Code:
    reghdfe y fp, a(county year) vce(cluster country)

    Comment


    • #3
      Rose:
      welcome to this forum.
      As an aside to Fei's helpful advice, it would be useful to know what type of regressand your regression code shows (categorical, that is impact on contraception need yes/no?).
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Originally posted by Carlo Lazzaro View Post
        Rose:
        welcome to this forum.
        As an aside to Fei's helpful advice, it would be useful to know what type of regressand your regression code shows (categorical, that is impact on contraception need yes/no?).
        Hello! I'm very new to stata so I'm not sure I completely understand your question but I'll try and expand on what I'm trying to find. Basically, I want to see if the program itself has reduced unmet need for contraception in the countries I have chosen. With each country having joined the program in different years I was told to make a two way FE to control for time. It was then recommended to me that I should use and difference in differences event study regression in order to see if the program had any affect on need for contraception. Let me know if this helps, thanks!

        Comment


        • #5
          Rose:
          thanks for clarifying.
          My question was probably simpler: what type of y (dependent variable) do you have in your regression? Is something like a yes/no effect on contraception?
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Rose:
            thanks for clarifying.
            My question was probably simpler: what type of y (dependent variable) do you have in your regression? Is something like a yes/no effect on contraception?
            Ah gotcha. I don't believe my y variable is a yes/no type of effect. To keep everything simpler for myself I chose these variables to work with (I'm using DHS data): knowledge of any method, use of any method, current marital status, currently living with spouse, location, wealth, education, education attained by partner, age, current number of kids, and the general identification variables like caseid.

            Comment


            • #7
              Rose:
              knowledge of any method, use of any method, current marital status, currently living with spouse, location, wealth, education, education attained by partner, age, current number of kids
              seem all predictors (right-hand side of your regerssion equation). So far so good.
              But what lies in the left-hand side of your regerssion equation?
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Rose:


                seem all predictors (right-hand side of your regerssion equation). So far so good.
                But what lies in the left-hand side of your regerssion equation?
                I guess I don't know. I was thinking it would be the variable use of any method to see whether use of contraception increased overtime after the program was joined. What do you think it should be?

                Comment


                • #9
                  Rose:
                  it might be (but please double-check whether this is the way to go with your colleagues/supervisor/professor/mentor).
                  If that were the case, -use of any method- should actually be a two-level categorical variable (yes/no) and you should switch to -xtlogit,fe-.
                  Please note that with that specification you'll obtain conditional fixed effect (due to incidental parameter bias; see, if interested, http://www.econ.brown.edu/Faculty/To...meters1948.pdf).
                  In addition, -xtlogit- does not support double clustering. However, you can cluster the standard errors at -panelid- level and plug -i.year- as a categorical predictor in the right-hand side of your regression equation.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Originally posted by Carlo Lazzaro View Post
                    Rose:
                    it might be (but please double-check whether this is the way to go with your colleagues/supervisor/professor/mentor).
                    If that were the case, -use of any method- should actually be a two-level categorical variable (yes/no) and you should switch to -xtlogit,fe-.
                    Please note that with that specification you'll obtain conditional fixed effect (due to incidental parameter bias; see, if interested, http://www.econ.brown.edu/Faculty/To...meters1948.pdf).
                    In addition, -xtlogit- does not support double clustering. However, you can cluster the standard errors at -panelid- level and plug -i.year- as a categorical predictor in the right-hand side of your regression equation.
                    Would a two level categorical variable here be able to show how much the program has impacted -use of any method- or just that it had or hadn't impacted contraceptive use?
                    Would I basically being turning year into a dummy variable so that years prior to the program would be 0 and years after the program would be 1?
                    What do you think of this: http://www.tomzimmermann.net/2018/08...ring-in-stata/ ?
                    Thanks so much for the help I really appreciate it!

                    Comment


                    • #11
                      Rose:
                      1)a two level categorical variable here would be able to show that the programme had or hadn't impacted contraceptive use.
                      To estimate how much the program has impacted -use of any method- you would need an ordinal variable (1)=a lot 2)=moderately 3) mildly; 4) nothin at all) or a score (continuious variable).
                      2) yes, if you want to go DID;
                      3) the community-contributed module -reghdfe- works well for panel datasets with continous regressands.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment

                      Working...
                      X