I hope you are doing well. I wanted to create two dataset from my raw data 1) district day panel 2) district month panel with the following variables:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str19 district int sourcedateeventreported byte month int(year numberkilled) double(lat AS) str64 event "Karachi" 10590 12 1988 0 24.8614622 67.0099388 "assassination" "Faisalabad" 10590 12 1988 1 31.2703491 73.1843746 "assassination" "Karachi" 10592 12 1988 1 24.8105213 67.0287732 "terrorism" "Karachi" 10592 12 1988 1 24.8594524 67.0165372 "assassination" "Lahore" 10593 12 1989 1 31.5695206 74.2956875 "assassination" "Karachi" 10593 12 1989 0 24.9002887 67.0136939 "terrorism" "Karachi" 10593 12 1989 0 24.9002887 67.0136939 "terrorism" "Karachi" 10594 12 1989 0 24.8247963 67.0315657 "terrorism" "Lahore" 10594 12 1989 1 31.5546061 74.3571581 "assassination" "Jamshoro" 10595 12 1989 1 26.4234157 67.8629399 "riot" end format %td sourcedateeventreported
Code:
format sourcedateeventreported %td
Code:
gen date = date(sourcedateeventreported, "DMY")
Your help to convert the above raw data with district-day panel data like this would be really appreciated:
District Date numberkilled
A 10Feb88 5
A 11Feb88 0
B 9Feb99 1
B 6Feb99 2
Thank you VERY much in advance look forward to your help with this data.
Cheers,
Roger
0 Response to Creating District Month Panel
Post a Comment