* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; #delimit ; * This says that the semicolon denotes the end of a line of command. All lines must end with semicolons after this; log using jleo.log, replace; set more 1; *This should stop the pauses; *To keep going regradless of errors, use DO mYFILE, nostop; * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; /* *Se;t 14, 1996. Jleo.do. October 24, 2001. This is a new version, based on career.do, which looks at the marginal effects using STATA 7.0. These regressions use the 1961-1965 data. LOCATION AND POSTING BOTH . This is an mproved version of oct7a.do. This uses the fixed-up dataset with the new 63 and 64 judges. We also fix up the first-job regression to not have an ordered variable for school, but dummies instead. This uses datajap.do to set up the data, and the present file just runs the regressions. Some of this is in Chapter 2 of our book, some in Chapter 3. The S138 stuff at the end is in Chapter 3. I've changed the regressions to use Flunks instead of Agegrad, to be consistent with our other articles. */ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; clear; use judges.dta; generate Flunks = Agegrad - 24; * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; summarize Flunks Sex Tokman Kyoman Chuman Zeroman fHIER1 fLOC1 Rawprod Prodty90 JOBLOC2 JOBHIER2 YJL ANTI75 ANTIEND AGEND ANTPEND ANTPENDa ANTIP75 ANTIP75a A75 AEND ; *This is for Table 1; /* AGEND is total opinions 75-85. ANTIEND is anti-govt. opinions 75-85. ANTPEND and ANTPENDa are proportions anti-govt. 75-85; and ANTIP75 ANTIP75a are the equivalent for opinions65-75. Running the regression with ANTPENDa and ANTIP75a only has 39 observations, because it drops off all the judge swho had no opinions in one of the two periods. Using ANTIP75 and ANTPEND has 54 observations, because they impute the average anti-gov. percentage to judges who had zero total opinions in a period. Really, such imputation is pretty fishy. A75 and AEND just dummy for whether a judge had ANY anti-govt. opinions in a period. */ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; drop FLOC1X0 FLOC1X1 FLOC1X2 FLOC1X3 ; generate tok1=1 if fLOC1==3; replace tok1=0 if tok1==. ; generate elite=1 if Tokman==1; replace elite=1 if Kyoman==1; replace elite=0 if elite==.; *REGRESSION Chapter 2. First job=Tokyo?; probit tok1 elite YJL Flunks; * pred score; * list score; * drop score; *FOr TABLE 2.7A. ; mfx compute, at(median); generate bo1=1 if fHIER1==0; replace bo1=0 if bo1==. ; *REGRESSION chapter 2 First job=Branch?; probit bo1 elite YJL Flunks ; *FOr TABLE 2.7B. ; mfx compute, at(median); * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; *REGRESSION Chapter 3. First job quality. TABLE 3.3A. ; oprobit fHIER1 Sex Flunks Tokman Kyoman Chuman Zeroman YJL ; *REGRESSION Chapter 3. First job quality. TABLE 3.3B. ; oprobit fLOC1 Sex Flunks Tokman Kyoman Chuman Zeroman YJL ; * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; clear; use judges.dta; generate Flunks = Agegrad - 24; * HIERARCHY/POSTING REGRESSIONS ; * REGRESSION table 5a. (Career: hierarchy); *This is for the 1980-90 job; *TABLE 3.4A in the book; oprobit JOBHIER2 Sex Flunks Tokman Kyoman Chuman Zeroman FLOC1X1 FLOC1X2 FLOC1X3 Rawprod YJL ; oprobitp zeroa onea twoa threea ; /* oprobitp is a command which generates the probabilities of the various values of JOBHIER2 in the previous regression, for each observation. It does not print out anything, so we need to follow it with a LIST command. */ /* oprobitp is a special command programmed in a file called oprobitp.ado, which must be copied into the directory STATA is running from in order to work. */ generate PRED = zeroa*0 + onea*1 + twoa*2+ threea*3; generate RESID = JOBHIER2 - PRED; generate stage= (RESID+3)/(3-RESID) ; generate RESIDa = log(stage); *RESIDa goes from negative to positive infinity, so OLS is OK. ; drop zeroa onea twoa threea; *REGRESSION table 7 , hierarchy and politics; regress RESIDa ANTI75 ANTIEND, noconstant; *REGRESSION table 7 , hierarchy and politics; regress RESIDa A75 AEND, noconstant; *REGRESSION table xxx, hierarchy and politics; regress RESIDa ANTIP75 ANTPEND, noconstant; *REGRESSION table 8, hierarchy and politics; regress RESIDa ANTIP75a ANTPENDa, noconstant; * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; * Now, we switch to location; * REGRESSION table 4b. (location); *TABLE 3.4B; *This is for the 1980-90 job; oprobit JOBLOC2 Sex Flunks Tokman Kyoman Chuman Zeroman FLOC1X1 FLOC1X2 FLOC1X3 Rawprod YJL ; oprobitp zerob oneb twob threeb ; /* oprobitp is a command which generates the probabilities of the various values of JOBHIER2 in the previous regression, for each observation. It does not print out anything, so we need to follow it with a LIST command. */ /* oprobitp is a special command programmed in a file called oprobitp.ado, which must be copied into the directory STATA is running from in order to work. */ replace PRED = zerob*0 + oneb*1 + twob*2+ threeb*3; replace RESID = JOBLOC2 - PRED; replace stage= (RESID+3)/(3-RESID) ; replace RESIDa = log(stage); *RESIDa goes from negative to positive infinity, so OLS is OK. ; *REGRESSION table 7,location and politics; regress RESIDa ANTI75 ANTIEND, noconstant; *REGRESSION table 7, location and politics; regress RESIDa A75 AEND, noconstant; *REGRESSION xxx, location and politics; regress RESIDa ANTIP75 ANTPEND, noconstant; *REGRESSION table 8, location and politics; regress RESIDa ANTIP75a ANTPENDa, noconstant; clear; * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--; /* Now we go to the S138 regressions, from the file j6.do. January 9, 1996 Done using STATA . These regressions use the Elections data They have the revised 1996 data. */ * ------------------------------------------; * ------------------------------------------; use elecreg.dta; * ------------------------------------------; * ------------------------------------------; summarize FFLOC2 FFHIER2 PPLOC2 PPHIER2 PPPROD FFPROD PPBRAN PPSOK FFBRAN FFSOK Sex YJL if ANTIGOV==0; *This gives summary statistics for pro-gvoernment judges; * ------------------------------------------; * ------------------------------------------; summarize FFLOC2 FFHIER2 PPLOC2 PPHIER2 PPPROD FFPROD PPBRAN PPSOK FFBRAN FFSOK Sex YJL if ANTIGOV==1; *This gives summary statistics for anti-gvoernment judges; * ------------------------------------------; * ------------------------------------------; *REGRESSION 3B . (branch office) Table 3.7a in the book. ; tobit FFBRAN PPBRAN PPPROD ANTIGOV, ll(0) ul(1) ; mfx compute, predict(ystar(0, 1)) at(median); * ------------------------------------------; * ------------------------------------------; *REGRESSION 4. (Sokatsu) Table 3.7b in the book.; tobit FFSOK PPSOK PPPROD ANTIGOV, ll(0) ul(1) ; mfx compute, predict(ystar(0, 1)) at(median); * ------------------------------------------; * ------------------------------------------; clear; log close;