Announcement

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

  • Getting error "repeated time values within panel r(451);" when I have individual observations nested within the panel identifier

    Hi,

    I'm trying to use sdid with ACS individual-level data to look at a state-level policy change. It should work with repeated cross-section data, but I'm getting the error "repeated time values within panel r(451);", presumably because I have hundreds of individual observations per state-year. I would rather not collapse and lose all the individual-level variation if possible. Is there a way to use commands for panel data with individual-level observations and a higher-level (eg state) panel identifier?

    Thank you!

  • #2
    presumably because I have hundreds of individual observations per state-year.
    Yes, I think you are right. I would probably use a hierarchical linear model to nest individuals within states and states within years here, but there may be other approaches that work better for you depending on your background. Regardless, I think you are going to want to find a way to model the entire nesting structure, since even if you make individual/years your unit of analysis instead of state/years, you still want to calculate clustered standard errors based on membership in states. Hope that makes sense.

    Comment


    • #3
      Thank you for your reply! I want states to be my unit of analysis, as I'm interested in the causal effect of a state-level policy change. When I use other recent did packages like csdid, it accepts individual-level data while using the state as the grouping variable. I got this error with sdid specifically.

      de Chaisemartin & D’Haultfœuille's recent book 'Credible Answers to Hard Questions: Differences-in-Differences for Natural Experiments' seems to indicate that aggregating individual-level data at the county or state level can work as panel data in a DID context: "The group-level panel data may be constructed by aggregating an individual-level repeated cross-section data set at the (g,t) level, defining groups, say, as individuals’ county of birth" (p.15).

      Comment


      • #4
        Looks like csdid and sdid are both user submitted commands, so I'm not sure it's necessarily reasonable to expect them to behave the same way.

        seems to indicate that aggregating individual-level data at the county or state level can work as panel data
        Right, but that suggests you're doing something to aggregate the individual level data, right? Seems like the quote you give suggests something like using collapse to aggregate the data is most appropriate.

        I would expect someone like Jeff Wooldridge, Andrew Musau, George Ford, or Jared Greathouse would be better able to advise than I am. Looks like Daniel Pailanir developed the sdid package. I'm not seeing that he has an account here, but you could reach out to him on github.

        Comment


        • #5
          Looks like csdid and sdid are both user submitted commands, so I'm not sure it's necessarily reasonable to expect them to behave the same way.
          That's fair. I talked to my advisor a few days ago and we had both interpreted the quote about aggregating as not necessarily requiring collapsing (especially given csdid not requiring collapsing, just indicating the grouping variable) but we could be mistaken. Thank you for the suggestions! I reached out on github.

          Comment


          • #6
            if you want state level analysis, collapse to state (using the relevant weights). or else, just get the state level data.

            I don't think you can do this at the individual level.

            Comment


            • #7
              I think JWDID might work with the individual data since it is regression based.

              Comment


              • #8
                Thank you George Ford! I'm looking into jwdid now. I'm looking at maternal employment as an outcome, so being able to keep that individual-level variation in order to account for individual-level characteristics like level of education and number of children seems more useful than collapsing and controlling for those characteristics at the state level.

                Comment


                • #9
                  You may have to code it yourself, but it is not difficult.

                  Comment

                  Working...
                  X