* Time of day of personal robberies by type of location. GET FILE='Directory\Path\Incident 1999.sav'. COMPUTE pers_rob = 0. IF (rob ge 1 and indivl ge 1)pers_rob = 1. FREQ pers_rob. SELECT IF (pers_rob = 1). SAVE OUTFILE = 'Directory\Path\Personal Robberies 1999.sav'. * TABLE 2 Part 1. Average number of personal robberies reported per day, by month. * The unit of count for Table 2 will be the incident. VALUE LABELS inc_mo 1 'January' 2 'February' 3 'March' 4 'April' 5 'May' 6 'June' 7 'July' 8 'August' 9 'September' 10 'October' 11 'November' 12 'December'. SORT CASES BY inc_mo (A) inc_dy. AGGREGATE /OUTFILE = 'Directory\Path\inc_mo agg.sav' /BREAK=inc_mo /inc_dy = LAST(inc_dy) /rob = SUM(rob). GET FILE = 'Directory\Path\inc_mo agg.sav'. COMPUTE avg_dy = rob/inc_dy. FORMATS avg_dy (f8.0). TABLES /FORMAT BLANK MISSING('.') /OBSERVATION= avg_dy /GBASE=CASES /TABLE=inc_mo BY avg_dy /STATISTICS mean( avg_dy 'Daily average') /TITLE 'Average number of personal robberies' 'Reported per day by month (US 1999)'. * Part 2. Time of Day of personal robberies by Type of Location. * The unit of count for Table 2 will be the incident. GET FILE = 'Directory\Path\Personal Robberies 1999.sav'. * Define RPTDATE. DO IF ( rptdate = ' '). RECODE inc_hr (0 thru 3 = 1)(4 thru 7 = 2)(8 thru 11 = 3) (12 thru 15 = 4)(16 thru 19 = 5)(20 thru 23 = 6)into time. END IF. VALUE LABELS time 1 'Mid - 3:59 a.m.' 2 '4:00 a.m. - 7:59 a.m.' 3 '8:00 a.m. - 11:59 a.m.' 4 'Noon - 3:59 p.m.' 5 '4:00 p.m. - 7:59 p.m.' 6 '8:00 p.m. - 11:59 p.m.'. FREQ time. RECODE inc_loc (13 = 1)(20 = 2)(18 = 3)(7,8,9,12,17,24 = 4) (5,11 = 5)(14 = 6)(3 = 7)(2 = 8)(23 = 9)(else = 10)into location. VARIABLE LABELS location 'Type of location'/ time 'Time of day'. VALUE LABELS location 1 'Roadway' 2 'Residence' 3 'Parking facility' 4 'Store' 5 'Office building' 6 'Hotel, motel' 7 'Bar, night club' 8 'Financial institution' 9 'Gas station' 10 'Other, unknown'. FREQ location. TEMPORARY. VARIABLE LABELS indivl ' '. TABLES /FORMAT BLANK MISSING('.') /OBSERVATION= indivl /GBASE=CASES /FTOTAL= $t000002 "Total" /TABLE=location + $t000002 BY indivl + time /STATISTICS validn( indivl( COMMA5.0 ) 'Number of cases') spct( indivl( PCT5.0 ) 'Percent':time ) cpct( time( PCT5.0 ) '':location ) /TITLE 'Time of day of personal robberies by type of location'.