Announcement

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

  • Issue with csdid in Event Study Using Repeated Cross-Sectional Data

    Hi Statalist,

    I'm using the csdid command in Stata to conduct an event study. My dataset is repeated cross-sectional with observations from the years 2011, 2013, 2015, and 2018. The first time to treat (time1) ranges from 2009 to 2018. The dependent variable (out) is a binary variable.

    When I run csdid, the results seem odd. Despite having 7306 observations in my dataset, only 305 observations are used in the analysis. It appears that csdid is only utilizing observations from 2011 and 2018.

    Here are my questions:

    Why is csdid only using observations from 2011 and 2018?
    Is it possible to include all the sample years (2011, 2013, 2015, and 2018) in the analysis?
    Any insights or suggestions would be greatly appreciated!

    Thank you!
    Simon


    Code:
    use "https://raw.githubusercontent.com/JBZ-researcher/csdid_example/main/example1.dta", clear
    
    csdid out, time(year) gvar(time1) notyet
    g sample = 1 if e(sample)

  • #2
    Two problems
    1. csdid assumes data is equally spaced (you have 2011,13,15 and should have 2017 not 18)
    2. Your Gvar should only contain years that are observed in your tvar. Otherwise odd things happen

    Comment


    • #3
      Originally posted by FernandoRios View Post
      Two problems
      1. csdid assumes data is equally spaced (you have 2011,13,15 and should have 2017 not 18)
      2. Your Gvar should only contain years that are observed in your tvar. Otherwise odd things happen
      Many thanks! Fernando.

      Comment

      Working...
      X