Announcement

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

  • Difference-in-Difference with Fixed Effects

    Hello everyone,

    I've been working on a research project lately and I'm really struggling to obtain anything meaningful. I'm trying to find what the effect of implementing a public bicycle-sharing program in a city is on the theft of privately owned bicycles. I'm using the data from the Office for National Statistics on the bicycle thefts recorded to the police in England and Wales.

    Here's what I tried to do so far. I tried to turn the data into a panel data so I can graph it as Oscar Torres-Reyna from Princeton University has done it here [1]. So I used:
    Code:
    encode PoliceForceArea, gen(AreaNumber)
    list PoliceForceArea AreaNumber in 1/10, sepby(PoliceForceArea)
    list PoliceForceArea AreaNumber in 1/10, nolabel sepby(PoliceForceArea)
    xtset AreaNumber Year
    xi: regress BikeTheft Bikeshare i.AreaNumber
    predict BikeTheftHat
    separate BikeTheft, by(AreaNumber)
    separate BikeTheftHat, by(AreaNumber)
    twoway connected BikeTheftHat1-BikeTheftHat43 Bikeshare
    I was able to follow and recreate the graphs done by Oscar Torres-Reyna from the pdf up until slide 16 "Fixed Effects using least squares dummy variable model (LSDV)". The resulting graph from the following code is ridiculously confusing and ugly. I've also attached the picture of the graph below.
    Code:
    twoway connected BikeTheftHat1-BikeTheftHat43 Bikeshare
    I've also tried regressing it using the following but neither seems to be a good model. Variables get omitted because of collinearity or it's not statistically significant with a t-stat of -1.12
    Code:
    xtreg BikeTheft Bikeshare, fe
    and
    Code:
    areg BikeTheft Bikeshare, absorb(AreaNumber)
    What I'm asking is, how do I show the effect of bicycle share on bicycle theft? Below is the code I got using dataex but shortened) because that's what Statalist FAQ suggested I use to give my question some more background.

    Thank you everyone in advance for any pointers or suggestions.
    Cheers,
    Danny

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str19 PoliceForceArea byte Bikeshare int(BikeTheft Date Year)
    "Derbyshire"       0 1533 19083 2012
    "Derbyshire"       0 1381 18352 2010
    "Leicestershire"   0 2081 17987 2009
    "Leicestershire"   0 2042 19448 2013
    "Lincolnshire"     0 1623 16161 2004
    "Lincolnshire"     0 1604 17256 2007
    "Northamptonshire" 0 1085 18352 2010
    "Northamptonshire" 0 1053 15795 2003
    "Nottinghamshire"  0 2601 16526 2005
    "Nottinghamshire"  0 2468 19083 2012
    "Bedfordshire"     0  978 17987 2009
    "Bedfordshire"     0  966 20178 2015
    "Bedfordshire"     0  881 16526 2005
    "Bedfordshire"     0  860 19813 2014
    "Cambridgeshire"   0 3694 19083 2012
    "Cambridgeshire"   0 3630 19448 2013
    "Essex"            0 2354 17987 2009
    end
    format %tdnn/dd/CCYY Date


    References:
    [1] Oscar Torres-Reyna (2007) Panel Data Analysis Fixed and Random Effects using Stata (v. 4.2) . Princeton University. d.o.i: https://www.princeton.edu/~otorres/Panel101.pdf

    Office for National Statistics (2016) Recorded Crime Data at Police Force Area Level (including pivot table). Office for National Statistics. d.o.i: https://www.ons.gov.uk/peoplepopulat...dingpivottable
Working...
X