*_______________________________________________________________________________ * Title: CUMULATIVE RISKS OF PATERNAL AND MATERNAL INCARCERATION IN DENMARK * AND THE UNITED STATES * Authors: Christopher Wildeman (Cornell University) * Lars H Andersen (Rockwool Foundation Research Unit) * Details: This do-file produces all numbers * Do-file last edited on 05-21-2015 by Lars H Andersen * We show how to get from Tables 1 and 2 to Table 3 * We do not show how we calculated Tables 1 and 2 from the registers * at Statistics Denmark *_______________________________________________________________________________ clear version 13 * specify library for saving results global lib e:/data/workdata/703566/lha/comparativepaper/tables /*** Change lib to local directory before run ***/ *_______________________________________________________________________________ * Step 01: Inputting Table 1 * 1990 Danish Birth Cohort at Risk of Paternal Criminal Justice * Contact by Age and Length of Contact *_______________________________________________________________________________ clear input age pop L180 L90 L30 L14 L1 L0 1 62982 78 86 105 138 249 443 2 62666 99 109 156 192 380 796 3 62424 95 106 157 225 412 716 4 62194 91 99 149 206 328 578 5 61959 88 103 140 194 274 413 6 61781 70 79 119 167 263 426 7 61619 64 72 86 122 193 331 8 61500 71 79 107 129 181 306 9 61350 59 68 81 111 159 250 10 61222 59 59 76 99 126 235 11 61112 40 46 64 76 118 242 12 61020 51 63 62 55 87 209 13 60935 29 38 47 56 79 188 14 60853 42 46 59 63 76 208 end * prettying the table order age pop L180 L90 L30 L14 L1 L0 label var age "Age" label var pop "Population" label var L180 "Prison" label var L90 "> 3 months" label var L30 "> 1 month" label var L14 "> 2 weeks" label var L1 "> 24 hours" label var L0 "All entries" * saving Table 1 and showing table save $lib/Table1.dta, replace list *_______________________________________________________________________________ * Step 02: Inputting Table 2 * 1990 Danish Birth Cohort at Risk of Maternal Criminal Justice * Contact by Age and Length of Contact *_______________________________________________________________________________ clear input age pop L180 L90 L30 L14 L1 L0 1 62982 6 7 8 12 24 85 2 62666 15 15 16 20 47 170 3 62424 15 15 16 20 40 154 4 62194 17 19 22 24 46 138 5 61959 8 10 12 15 36 124 6 61781 20 19 23 24 40 118 7 61619 12 13 15 16 33 93 8 61500 11 10 15 19 25 86 9 61350 6 7 7 15 28 55 10 61222 7 7 10 13 23 55 11 61112 16 16 17 18 34 82 12 61020 6 7 7 11 20 54 13 60935 11 11 13 15 27 54 14 60853 12 12 13 14 21 76 end * prettying the table order age pop L180 L90 L30 L14 L1 L0 label var age "Age" label var pop "Population" label var L180 "Prison" label var L90 "> 3 months" label var L30 "> 1 month" label var L14 "> 2 weeks" label var L1 "> 24 hours" label var L0 "All entries" * saving Table 1 and showing table save $lib/Table2.dta, replace list *_______________________________________________________________________________ * Step 03: Producing Table 3 from Tables 1 and 2 * Cumulative Risks of Parental Criminal Justice Contact in the US * and Denmark, 1990 Birth Cohort *_______________________________________________________________________________ * inputting paternal US cumulative risks obtained from Wildeman (2009) clear input age US 1 0.95 2 1.80 3 2.57 4 3.27 5 3.90 6 4.46 7 4.95 8 5.43 9 5.88 10 6.33 11 6.77 12 7.18 13 7.58 14 7.96 end * adding Danish numbers merge 1:1 age using $lib/Table1.dta, nogen * calculating cumulative risks of paternal incarceration, by length of incarcer foreach l in 180 90 30 14 1 0{ sort age ge C`l'=sum(L`l') /* cumulative frequency */ replace C`l'=C`l'/pop /* cumulative risks */ } * keeping relevant variables keep age US C* ge parent="Paternal" * saving paternal part of Table 3 save $lib/Table3.dta, replace * inputting maternal US cumulative risks obtained from Wildeman (2009) clear input age US 1 0.03 2 0.06 3 0.09 4 0.13 5 0.16 6 0.20 7 0.24 8 0.28 9 0.32 10 0.37 11 0.42 12 0.47 13 0.52 14 0.58 end * adding Danish numbers merge 1:1 age using $lib/Table2.dta, nogen * calculating cumulative risks of maternal incarceration, by length of incarcer foreach l in 180 90 30 14 1 0{ sort age ge C`l'=sum(L`l') /* cumulative frequency */ replace C`l'=C`l'/pop /* cumulative risks */ } * keeping relevant variables keep age US C* ge parent="Maternal" * adding paternal numbers to maternal numbers append using $lib/Table3.dta * prettying table gsort -parent age order parent age US C180 C90 C30 C14 C1 C0 label var age "Age" label var US "US prison" label var C180 "Prison" label var C90 "> 3 months" label var C30 "> 1 month" label var C14 "> 2 weeks" label var C1 "> 24 hours" label var C0 "All entries" format US %8.2f /* use 2 decimals */ foreach c in 180 90 30 14 1 0{ replace C`c'=C`c'*100 /* report as percentages */ format C`c' %8.2f /* use 2 decimals */ } * saving Table 3 and showing table save $lib/Table3.dta, replace list *_______________________________________________________________________________ * Do-file has ended *_______________________________________________________________________________ clear