I am trying to create some graphs using data from a csv file that has all the information about each emergency call's date, response time, call type, priority etc.
1. we want to create a graph for call volume by year/month etc. However, we are struggling to visualize how the call volume variable should be created, since it's basically counting horizontal data entry (1 call = 1 entry) besides the ones with police on scene.
2. we are trying to create a graph with month on the x axis, and each month having 4 bars each representing a different call time per that month (morning, afternoon, evening, night) so it will be a very busy graph. The y axis will be call volume of each call time. However, I tried both categorical and dummy variables and none seem to be working. How should we approach this?
**7.Create dummy variables to indicate time of day call was received
gen nightcall = 1 if callreceivedtime<= 60000
//(624840 missing values generated)
replace night = 0 if night==.
//(624840 missing values generated)
gen morningcall = 1 if callreceivedtime<= 120000 & callreceivedtime > 60000
//(540971 missing values generated)
replace morning = 0 if morning==.
//(540971 real changes made)
gen afternooncall = 2 if callreceivedtime<= 180000 & callreceivedtime > 120000
//(482467 missing values generated)
replace afternoon = 0 if afternoon==.
//(482467 real changes made)
gen eveningcall = 1 if callreceivedtime> 180000
//(512409 missing values generated)
replace evening = 0 if evening==.
//(512409 real changes made)
--------------
**8.Create categorical variable to indicate time of day call was received
gen calltime = night if callreceivedtime<= 60000
//(398172 missing values generated)
replace calltime = morning if callreceivedtime<= 120000 & callreceivedtime > 60000
//(111392 real changes made)
replace calltime = afternoon if callreceivedtime<= 180000 & callreceivedtime > 120000
//(149411 real changes made)
replace calltime = night if callreceivedtime> 180000
//(137369 real changes made)
3. When trying to replicate
graph bar (priority) totalresponsetime, over(month)
for the 4 individual response times, some of our graphs turn out to have negative values. Such as
graph bar (mean) dispatchtoenroute, over(month)
which produced some bars on both sides of the x axis. Logically, shouldn't that be impossible?
1. we want to create a graph for call volume by year/month etc. However, we are struggling to visualize how the call volume variable should be created, since it's basically counting horizontal data entry (1 call = 1 entry) besides the ones with police on scene.
2. we are trying to create a graph with month on the x axis, and each month having 4 bars each representing a different call time per that month (morning, afternoon, evening, night) so it will be a very busy graph. The y axis will be call volume of each call time. However, I tried both categorical and dummy variables and none seem to be working. How should we approach this?
**7.Create dummy variables to indicate time of day call was received
gen nightcall = 1 if callreceivedtime<= 60000
//(624840 missing values generated)
replace night = 0 if night==.
//(624840 missing values generated)
gen morningcall = 1 if callreceivedtime<= 120000 & callreceivedtime > 60000
//(540971 missing values generated)
replace morning = 0 if morning==.
//(540971 real changes made)
gen afternooncall = 2 if callreceivedtime<= 180000 & callreceivedtime > 120000
//(482467 missing values generated)
replace afternoon = 0 if afternoon==.
//(482467 real changes made)
gen eveningcall = 1 if callreceivedtime> 180000
//(512409 missing values generated)
replace evening = 0 if evening==.
//(512409 real changes made)
--------------
**8.Create categorical variable to indicate time of day call was received
gen calltime = night if callreceivedtime<= 60000
//(398172 missing values generated)
replace calltime = morning if callreceivedtime<= 120000 & callreceivedtime > 60000
//(111392 real changes made)
replace calltime = afternoon if callreceivedtime<= 180000 & callreceivedtime > 120000
//(149411 real changes made)
replace calltime = night if callreceivedtime> 180000
//(137369 real changes made)
3. When trying to replicate
graph bar (priority) totalresponsetime, over(month)
for the 4 individual response times, some of our graphs turn out to have negative values. Such as
graph bar (mean) dispatchtoenroute, over(month)
which produced some bars on both sides of the x axis. Logically, shouldn't that be impossible?
Comment