Announcement

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

  • DiD panel data with individual fixed effects and time county fixed effects

    Hi,

    I am new to Stata and in need of an advice on how to translate my model specification into code. I have an individual level panel data set, including 11 million observations from 21 counties covering a period of 19 years. For the purpose of my project, I have 2 time dimensions- calendar (t) and event year (e). I want to use a difference in differences model with individual fixed effects, as well as to add county time fixed effects. The goal is to estimate the effect of being able to take sick leave before the first childbirth (event year -1) on the long term propensity to be on sick leave afterwards. There is an exogenous regional variation that affects the likelihood of the mother to get sick leave. The individual propensity to be on sick leave is measured by their history of sick leave withdrawals in the years before pregnancy (event years from -14 to -2).
    This is the my specification:

    SLict = αi + Σ17e=-1 αφ 1[ e=φ ] +αtc+ Σ17e=-1 αφ 1[ e=φ ]* HL + βiXit + βcXct + εict

    Where:

    - SL is number of sick leave days per year for individual i, living in county c, in calendar year t

    - αi is individual effect parameter which captures individual's propensity to be on sick leave during event years -14 to -2, which is to be used as a reference point

    - αφ captures how much has the individual's propensity to be on sick leave has changed from its reference point during event years -1 to 17. The term in brackets is equal to 1 when φ=e (event year e=-1 to 17)

    - αφ * HL is an interaction between the parameter capturing the individual propensity to be on sick leave in event years -1 to 17 and the county’s leniency in that year. HL is dummy variable indicating weather the county is lenient or strict on giving sick leave.

    - αct county time fixed effects for given calendar year, because time trends are very regional

    - Xit is an individual time varying covariant, individual characteristic that change over time, which includes indicator variables for additional children, length of education, work sector, mother’s income, father’s income, household’s disposable income.

    - Xct county level characteristics that change over time, such as county level unemployment rates in calendar year.


    My supervisor advised me to use xi:areg with absorb(id) and cluster(id). I don't know how to code it in a way that I can get all of the parameters for each event year. I'm confused about the whole code to be honest. It is way more complex than anything I have ever done. Therefore any help is more than welcome!






    Last edited by Marija Vasilevska; 21 Feb 2020, 07:05.

  • #2
    Marija:
    bumping the same query does not give you any advantage (please, see https://www.statalist.org/forums/help#adviceextras #1).
    In my opinion, your query takes too much time to be read and interpreted.
    Therefore, it is really unlikely that somebody on this forum will try to make your equation work (it's too time consuming. Besides, we do not know your data).
    Helpful replies are conditional on posting what you typed and what Stata gave you back (as per FAQ).
    If you're not familiar with the (advanced) codes your supervisor recommended, please see -areg- entry in Stata .pdf manual.
    Eventually, reading any decent text/handbook on panel data econometrics would be a good step to take.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Hi Carlo,

      Thank you for your response. My apologies for coming off as being disrespectful with posting the same query twice. I did it because I was worried that maybe my post is not being answered due to the bad timing when it was originally posted (Friday afternoon). My initial intention was to post the new and delete the old query, only to find out afterwards that one cannot delete its posts.

      I've read the Stata manual on the -areg command before I decided to seek help here. As you said yourself, the syntax for my specification is more on the advanced side and therefore I didn't get any clarity on how to write the code by reading the basics.

      My problem is with the Stata syntax. I'm not sure how to write the code in order to estimate the parameters of interest. This what I have tried so far:

      local controls = " child_2 child_3... child_5 age mothers_salary household_disposable_income fathers_salary edu_12 edu_14 edu_16"
      xi: areg sick_leave HL `controls', i.year * i.region, absorb (id) cluster (id)

      My population are first time mothers and I want to estimate the effects of pregnancy benefits (taken in event year -1) on the propensity to be on sick leave after the first child is born (from event year 0 upwards til 17). I want to use the mothers sick leave history (sick leave taken in event years from -14 to -2) as a reference point. That is αi from the specification. For each event year afterwards I want to estimate a parameter on how much the propensity to be on sick leave has changed in relation to the reference point(αφ ).
      There are 21 counties(or regions) with exogenous variation in availability of sick leave, and I have introduced a dummy HL=1 if the county is lenient on sick leave, 0 otherwise. So the interaction term should provide information on how much has the propensity to be on sick leave has been affected in the given event year by living in a lenient region.

      I also control for additional children (dummy for each additional child) salary for each of the parents, household's disposable income, education(dummies for length of education).
      The year fixed effects are specific for each region and therefore I have combined the two together. For some reason, I cannot get clarity on how to adjust the code so I get the parameters of interest for each event year.

      I have searched for similar posts, but so far I couldn't find anything that I could connect to my case. And as time is running out, I got so desperate and decided to seek help here.
      So, I would be more than grateful if anyone can give an advice on how to solve this.
      Many thanks upfront and again apologies for bumping the post.
      Last edited by Marija Vasilevska; 23 Feb 2020, 11:43.

      Comment

      Working...
      X