------------------------------------------------------------------------------- log: J:\Lobby\Agendas_Project\Death_Penalty\book\website\data_log_and_d > o_files\Espy_contract_ex_by_race_by_year.log log type: text opened on: 27 Apr 2007, 17:19:47 . ***************************************************************************** > ***********************************; . * Created by: AEB > ; . * Creation Date: 04/27/07 > ; . * Directory: J:\Lobby\Agendas_Project\Death_Penalty\book\website\data_ > log_and_do_files ; . * Do-file-name: Espy_contract_ex_by_race_by_year.do > ; . * Purpose: calculate execution counts by race and by year > ; . * Data Input: Espy_executions_data.dta > ; . * Log File: Espy_contract_ex_by_race_by_year.log > ; . * Data Output: Espy_contract_ex_by_race_by_year.dta > ; . * NOTES: > ; . ***************************************************************************** > ***********************************; . *Start with raw Espy data file, including all executions since 1608; . use Espy_executions_data.dta; . *RACE CODES; . *1=White; . *2=Black; . *3=Native American; . *4=Asian-Pacific; . *5=Hispanic; . *6=Other/Unknown; . drop if year<1800; (1553 observations deleted) . replace race=6 if race==.; (524 real changes made) . contract race year; . reshape wide _freq, i(year) j(race); (note: j = 1 2 3 4 5 6) Data long -> wide ----------------------------------------------------------------------------- Number of obs. 815 -> 192 Number of variables 3 -> 7 j variable (6 values) race -> (dropped) xij variables: _freq -> _freq1 _freq2 ... _freq6 ----------------------------------------------------------------------------- . rename _freq1 White; . rename _freq2 Black; . rename _freq3 NativeAmerican; . rename _freq4 AsianPacific; . rename _freq5 Hispanic; . rename _freq6 Other; . egen OtherUnknown = rsum(NativeAmerican AsianPacific Hispanic Other); . save Espy_contract_ex_by_race_by_year.dta, replace; (note: file Espy_contract_ex_by_race_by_year.dta not found) file Espy_contract_ex_by_race_by_year.dta saved . end of do-file . browse . exit, clear