#delimit; set more off; cap log close; graph set window fontface garamond; set autotabgraphs on; clear; /* Place Folder Pathway Here */ cd "L:\Users\mschlan\Data\Pop_and_Filings\"; *cd "L:\users\bridgesg\Margo\Irvine"; local excel_file "output_files\Irvine_Tables.xlsx"; /******************************************************************************* NOTE: I pull the AO Data (CivTerm_1970-2012p.dta) needed for Tables 3, 4, 5 and 6 from a folder on my local hard drive so that the program runs faster. Please change the pathway below to your folder that contains CivTerm_1970-2012p.dta dataset. *******************************************************************************/ *local CivTermDataset "C:\Users\bridgesg\Desktop\Temp\CivTerm_1970-2012p.dta"; local CivTermDataset "C:\Users\mschlan\Documents\AO\CivTerm_1970-2012p.dta"; /******************************************************************************* TABLE 1: PRISON AND JAIL POPULATION AND PRISONER CIVIL RIGHTS FILINGS IN FEDERAL DISTRICT COURT, FISCAL YEARS 1970-2012 *******************************************************************************/ use "output_files\population_and_filings_1970-2012.dta", clear; keep if state == -1; sort year; keep year incar prison fed jail filings statefi fedfi FiRate; order year incar prison fed jail filings statefi fedfi FiRate; export excel using "`excel_file'", firstrow(varlabels) sheet("t1") sheetreplace; /******************************************************************************* TABLE 2: CHANGE IN PRISONER FILINGS IN U.S. DISTRICT COURT AND FILING RATES BY STATE, FY 1995-2012 *******************************************************************************/ use "output_files\population_and_filings_1970-2012.dta", clear; drop if state == 52; drop if year < 1995; keep state year incar prison jail fed filings statefi fedfi nonfedFiRate fedFiRate FiRate; foreach var of varlist *FiRate {; bysort state: gen `var'_95 = `var' if year == 1995; replace `var'_95 = `var'_95[_n-1] if `var'_95 == . & state == state[_n-1]; gen d`var' = (`var'_95 - `var'); gen d2`var' = ( d`var'/`var'_95); }; order state year incar prison jail fed filings statefi fedfi FiRate nonfedFiRate fedFiRate FiRate_95 nonfedFiRate_95 fedFiRate_95 dFiRate d2FiRate dnonfedFiRate d2nonfedFiRate dfedFiRate d2fedFiRate; *export excel state-fedFiRate_95 using "`excel_file'", sheet("Pop and Filings") firstrow(var) sheetreplace; drop nonfedFiRate_95 fedFiRate_95 FiRate_95; reshape wide incar prison jail fed filings statefi fedfi *FiRate, i(state) j(year); keep state incar1995-fedFiRate1995 incar2012-fedFiRate2012 d*; order state incar1995-fedFiRate1995 incar2012-fedFiRate2012 dFiRate* d2FiRate* dnonfedFiRate* d2nonfedFiRate* dfedFiRate* d2fedFiRate*; sort state; export excel using "`excel_file'", sheet("t2_analysis") firstrow(var) sheetreplace; /* For table 2 itself /* Drop DC; it's too volatile to be appropriately included */ drop if state == 9; keep state incar1995 filings1995 FiRate1995 incar2012 filings2012 FiRate2012 dFiRate2012 d2FiRate2012; /*export excel using "`excel_file'", sheet("t2") firstrow(var) sheetreplace; Not sure why the above doesn't work. But fix this later*/ /* It would be nice to actually generate the ranks, for FiRate1995 and FiRate2012 and also the difference in ranks, and to format the table more nicely. But either the U.S. has to be pulled from the table, and then added back in or something more complicated has to happen so I didn't do this yet. Once done, sort the table with U.S. first, and then by rank1995 */ */ /******************************************************************************* FIGURE C: PERCENT DECLINE IN PRISONER FILINGS IN U.S. DISTRICT COURT, FY 1995-2012, BY STATE. *******************************************************************************/ /* removing District of Columbia and U.S. Totals from histogram */ histogram d2FiRate2012 if state != 9 & state != -1, bin(9) frequency addlabel lcolor(gs6) lw(mediumthin) fcolor(gs13) name(figC_bw, replace) xtitle("Percent Decline Within State", margin(top)) xlabel(0 "0%" .1 "10%" .2 "20%" .3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%") ytitle("Number of States") ylabel(0(5)10,angle(0)) /* Plot and Graph Region Settings */ graphregion(lcolor(white) color(white) lwidth(thick)) plotregion(lcolor(white) color(white) style(none) lwidth(thick) margin(1=0)); graph export "output_files/Figure_C_bw.emf", replace; /******************************************************************************* FIGURE D: DECLINE IN PRISONER FILING RATE IN U.S. DISTRICT COURT, FY 1995-2012, SIX STATES WITH LARGEST DECLINES. *******************************************************************************/ keep state dFiRate*; reshape long dFiRate, i(state) j(year); /******************************************************************************* The graph is of dFiRate. BUT, I want to reverse the valence -- so that the shape of the curve is intuitively clear. That is, the variable should be exactly what it is, but add a minus sign. *******************************************************************************/ gen dFiRate_inv = dFiRate*-1; /* removing first data point */ drop if year == 1995; local settings1 "lpattern(solid) lcolor(black) lwidth(thin) msize(medium) mlwidth(mediumthin) mcolor(black)"; local settings2 "lpattern(shortdash) lcolor(black) lwidth(medium) msize(medium) mlwidth(thin) mlcolor(black)"; /* Figure D : Top 6 and US total. */ graph twoway /* US total */ (connected dFiRate_inv year if state == -1, lw(medthick) lcolor(black) mcolor(black) m(+)) /* Virginia (47) */(connected dFiRate_inv year if state == 47, m(O) `settings2' mfc(gs4)) /* Nebraska (28) */(connected dFiRate_inv year if state == 28, m(s) `settings2' mfc(gs8)) /* Arkansas (4) */ (connected dFiRate_inv year if state == 4 , m(d) `settings2' mfc(gs12)) /* Missouri (26) */(connected dFiRate_inv year if state == 26, m(Oh) `settings1' mlc(gs3)) /* Miss. (25) */(connected dFiRate_inv year if state == 25, m(sh) `settings1' mlc(gs6)) /* Iowa (16) */ (connected dFiRate_inv year if state == 16, m(dh) `settings1' mlc(gs9)), /* X-Axis Settings */ xtitle("Fiscal Year of Filing", margin(top)) xlab(1996(2)2012, angle(0) labsize(small)) xmtick(1996(1)2011) /* Y-Axis Settings */ ytitle("Change from 1995 in Filings per 1000 Prisoners") ysca(r(-100 20)) ylab(-100(20)20, labsize(small) angle(0)) /* Legend Options */ legend(cols(1) symx(*.3) pos(3) size(small) region(margin(vsmall)) hole(2) order(1 "U.S. Total" 2 "Virginia" 5 "Missouri" 6 "Mississippi" 3 "Nebraska" 4 "Arkansas" 7 "Iowa")) /* Plot and Graph Region Settings */ plotregion(color(gs16) margin(b=0)) graphregion(color(gs16) margin(0)) name(figD_bw, replace); graph export "output_files/Figure_D_bw.emf", replace; /******************************************************************************* FIGURE E: DECLINE IN PRISONER FILING RATE IN U.S. DISTRICT COURT, FY 1995-2012, SIX STATES WITH SMALLEST DECLINES. *******************************************************************************/ graph twoway /*US total */ (connected dFiRate_inv year if state == -1, lw(medthick) lcolor(black) mcolor(black) m(+)) /*New Jersey (31)*/ (connected dFiRate_inv year if state == 31, m(O) `settings2' mfc(gs4)) /*Illinois (14)*/ (connected dFiRate_inv year if state == 14, m(s) `settings2' mfc(gs8)) /*Mass. (22)*/ (connected dFiRate_inv year if state == 22, m(d) `settings1' mlc(gs12)) /*N. Dakota (35)*/ (connected dFiRate_inv year if state == 35, m(Oh) `settings2' mfc(gs3)) /*California (5)*/ (connected dFiRate_inv year if state == 5, m(sh) `settings1' mlc(gs6)) /*New York (33)*/ (connected dFiRate_inv year if state == 33, m(dh) `settings1' mlc(gs4)), /* X-Axis Settings */ xtitle("Fiscal Year of Filing", margin(top)) xlab(1996(2)2012, angle(0) labsize(small)) xmtick(1996(1)2011) /* Y-Axis Settings */ ytitle("Change from 1995 in Filings per 1000 Prisoners") ysca(r(-16 6)) ylab(-15(5)5, labsize(small) angle(0)) /* Legend Options */ legend(cols(1) symx(*.3) pos(3) size(small) region(margin(vsmall)) hole(7) order(7 "New York" 6 "California" 5 "North Dakota" 4 "Massachusetts" 3 "Illinois" 2 "New Jersey" 1 "U.S. Total" )) /* Plot and Graph Region Settings */ plotregion(color(gs16) margin(b=0)) graphregion(color(gs16) margin(0)) ysize(3) name(figE_bw, replace); graph export "output_files/Figure_E_bw.emf", replace; /******************************************************************************* TABLE 3: OUTCOMES IN PRISONER CIVIL RIGHTS CASES IN FEDERAL DISTRICT COURT, FY 1995-2012. TABLE 4: OUTCOMES IN FEDERAL DISTRICT COURT CASES BY CASE TYPE, FY 2012. *******************************************************************************/ use "`CivTermDataset'", clear; preserve; gen c1 = 1; collapse (sum) c1 if fyfiling >= 1988 & fyfiling <= 2012 & source2 ==0, fast by(fyfiling nossum); rename fyfiling fyear; tempfile c1; save `c1'; restore; keep if fyterm >= 1988 & fyterm <= 2012; /* Terminated */ gen c2 = 1; /* Judgment Disps */ gen c3 = (outsum != 0); /* Pretrial Res for defendent */ gen c4 = (outsum == 1); /* Pretrial Res for plaintiff */ gen c5 = (outsum == 6); /* Settlements */ gen c6 = (outsum == 3); /* Voluntary dismissals */ gen c7 = (outsum == 2); /* Trials */ gen c8 = (outsum == 4); /* Plaintiffs' trial victories */ gen c9 = (trialout == 2); /* Setts 'before issue is joined' */ gen c10 = (proc_sum == 1 & (outsum == 3 | outsum == 2)); /* Setts 'after issue joined' */ gen c11 = (proc_sum == 2 & (outsum == 3 | outsum == 2)); /* Total plaintiffs' successes */ gen c12 = (trialout == 2 | outsum == 2 | outsum == 3 | outsum == 6); collapse (sum) c2-c12, fast by(fyterm nossum); rename fyterm fyear; merge m:1 fyear nossum using `c1', nogen; gen c3_perT = c3/c2; gen c4_perJ = c4/c3; gen c5_perJ = c5/c3; gen c6_perJ = c6/c3; gen c7_perJ = c7/c3; gen c8_perJ = c8/c3; gen c9_perTr = c9/c8; gen c10_perSV = c10/(c6 + c7); gen c11_perSV = c11/(c6 + c7); gen c12_perJ = c12/c3; label var c1 "Filings"; label var c2 "Terminations"; label var c3_perT "Judgment Disps (as % of terminations)"; label var c4_perJ "Pretrial Res for defendent (as % of Judgments)"; label var c5_perJ "Pretrial Res for plaintiff (as % of Judgments)"; label var c6_perJ "Settlements (as % of Judgments)"; label var c7_perJ "Voluntary dismissals (as % of Judgments)"; label var c8_perJ "Trials (as % of Judgments)"; label var c9_perTr "Plaintiffs' trial victories (as % of trials)"; label var c10_perSV "Setts 'before issue is joined' (as % of settlements/ vol. dismissals)"; label var c11_perSV "Setts 'after issue joined' (as % of settlements/ vol. dismissals)"; label var c12_perJ "Total plaintiffs' successes (as % of Judgments)"; /* table 3 */ export excel fyear nossum c1 c2 *_per* using "`excel_file'" if nossum == 6, firstrow(varl) sheet("t3") sheetreplace; /* table 4 */ sort fyear c12_perJ; foreach i of numlist 1/12 {; sum c`i' if fyear == 2012; local c`i'_all = `r(sum)'; }; local c3_perT_all = `c3_all'/`c2_all'; local c4_perJ_all = `c4_all'/`c3_all'; local c5_perJ_all = `c5_all'/`c3_all'; local c6_perJ_all = `c6_all'/`c3_all'; local c7_perJ_all = `c7_all'/`c3_all'; local c8_perJ_all = `c8_all'/`c3_all'; local c9_perTr_all = `c9_all'/`c8_all'; local c10_perSV_all = `c10_all'/(`c6_all' + `c7_all'); local c11_perSV_all = `c11_all'/(`c6_all' + `c7_all'); local c12_perJ_all = `c12_all'/`c3_all'; export excel fyear nossum c1 c2 *_per* using "`excel_file'" if fyear==2012, firstrow(varl) sheet("t4") sheetreplace; putexcel B15=("All") C15=(`c1_all') D15=(`c2_all') E15=(`c3_perT_all') F15=(`c4_perJ_all') G15=(`c5_perJ_all') H15=(`c6_perJ_all') I15=(`c7_perJ_all') J15=(`c8_perJ_all') K15=(`c9_perTr_all') L15=(`c10_perSV_all') M15=(`c11_perSV_all') N15=(`c12_perJ_all') using "`excel_file'", sheet("t4") modify; /* table 4 analysis */ keep fyear nossum c1 c2 *_per*; order fyear nossum c1 c2 *_per*; rename c* c*_nossum_; reshape wide c* , i(fyear) j(nossum); export excel using "`excel_file'", firstrow(var) sheet("t4_analysis") sheetreplace; putexcel A28=("Column Definitions") A29=("c1") B29=("Filings") A30=("c2") B30=("Terminaions") A31=("c3_perT") B31=("Judegemnt Disps (as % of terminations)") A32=("c4_perJ") B32=("Pretrial Res for defendent (as % of Judgments)") A33=("c5_perJ") B33=("Pretrial Res for plaintiff (as % of Judgments)") A34=("c6_perJ") B34=("Settlements (as % of Judgments)") A35=("c7_perJ") B35=("Voluntary dismissals (as % of Judgments)") A36=("c8_perJ") B36=("Trials (as % of Judgments)") A37=("c9_perTr") B37=("Plaintiffs' trial victories (as % of trials)") A38=("c10_perSV") B38=("Setts 'before issue is joined' (as % of settlements/ vol. dismissals)") A39=("c11_perSV") B39=("Setts 'after issue joined' (as % of settlements/ vol. dismissals)") A40=("c12_perJ") B40=("Total plaintiffs' successes (as % of Judgments)") using "`excel_file'", sheet("t4_analysis") modify; /******************************************************************************* TABLE 5: DAYS TO DISPOSITION: DISTRICT COURT CASES BY FISCAL YEAR OF FILING 25th, 50th, and 75th percentiles by fyfiling *******************************************************************************/ use "`CivTermDataset'", clear; gen tapeday = mdy(9,30,2012); gen days = termdate-filedate; replace days = tapeday - filedate if pending == 1; drop if fyfiling < 1970; estimates drop _all; qui: estpost tabstat days if nos == 550 | nos == 555, nototal statistics(p25 p50 p75) by(fyfiling); est store A; qui: estpost tabstat days if nos == 440, nototal statistics(p25 p50 p75) by(fyfiling); est store B; qui: estpost tabstat days if nos != 550 & nos != 555, nototal statistics(p25 p50 p75) by(fyfiling); est store C; esttab A B C using "output_files\Table 5 - Percentiles by fyfiling.csv", cells("p25 p50 p75") begin("") end("") delimiter(",") label title("25th, 50th, and 75th percentiles by fyfiling") mtitle("NOS == 550 | NOS 555" "NOS == 440" "NOS != 550 & != 555") collabels("25%" "50th" "75%") noobs nonote nonumber replace; /******************************************************************************* TABLE 6: PRO SE LITIGATION IN U.S. DISTRICT COURTS, CASES TERMINATED SELECTED FISCAL YEARS *******************************************************************************/ use "`CivTermDataset'", clear; keep if fyterm >= 1996 & fyterm <= 2012; /* including missing cases in totals and percentages */ replace prose_pl = 0 if prose_pl == .; contract fyterm nossum prose_pl, zero; reshape wide _freq, i(fyterm nossum) j(prose_pl); rename _freq0 no_prose_pl; rename _freq1 prose_pl; /* reshaping wide to calculate total and total w/o inmate civil rights/habeas */ reshape wide *prose_pl, i(fyterm) j(nossum); /* Total */ egen no_prose_pl14 = rowtotal(no_prose_pl*); egen prose_pl14 = rowtotal(prose_pl*); /* Total without inmate civil right/habeas */ gen no_prose_pl15 = no_prose_pl14 - no_prose_pl10 - no_prose_pl6; gen prose_pl15 = prose_pl14 - prose_pl10 - prose_pl6; /* reshaping long to calculate % pro se */ reshape long no_prose_pl prose_pl, i(fyterm) j(nossum); label define nossum 14 "Total" 15 "Total without inmate civil right/habeas", modify; /* Number of cases by nossum */ gen total = no_prose_pl + prose_pl; /* Percentage of cases, by nossum, that are pro se */ gen per_prose_pl = (prose_pl)/(no_prose_pl + prose_pl); /* keeping only years of interest so that exporting to excel is easier */ keep if fyterm == 1996 | fyterm == 2000 | fyterm == 2006 | fyterm == 2012; /* Reshaping wide to get each total and percentage by nossum and year */ reshape wide total per_prose_pl no_prose_pl prose_pl, i(nossum) j(fyterm); export excel using "`excel_file'", sheet("t6") firstrow(var) sheetreplace; /******************************************************************************* TABLE 7: INCIDENCE OF COURT ORDERS, LOCAL JAILS AND STATE PRISONS, 1983-2006 *******************************************************************************/ use "raw_files/jail_and_prison_census_1983-2006.dta", clear; drop if state == 52; drop if community == 1; drop if fed == 1; /* by facility */ preserve; collapse (rawsum) n (mean) ordsm [fweight=n], by(year prison); rename n fac; rename ordsm fac_ord; tempfile by_facility; save `by_facility'; restore; /* by incarcerated population */ collapse (rawsum) adp (mean) ordsm [fweight=adp], by(year prison); rename adp pop; rename ordsm pop_ord; /* merging by pop. with by facility */ merge 1:1 prison year using `by_facility', nogen; sort prison year; order prison year fac fac_ord pop pop_ord; export excel using "`excel_file'", firstrow(varlabels) sheet("t7") sheetreplace; /******************************************************************************* TABLE 8: SYSTEM-WIDE COURT ORDER COVERAGE, BY STATE *******************************************************************************/ use "raw_files/jail_and_prison_census_1983-2006.dta", clear; drop if state == 52; drop if community == 1; drop if fed == 1; drop if priv == 1; collapse (mean) system (mean) any=ordsm, by(state year prison); replace any = 1 if any > 0; qui: tab state if prison == 0; local jail_n = `r(r)'; qui: tab state if prison == 1; local prison_n = `r(r)'; drop prison; preserve; collapse (sum) system0=any system99=system, by(year); reshape long system, i(year) j(state); tempfile totals; save `totals'; restore; merge 1:1 state year using `totals'; drop any _merge; reshape wide system, i(state) j(year); egen include = rowtotal(system*); keep if include > 0 & include != .; drop include; rename *1983 jail_1983; rename *1984 prison_1984; rename *1988 jail_1988; rename *1990 prison_1990; rename *1993 jail_1993; rename *1995 prison_1995; rename *1999 jail_1999; rename *2000 prison_2000; rename *2006 jail_2006; rename *2005 prison_2005; order state jail* prison*; putexcel B1=("Local Jails") C1=(`jail_n') G1=("State Prisons") H1=(`prison_n') using "`excel_file'", sheet("t8",replace) modify; export excel using "`excel_file'", sheet("t8") cell(A2) firstrow(var) sheetmodify; /******************************************************************************* PRISONER POPULATION AND CIVIL RIGHTS FILINGS, FY 1970-FY 2012 PRISONER POPULATION & CIVIL RIGHTS FILINGS PER 1000 PRISONERS, FY 1970-2012 *******************************************************************************/ use "output_files/population_and_filings_1970-2012.dta", clear; keep if state == -1 & year <= 2012; /* including federal prsioners */ gen prison_fed = prison + fed; /* Year Jail Population was estimated*/ gen year_est = year if year == 1971 | year == 1972 | year == 1973 | year == 1974 | year == 1975 | year == 1976 | year == 1977 | year == 1979; /* adding small delta to year for graphing bars side by side */ gen year0 = year -.15; gen year1 = year + .15; gen year1_est = year_est + .15; local yy = 70; /******************************************************************************* FIGURE A: PRISONER POPULATION AND CIVIL RIGHTS FILINGS, FY 1970-FY 2012. *******************************************************************************/ local bar_settings "yaxis(1) barw(.3) lwidth(thin)"; twoway (bar prison_fed year0 if year >= 19`yy', lcolor(gs5) fcolor(gs5) `bar_settings') (bar jail year1 if year >= 19`yy', lcolor(gs5) fcolor(gs14) `bar_settings') (line filings year if year >= 19`yy', lwidth(medthick) lstyle(line) lcolor(gs0) yaxis(2)), xline(1996, lp("-") noextend lc(gs0)) text(1550000 1996 "PLRA", box bc(gs16) lw(medium)) name(figA_bw, replace) /* X-Axis Settings */ xsize(4) ysize(2.5) xtitle("") xlab(19`yy'(2)2012, angle(90) labsize(small)) xmtick(19`yy'(1)2012) /* Left Y-Axis Settings */ ytitle("Jail and Prison Population",axis(1)) ylab(0(200000)1500000, labsize(small) axis(1) format(%12.0gc) angle(0)) ysca(axis(1) r(0 1500000)) /* Right Y-Axis Settings */ ytitle("Civil Rights Filings by Prisoners", axis(2)) ylab(0(5000)40000, labsize(small) axis(2) format(%12.0gc) angle(0)) ysca(axis(2) r(0 40000)) /* Legend Settings and Order */ legend(symx(*.75) rows(3) label(1 "Prison Population") label(2 "Jail Population") label(3 "Prisoner Civil Rights Filings")) /* Plot and Graph Region Settings */ plotregion(color(gs16) margin(b=0)) graphregion(color(gs16) margin(0)); graph export "output_files/Figure_A_bw.emf", replace; /******************************************************************************* FIGURE B: PRISONER POPULATION & CIVIL RIGHTS FILINGS PER 1000 PRISONERS, FY 1970-2012 *******************************************************************************/ local bar_settings "yaxis(1) barw(.3) lwidth(thin)"; local line_settings "msymbol(s) msize(medium) lwidth(medthick) lstyle(line) lcolor(gs0) yaxis(2)"; twoway (bar prison_fed year0 if year >= 19`yy', lcolor(gs5) fcolor(gs5) `bar_settings') (bar jail year1 if year >= 19`yy', lcolor(gs5) fcolor(gs14) `bar_settings') (connected FiRate year if year >= 19`yy', mlcolor(gs5) mfcolor(gs10) mlwidth(none) `line_settings'), xline(1996, lp("-") noextend lc(gs0)) text(1550000 1996 "PLRA", box bc(gs16) lw(medium)) name(figB_bw, replace) /* X-Axis Settings */ xsize(4) ysize(2.5) xtitle("") xlab(19`yy'(2)2012, angle(90) labsize(small)) xmtick(19`yy'(1)2012) /* Left Y-Axis Settings */ ytitle("Jail and Prison Population",axis(1)) ylab(0(200000)1500000, labsize(small) axis(1) format(%12.0gc) angle(0)) ysca(axis(1) r(0 1500000)) /* Right Y-Axis Settings */ ytitle("Filings per 1000 Prisoners", axis(2)) ylab(0(5)35, labsize(small) axis(2) format(%12.0gc) angle(0)) ysca(axis(2) r(0 35)) /* Legend Settings and Order */ legend(symx(*.75) rows(3) label(1 "Prison Population") label(2 "Jail Population") label(3 "Civil Rights Filings per 1000 Prisoners")) /* Plot and Graph Region Settings */ plotregion(color(gs16) margin(b=0)) graphregion(color(gs16) margin(0)); graph export "output_files/Figure_B_bw.emf", replace;