Announcement

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

  • Event study

    Hi All, Please, could anyone help me with coding for an event study. The dataex follows below:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(id ill dt_notific crimedate) str7 crime_type float(crime_dummy crime_count crime_dummy_post crime_count_post age)
    1001 0     .     . ""        0 0 0 0 16
    1002 0     . 20980 "Robbery" 1 2 0 0 16
    1002 0     . 21087 "Theft"   1 2 0 0 16
    1003 1 20834 20860 "Theft"   1 1 1 1 17
    1004 0     .     . ""        0 0 0 0 17
    1005 1 20929 20855 "Assault" 1 2 1 1 17
    1005 1 20929 20940 "Robbery" 1 2 1 1 17
    1006 0     .     . ""        0 0 0 0 15
    1007 0     . 21189 "Fraud"   1 1 0 0 15
    1008 1 21094 21063 "Theft"   1 1 0 0 17
    1009 0     .     . ""        0 0 0 0 16
    1010 1 21227 21258 "Drug"    1 1 1 1 15
    1011 0     .     . ""        0 0 0 0 15
    1012 0     .     . ""        0 0 0 0 15
    1013 0     .     . ""        0 0 0 0 16
    1014 1 21411     . ""        0 0 1 1 17
    1015 0     . 21220 "Theft"   1 1 0 0 18
    1016 0     .     . ""        0 0 0 0 16
    1017 1 21498 21519 "Robbery" 1 2 1 2 16
    1017 1 21498 21628 "Fraud"   1 2 1 2 16
    1018 0     .     . ""        0 0 0 0 15
    1019 0     .     . ""        0 0 0 0 15
    1020 0     . 20888 "Theft"   1 2 0 0 16
    1020 0     . 21664 "Assault" 1 2 0 0 16
    1021 1 21613     . ""        0 0 1 1 15
    1022 0     .     . ""        0 0 0 0 18
    1023 0     .     . ""        0 0 0 0 17
    1024 1 21710     . ""        0 0 1 1 18
    1025 0     .     . ""        0 0 0 0 16
    end
    format %td dt_notific
    format %td crimedate
    I want to estimate the causal effect of getting ill (ill - dt_notific for date of notification of the illness) on subsequent crime commitment.
    Some individuals commit crimes before and/or after getting sick.
    My outcomes of interest are:
    1. crime_dummy_post – indicator for committing any crime after dengue, and
    2. crime_count_post – number of crimes after dengue.
    How should I construct an event-study for this in STATA?
    Many thanks in advance!

  • #2
    Originally posted by Juliana Cunha View Post
    How should I construct an event-study for this in STATA?
    If your data snippet is representative, then I don't think that you can.

    You don't have any elapsed time (duration of period under observation) except for those who were charged with a crime after having become ill—you don't have a censoring date in your dataset for those who became ill but were never charged with a crime. And those youths who never became ill never became at risk—you don't have elapsed time at all for them regardless of whether they were charged with a crime.

    Comment


    • #3
      Hi Joseph, thank you for answering. What if the data looks like this?
      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float(id ill dt_notific crimedate) str7 crime_type float(crime_dummy age)
      1001 0     .     . ""        0 16
      1001 0     . 20980 "Robbery" 1 16
      1001 0     .     . ""        0 16
      1001 0     .     . ""        0 16
      1002 0     .     . ""        0 16
      1002 0     . 21087 "Theft"   1 16
      1002 0     .     . ""        0 16
      1003 1 20834     . ""        0 17
      1003 1 20834 20860 "Theft"   1 17
      1003 1 20834     . ""        0 17
      1003 1 20834     . ""        0 17
      1004 0     .     . ""        0 17
      1004 0     . 20929 "Assault" 1 17
      1004 0     .     . ""        0 17
      1005 1 20929     . ""        0 17
      1005 1 20929 20950 "Robbery" 1 17
      1005 1 20929     . ""        0 17
      1006 0     .     . ""        0 15
      1006 0     . 21189 "Fraud"   1 15
      1006 0     .     . ""        0 15
      1007 1 21094     . ""        0 17
      1007 1 21094 21098 "Theft"   1 17
      1007 1 21094     . ""        0 17
      1008 0     .     . ""        0 15
      1008 0     .     . ""        0 15
      1008 0     . 21227 "Drug"    1 15
      1009 0     .     . ""        0 15
      1009 0     .     . ""        0 15
      1010 1 21411     . ""        0 17
      1010 1 21411 21420 "Theft"   1 17
      1010 1 21411     . ""        0 17
      1011 0     .     . ""        0 18
      1011 0     . 21498 "Robbery" 1 18
      1011 0     .     . ""        0 18
      1012 1 21498     . ""        0 16
      1012 1 21498 21628 "Fraud"   1 16
      1012 1 21498     . ""        0 16
      end
      format %td dt_notific
      format %td crimedate

      Comment


      • #4
        Originally posted by Juliana Cunha View Post
        What if the data looks like this?
        I don't see that you've added any substantive data.

        About the best that I can see is for some kind of cross tabulation of the ill and crime_dummy variables. If you want to add age as a covariate, then perhaps fit a logistic regression model. Both would be one observation per person. Neither would "estimate the causal effect of getting ill . . . on subsequent crime commitment."

        Comment


        • #5
          I think that what I meant was how to use csdid - Callaway and Santana method for my data set layout. thank you!

          Comment

          Working...
          X