version 7.0 *** Written and run 7/31/04 *** PANELIZE JAIL DATA * data cleaning and origins are in SPSS: see "panelizing jails" syntax * be sure when converting data to stata to set id variable transfer to * "double" in stat-transfer, or else the necessary precision is lost use "H:\DATA\BJS\AllCensuses\jail_facil_for_transfer.dta", clear * change format for id so you can see the whole number in the browser: format jurid %16.0f format id99 %16.0f iis(id99) rename state t_st_93 ren facility tfacility_93 ren jurid tjurid_93 #delimit ; reshape long tfacility_ tst_ tjurid_ s_ gov_ name_ add2_ add3_ add4_ add_5 count_ adm_ adp_ max_ ost_ ost2_ popcp_ ord_o_ ordsm_ order_ crowd_ med_ adseg_ staff_ food_ educ_ disc_ rec_ visit_ fire_ coun_ class_ libr_ griev_ relig_ prot_ total_ oth_ oth2_ comp_ state_ fac_, i(id99) j(year 83 88 93) ; #delimit cr replace year = 1993 if year == 93 replace year = 1988 if year == 88 replace year = 1983 if year ==83 *** PUT FACILITY AND STATE IN FRONT order id99 tjurid_ fac_ state_ *** POPULATE COUNTY AND CITY VARIABLES gsort +id99 -year replace name_ = name_[_n-1] if id99 == id99[_n-1] replace add3_ = add3_[_n-1] if id99 == id99[_n-1] save "H:\DATA\BJS\AllCensuses\jail_facil_panel_initial.dta", replace *** A BUNCH OF VARIABLES ARE IN A WIERD PLACE: MOVE THEM IN SPSS