Announcement

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

  • How to generate dummies for the180 days prior to a event?

    I have 2000 + events and I would like to know a simple way to generate dummies to identify the 180 days prior to a event (i.e. if a event occurred in Jun 1st 1994, the dummies identify the prior 180 days to this date). I know the general idea is generate 180 dummies for each event and then loop to 2000+ events. How do I write code to generate 180 dummies? How do I loop to all events? Thanks!

  • #2
    Do you really want to generate 180 different dummy variables, or just a single dummy variable to indicate the observations 180 days prior to an event? And do you want to generate separate dummy variables for each event, or a single dummy variable (or set of dummy variables) that applies to all events? Without this information, together with some information about how your data are structured, it is not possible to answer your question. If you are uncertain about these follow-up questions, you might want to tell us a little about what you are trying to do (e.g., the nature of your data, the model you are trying to fit, etc.).

    Comment

    Working...
    X