Hello guys,
I really appreciate if you can help me with this. This is a time sensitive request. I have different programs in different units of a mental hospital. to reduce violent incidents. Each of row in my data-set is the incident. The programs started in different times. I would like to create a variable that represents the week of the program.
I create a variable where 1 is the incident happend after the program started.
replace prog1=1 if facility==1 & INCIDENT_DATE >= td(14jul2015) & INCIDENT_HOUSE =="2 room left"
But I need to know the week in which the incident occur.
So my program one started on July 14 2015 and the first incident append on 19jan2016. How many weeks after? my second program started on 9nov2015.
Best,
Marvin
I really appreciate if you can help me with this. This is a time sensitive request. I have different programs in different units of a mental hospital. to reduce violent incidents. Each of row in my data-set is the incident. The programs started in different times. I would like to create a variable that represents the week of the program.
I create a variable where 1 is the incident happend after the program started.
replace prog1=1 if facility==1 & INCIDENT_DATE >= td(14jul2015) & INCIDENT_HOUSE =="2 room left"
But I need to know the week in which the incident occur.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str7 UOF_NO int UOF_INCIDENT_DATE str61 INCIDENT_AREA str30 INCIDENT_HOUSINGUNIT long INCIDENT_FACILITY_RC float progGMDC "025" 20472 "Housing Area" "2 UPPER" 1 1 "059" 20496 "Housing Area" "2 UPPER" 1 1 "088" 20518 "Housing Area" "2 UPPER" 1 1 "080" 20512 "Housing Area" "8 UPPER" 1 2 "087" 20517 "Housing Area" "8 UPPER" 1 2 end format %td UOF_INCIDENT_DATE label values INCIDENT_FACILITY_RC INCIDENT_FACILITY_RC label def INCIDENT_FACILITY_RC 1 "GMDC", modify
So my program one started on July 14 2015 and the first incident append on 19jan2016. How many weeks after? my second program started on 9nov2015.
Best,
Marvin
Comment