*************************************************************************** * DATA LAYOUT FOR WEST VIRGINIA NIBRS DATA. ***************************************************************************. *************************************************************************** * Reads in the Group A incident report data from a text delimited flat file. * FILE TYPE MIXED defines each record as a case. As a result the unit * of analysis is determined by the level (record type) you wish to select. * The SPSS data file resembles the structure of the original data file. ****************************************************************************. file type mixed file = 'n:\new flat files as of 7-07\GroupA2005.txt' record = level 5 . Record type 1. data list / rdw 1-4 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) ainyear 38-41 ainmon 42-43 ainday 44-45 ardi 46-46 (A) ainhour 47-48 aclear 49-49 (A) acldatyr 50-53 acldatmo 54-55 acldatda 56-57 aoff1 58-60 (a) aoff2 61-63 (a) aoff3 64-66 (a) aoff4 67-69 (a) aoff5 70-72 (a) aoff6 73-75 (a) aoff7 76-78 (a) aoff8 79-81 (a) aoff9 82-84 (a) aoff10 85-87 (a) aagid 88-92 (a) aagid2 93-96 (A) alight 97-97 aweather 98-98 antry1 99-100 antry2 101-102 axit1 103-104 axit2 105-106 asecur1 107-108 asecur2 109-110 atool1 111-112 (A) atool2 113-114 (A) avidnce 115-115 (A) avehicle 116-116 (a) avehmake 117-122 (A) avehmodl 123-126 (A) avehyear 127-128 akeys 129-129 (A) avehlock 130-130 (A). Record type 2. data list / rdw 1-4 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) bucrcode 38-40(A) battempt 41-41(A) bused1 42-42(A) bused2 43-43(A) bused3 44-44(A) bloctype 45-46 bpremise 47-48(A) bntry 49-49(A) btype1 50-50(A) btype2 51-51(A) btype3 52-52(A) bweap1 53-54 bauto1 55-55(A) bweap2 56-57 bauto2 58-58(A) bweap3 59-60 bauto3 61-61(A) bhate 62-63. Record type 3. data list / rdw 1-4 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) ctyploss 38-38 (a) cprodes1 39-40 (a) cproval1 41-49 (a) crecyr1 50-53 crecmo1 54-55 crecday1 56-57 cprodes2 58-59 (a) cproval2 60-68 (a) crecyr2 69-72 crecmo2 73-74 crecday2 75-76 cprodes3 77-78 (a) cproval3 79-87 (a) crecyr3 88-91 crecmo3 92-93 crecday3 94-95 cprodes4 96-97 (a) cproval4 98-106 (a) crecyr4 107-110 crecmo4 111-112 crecday4 113-114 cprodes5 115-116 (a) cproval5 117-125 (a) crecyr5 126-129 crecmo5 130-131 crecday5 132-133 cprodes6 134-135 (a) cproval6 136-144 (a) crecyr6 145-148 crecmo6 149-150 crecday6 151-152 cprodes7 153-154 (a) cproval7 155-163(a) crecyr7 164-167 crecmo7 168-169 crecday7 170-171 cprodes8 172-173 (a) cproval8 174-182 (a) crecyr8 183-186 crecmo8 187-188 crecday8 189-190 cprodes9 191-192 (a) cproval9 193-201 (a) crecyr9 202-205 crecmo9 206-207 crecday9 208-209 cprdes10 210-211 (a) cprval10 212-220 (a) crecyr10 221-224 crecmo10 225-226 crecdy10 227-228 cstolveh 229-230 cstvehre 231-232 cdrgtpe1 233 (a) cdrgqty1 234-242 cdrgfra1 243-245 cdrgmea1 246-247 (a) cdrgtpe2 248 (a) cdrgqty2 249-257 cdrgfra2 258-260 cdrgmea2 261-262 (a) cdrgtpe3 263 (a) cdrgqty3 264-272 cdrgfra3 273-275 cdrgmea3 276-277 (a) coff1 278-280 (a) coff2 281-283 (a) coff3 284-286 (a) coff4 287-289 (a) coff5 290-292 (a) coff6 293-295 (a) coff7 296-298 (a) coff8 299-301 (a) coff9 302-304 (a) coff10 305-307(a). Record type 4. data list / rdw 1-4 level 5-5 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) dvctmno 38-40 doff1 41-43(a) doff2 44-46(a) doff3 47-49(a) doff4 50-52(a) doff5 53-55(a) doff6 56-58(a) doff7 59-61(a) doff8 62-64 (a) doff9 65-67(a) doff10 68-70(a) dvcttype 71 (a) dage 72-75 (a) dsex 76 (a) drace 77 (a) dthnic 78 (a) dResidnt 79 (a) dAg_cir1 80-81 dAg_cir2 82-83 dHom_cir 84(a) dIn_typ1 85 (a) dIn_typ2 86 (a) dIn_typ3 87 (a) dIn_typ4 88 (a) dIn_typ5 89 (a) dOf_Rel1 90-91 (a) dRelate1 92-93 (a) dOf_Rel2 94-95 (a) dRelate2 96-97 (a) dOf_Rel3 98-99 (a) dRelate3 100-101 (a) dOf_Rel4 102-103 (a) dRelate4 104-105 (a) dOf_Rel5 106-107 (a) dRelate5 108-109 (a) dOf_Rel6 110-111 (a) dRelate6 112-113 (a) dOf_Rel7 114-115 (a) dRelate7 116-117 (a) dOf_Rel8 118-119 (a) dRelate8 120-121 (a) dOf_Rel9 122-123 (a) dRelate9 124-125 (a) dOf_Re10 126-127 (a) dRelat10 128-129 (a) dRestime 130-133 dActaken 134 (a) dComplan 135 (a) dcall 136 (a) dTimes 137-138 (a) dPOfile 139 (a) dPoviol 140 (a) dPofile2 141 (a) dTime 142-146 (a) dLEOKA1 147 (a) dLEOKA2 148-149 dLEOKA3 150. Record type 5. data list / rdw 1-4 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) eoffnumb 38-39 eage 40-43 (a) esex 44 (a) erace 45 (a) eheight 46-48 (a) eeyes 49-51 (a) ehair 52-54 (a) ehdhair 55 efhair 57-58 (a) eglasses 61 eoffhand 62 eskin 63-64 (a) eskin2 65-66 (a) ebuild 67 eteeth1 68-69 eteeth2 70-71 etattoo1 72-73 (a) etattoo2 74-75 (a) etatloc1 76-77 etatloc2 78-79 escar1 80-81 escar2 82-83 espeech1 84-85 espeech2 86-87 eid1 88-89 eid2 90-91. Record type 6. data list / rdw 1-4 action 6-6 (A) month 7-8 year 9-12 city 13-16 ori 17-25 (A) incnumb 26-37(A) arrnum2 38-39 arrnum1 40-51 (a) farryr 52-55 farrmo 56-57 farrday 58-59 farrtype 60 (a) farrsegm 61 (a) foffcode 62-64 (a) fararm1 65-66 fararm1a 67 (a) fararm2 68-69 fararm2a 70 (a) fage 71-74 (a) fsex 75 (a) frace 76 (a) fethn 77 (a) fresid 78 (a) fdisp 79 (a) fclear 80 (a) foff1 81-83 (a) foff2 84-86 (a) foff3 87-89 (a) foff4 90-92 (a) foff5 93-95 (a) foff6 96-98 (a) foff7 99-101(a) foff8 102-104 (a) foff9 105-107 (a) foff10 108-110 (a) fheight 111-113 (a) feyes 114-116 (a) fhair 117-119 (a) fhdhair1 120 fhdhair2 121 ffhair1 122-123 ffhair2 124-125 fglass 126 fhand 127 fskin1 128-129 (A) fskin2 130-131 (a) fbuild 132 fteeth1 133-134 fteeth2 135-136 ftattoo1 137-138 ftattoo2 139-140 ftatloc1 141-142 ftatloc2 143-144 fscar1 145-146 fscar2 147-148 fspch1 149-150 fspch2 151-152 fid1 153-154 fid2 155-156. end file type. SORT CASES BY ACTION ORI incnumb level. COMPUTE INC_CNT = 1. if (ori = lag(ori,1) and incnumb = lag(incnumb,1)) INC_CNT = LAG(INC_CNT) + 1. freq INC_CNT. DO IF (level = 4). COMPUTE VIC_CNT = 1. ELSE IF (level = 5). COMPUTE OFF_CNT = 1. ELSE IF (level = 6). COMPUTE ARR_CNT = 1. END IF. FREQ VIC_CNT to ARR_CNT. ************************************************************************* * Prior to aggregating the data we need to define the most serious offense * in the incident. We will use the victim offense information to define * the most serious offense. However, before we can define the most serious * offense we need to recode voff1 to voff10 to numeric variables. This serves * two purposes. First it reduces the overall size of the file. String variables * require a minimum of 8 bytes of disk space. If the string is longer than * eight characters the variable consumes another eight bytes. However, numeric * variables can be compressed down to one byte regradless of the size of * the variable. To convert victim offenses to numeric I have created a * separate syntax file so the conversion can be used for any offense files. *************************************************************************. INCLUDE 'n:\syntax files\WVIBRSmsvoff.sps'. if (sysmis(ainyear))ainyear = lag(ainyear,1). save outfile = 'n:\new flat files as of 7-07\2005data.sav'/compressed.