clear * set matsize 5000 set maxvar 30000 cap log close set more off *cd "Fill out your file location and remove star" ****************************************************************************************************************************** ********************************PART 1: FIGURE OUT THE SOCIALLY EFFICIENT THRESHOLD******************************************* ****************************************************************************************************************************** log using careeranalysis.log, replace use managercareerprofiles.dta, replace keep if period>99 drop if manfe==. *****standardize the manager effects egen countmanfe=count(manfe) sum countmanfe local feobs=r(mean) sum manfe manwfe manspellfe manelofe manresfe egen sdmanfe=sd(manfe) egen sdmanwfe=sd(manwfe) egen sdmanexpfe=sd(manexpfe) egen sdmanresfe=sd(manresfe) egen sdmanelofe=sd(manelofe) egen sdmanspellfe=sd(manspellfe) egen mmanfe=mean(manfe) egen mmanwfe=mean(manwfe) egen mmanexpfe=mean(manexpfe) egen mmanresfe=mean(manresfe) egen mmanelofe=mean(manelofe) egen mmanspellfe=mean(manspellfe) gen stdmanfe=(manfe-mmanfe)/sdmanfe gen stdmanwfe=(manwfe-mmanwfe)/sdmanwfe gen stdmanexpfe=(manexpfe-mmanexpfe)/sdmanexpfe gen stdmanresfe=(manresfe-mmanresfe)/sdmanresfe gen stdmanelofe=(manelofe-mmanelofe)/sdmanelofe gen stdmanspellfe=(manspellfe-mmanspellfe)/sdmanspellfe *****Identify entrants gen entrant=1 if 9920 gen mediocre5yfe`k'=1 if manfeav10yentfe+`k'/100 & period==spellstartperiod replace mediocre10y20obsfe`k'=0 if manfe>av10yent20obsfe+`k'/100 & period==spellstartperiod replace mediocre10y20obsfe`k'=0 if manestobs<=20 replace mediocre5yfe`k'=0 if manfe>av5yentfe+`k'/100 & period==spellstartperiod replace mediocre10yspellfe`k'=0 if manspellfe>av10yentspellfe+`k'/100 & period==spellstartperiod replace mediocre10ywfe`k'=0 if manwfe>av10yentwfe+`k'/100 & period==spellstartperiod replace mediocre10yexpfe`k'=0 if manexpfe>av10yentexpfe+`k'/100 & period==spellstartperiod replace mediocre10yresfe`k'=0 if manfe>av10yentresfe+`k'/500 & period==spellstartperiod replace mediocre10yelofe`k'=0 if manfe>av10yentelofe+`k'/20 & period==spellstartperiod *mark further down career path sort manestid period replace mediocre10yfe`k'=1 if mediocre10yfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10y20obsfe`k'=1 if mediocre10y20obsfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre5yfe`k'=1 if mediocre5yfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10yspellfe`k'=1 if mediocre10yspellfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10ywfe`k'=1 if mediocre10ywfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10yexpfe`k'=1 if mediocre10yexpfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10yresfe`k'=1 if mediocre10yresfe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10yelofe`k'=1 if mediocre10yelofe`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10yfe`k'=0 if mediocre10yfe`k'==. replace mediocre10y20obsfe`k'=0 if mediocre10y20obsfe`k'==. replace mediocre5yfe`k'=0 if mediocre5yfe`k'==. replace mediocre10yspellfe`k'=0 if mediocre10yspellfe`k'==. replace mediocre10ywfe`k'=0 if mediocre10ywfe`k'==. replace mediocre10yexpfe`k'=0 if mediocre10yexpfe`k'==. replace mediocre10yresfe`k'=0 if mediocre10yresfe`k'==. replace mediocre10yelofe`k'=0 if mediocre10yelofe`k'==. } } *** Perform the first run to initialize the dataset of results gen random=runiform() gen minrandom=-random gen run=1 forvalues k=0(1)60 { quietly{ *take the non-mediocre entrants gen counter10yfe`k'=manfe if mediocre10yfe`k'==0 & entrant==1 gen counter10y20obsfe`k'=manfe if mediocre10y20obsfe`k'==0 & entrant==1 gen counter5yfe`k'=manfe if mediocre5yfe`k'==0 & entrant==1 gen counter10yspellfe`k'=manspellfe if mediocre10yspellfe`k'==0 & entrant==1 gen counter10ywfe`k'=manwfe if mediocre10ywfe`k'==0 & entrant==1 gen counter10yexpfe`k'=manexpfe if mediocre10yexpfe`k'==0 & entrant==1 gen counter10yresfe`k'=manresfe if mediocre10yresfe`k'==0 & entrant==1 gen counter10yelofe`k'=manelofe if mediocre10yelofe`k'==0 & entrant==1 *replace all non-entrants by non-mediocre entrants sort random replace counter10yfe`k'=counter10yfe`k'[_n-1] if counter10yfe`k'==. replace counter10y20obsfe`k'=counter10y20obsfe`k'[_n-1] if counter10y20obsfe`k'==. replace counter5yfe`k'=counter5yfe`k'[_n-1] if counter5yfe`k'==. replace counter10yspellfe`k'=counter10yspellfe`k'[_n-1] if counter10yspellfe`k'==. replace counter10ywfe`k'=counter10ywfe`k'[_n-1] if counter10ywfe`k'==. replace counter10yexpfe`k'=counter10yexpfe`k'[_n-1] if counter10yexpfe`k'==. replace counter10yresfe`k'=counter10yresfe`k'[_n-1] if counter10yresfe`k'==. replace counter10yelofe`k'=counter10yelofe`k'[_n-1] if counter10yelofe`k'==. sort minrandom replace counter10yfe`k'=counter10yfe`k'[_n-1] if counter10yfe`k'==. replace counter10y20obsfe`k'=counter10y20obsfe`k'[_n-1] if counter10y20obsfe`k'==. replace counter5yfe`k'=counter5yfe`k'[_n-1] if counter5yfe`k'==. replace counter10yspellfe`k'=counter10yspellfe`k'[_n-1] if counter10yspellfe`k'==. replace counter10ywfe`k'=counter10ywfe`k'[_n-1] if counter10ywfe`k'==. replace counter10yexpfe`k'=counter10yexpfe`k'[_n-1] if counter10yexpfe`k'==. replace counter10yresfe`k'=counter10yresfe`k'[_n-1] if counter10yresfe`k'==. replace counter10yelofe`k'=counter10yelofe`k'[_n-1] if counter10yelofe`k'==. *reinstate the non-mediocre rehired workers replace counter10yfe`k'=manfe if mediocre10yfe`k'==0 replace counter10y20obsfe`k'=manfe if mediocre10y20obsfe`k'==0 replace counter5yfe`k'=manfe if mediocre5yfe`k'==0 replace counter10yspellfe`k'=manspellfe if mediocre10yspellfe`k'==0 replace counter10ywfe`k'=manwfe if mediocre10ywfe`k'==0 replace counter10yexpfe`k'=manexpfe if mediocre10yexpfe`k'==0 replace counter10yresfe`k'=manresfe if mediocre10yresfe`k'==0 replace counter10yelofe`k'=manelofe if mediocre10yelofe`k'==0 *normalize by original sd for var counter10yfe`k' counter10y20obsfe`k' counter5yfe`k': replace X=(X-mmanfe)/sdmanfe replace counter10yspellfe`k'=(counter10yspellfe`k'-mmanspellfe)/sdmanspellfe replace counter10ywfe`k'=(counter10ywfe`k'-mmanwfe)/sdmanwfe replace counter10yexpfe`k'=(counter10yexpfe`k'-mmanexpfe)/sdmanexpfe replace counter10yresfe`k'=(counter10yresfe`k'-mmanresfe)/sdmanresfe replace counter10yelofe`k'=(counter10yelofe`k'-mmanelofe)/sdmanelofe } } save efficiencyintermediate.dta, replace ***store the counterfactuals preserve collapse mediocre10y* mediocre5y* counter10y* counter5y*, by(run) save thresholdsearch.dta, replace restore *** Now we run over 220 loops such that we keep at least 200 iterations if some were not to converge forvalues j=2(1)220 { di `j' quietly{ replace run=`j' *take a new draw replace random=runiform() replace minrandom=-random forvalues k=0(1)60 { *reset the values replace counter10yfe`k'=. replace counter10y20obsfe`k'=. replace counter5yfe`k'=. replace counter10yspellfe`k'=. replace counter10ywfe`k'=. replace counter10yexpfe`k'=. replace counter10yresfe`k'=. replace counter10yelofe`k'=. *take the non-mediocre entrants replace counter10yfe`k'=manfe if mediocre10yfe`k'==0 & entrant==1 replace counter10y20obsfe`k'=manfe if mediocre10y20obsfe`k'==0 & entrant==1 replace counter5yfe`k'=manfe if mediocre5yfe`k'==0 & entrant==1 replace counter10yspellfe`k'=manspellfe if mediocre10yspellfe`k'==0 & entrant==1 replace counter10ywfe`k'=manwfe if mediocre10ywfe`k'==0 & entrant==1 replace counter10yexpfe`k'=manexpfe if mediocre10yexpfe`k'==0 & entrant==1 replace counter10yresfe`k'=manresfe if mediocre10yresfe`k'==0 & entrant==1 replace counter10yelofe`k'=manelofe if mediocre10yelofe`k'==0 & entrant==1 *replace all non-entrants by non-mediocre entrants sort random replace counter10yfe`k'=counter10yfe`k'[_n-1] if counter10yfe`k'==. replace counter10y20obsfe`k'=counter10y20obsfe`k'[_n-1] if counter10y20obsfe`k'==. replace counter5yfe`k'=counter5yfe`k'[_n-1] if counter5yfe`k'==. replace counter10yspellfe`k'=counter10yspellfe`k'[_n-1] if counter10yspellfe`k'==. replace counter10ywfe`k'=counter10ywfe`k'[_n-1] if counter10ywfe`k'==. replace counter10yexpfe`k'=counter10yexpfe`k'[_n-1] if counter10yexpfe`k'==. replace counter10yresfe`k'=counter10yresfe`k'[_n-1] if counter10yresfe`k'==. replace counter10yelofe`k'=counter10yelofe`k'[_n-1] if counter10yelofe`k'==. sort minrandom replace counter10yfe`k'=counter10yfe`k'[_n-1] if counter10yfe`k'==. replace counter10y20obsfe`k'=counter10y20obsfe`k'[_n-1] if counter10y20obsfe`k'==. replace counter5yfe`k'=counter5yfe`k'[_n-1] if counter5yfe`k'==. replace counter10yspellfe`k'=counter10yspellfe`k'[_n-1] if counter10yspellfe`k'==. replace counter10ywfe`k'=counter10ywfe`k'[_n-1] if counter10ywfe`k'==. replace counter10yexpfe`k'=counter10yexpfe`k'[_n-1] if counter10yexpfe`k'==. replace counter10yresfe`k'=counter10yresfe`k'[_n-1] if counter10yresfe`k'==. replace counter10yelofe`k'=counter10yelofe`k'[_n-1] if counter10yelofe`k'==. *reinstate the non-mediocre rehired workers replace counter10yfe`k'=manfe if mediocre10yfe`k'==0 replace counter10y20obsfe`k'=manfe if mediocre10y20obsfe`k'==0 replace counter5yfe`k'=manfe if mediocre5yfe`k'==0 replace counter10yspellfe`k'=manspellfe if mediocre10yspellfe`k'==0 replace counter10ywfe`k'=manwfe if mediocre10ywfe`k'==0 replace counter10yexpfe`k'=manexpfe if mediocre10yexpfe`k'==0 replace counter10yresfe`k'=manresfe if mediocre10yresfe`k'==0 replace counter10yelofe`k'=manelofe if mediocre10yelofe`k'==0 *normalize by original sd for var counter10yfe`k' counter10y20obsfe`k' counter5yfe`k': replace X=(X-mmanfe)/sdmanfe replace counter10yspellfe`k'=(counter10yspellfe`k'-mmanspellfe)/sdmanspellfe replace counter10ywfe`k'=(counter10ywfe`k'-mmanwfe)/sdmanwfe replace counter10yexpfe`k'=(counter10yexpfe`k'-mmanexpfe)/sdmanexpfe replace counter10yresfe`k'=(counter10yresfe`k'-mmanresfe)/sdmanresfe replace counter10yelofe`k'=(counter10yelofe`k'-mmanelofe)/sdmanelofe } ***store the counterfactuals preserve collapse mediocre5y* mediocre10y* counter5y* counter10y*, by(run) append using thresholdsearch.dta save thresholdsearch.dta, replace restore } } use thresholdsearch.dta, replace sort run keep if _n<201 ************THE RESULTING THRESHOLDS WHICH WE NEED IN OTHER DO-FILE*************************************** sum mediocre10yfe* mediocre10y20obsfe* mediocre5yfe* mediocre10yspellfe* mediocre10ywfe* mediocre10yexpfe* mediocre10yresfe* mediocre10yelofe* **Ability sum counter10yfe* counter10y20obsfe* counter5yfe* counter10yspellfe* counter10ywfe* counter10yexpfe* counter10yresfe* counter10yelofe* egen maxcounter10yfe=rowmax(counter10yfe*) egen maxcounter10y20obsfe=rowmax(counter10y20obsfe*) egen maxcounter5yfe=rowmax(counter5yfe*) egen maxcounter10yspellfe=rowmax(counter10yspellfe*) egen maxcounter10ywfe=rowmax(counter10ywfe*) egen maxcounter10yexpfe=rowmax(counter10yexpfe*) egen maxcounter10yresfe=rowmax(counter10yresfe*) egen maxcounter10yelofe=rowmax(counter10yelofe*) gen maximum10yfe=. gen maximum10y20obsfe=. gen maximum5yfe=. gen maximum10yspellfe=. gen maximum10ywfe=. gen maximum10yexpfe=. gen maximum10yresfe=. gen maximum10yelofe=. forvalues k=1(1)60{ replace maximum10yfe=`k' if counter10yfe`k'==maxcounter10yfe replace maximum10y20obsfe=`k' if counter10y20obsfe`k'==maxcounter10y20obsfe replace maximum5yfe=`k' if counter5yfe`k'==maxcounter5yfe replace maximum10yspellfe=`k' if counter10yspellfe`k'==maxcounter10yspellfe replace maximum10ywfe=`k' if counter10ywfe`k'==maxcounter10ywfe replace maximum10yexpfe=`k' if counter10yexpfe`k'==maxcounter10yexpfe replace maximum10yresfe=`k' if counter10yresfe`k'==maxcounter10yresfe replace maximum10yelofe=`k' if counter10yelofe`k'==maxcounter10yelofe } ***What is the threshold for each estimation method in each run? for var maximum10yfe maximum10y20obsfe maximum5yfe maximum10yspellfe maximum10ywfe maximum10yexpfe maximum10yresfe maximum10yelofe: tab X for var maximum10yfe maximum10y20obsfe maximum5yfe maximum10yspellfe maximum10ywfe maximum10yexpfe maximum10yresfe maximum10yelofe: egen modeX=mode(X) sum mode* sum maximum* ********************************************************************************************************************************* ********************************************PART 2: CALCULATE THE GAIN IN AVERAGE ABILITY**************************************** ********************************************************************************************************************************* use efficiencyintermediate.dta, clear **************BOOTSTRAP THIS************************ gen difcounter10yfe0=counter10yfe0-(manfe-mmanfe)/sdmanfe gen difcounter10yfe23=counter10yfe23-(manfe-mmanfe)/sdmanfe gen difcounter10yfe230=counter10yfe23-counter10yfe0 gen subcounter10yfe0=counter10yfe0 if mediocre10yfe0==1 gen subcounter10yfe23=counter10yfe23 if mediocre10yfe23==1 gen subdifcounter10yfe0=counter10yfe0-(manfe-mmanfe)/sdmanfe if mediocre10yfe0==1 gen subdifcounter10yfe23=counter10yfe23-(manfe-mmanfe)/sdmanfe if mediocre10yfe23==1 gen subman10yfe0=(manfe-mmanfe)/sdmanfe if mediocre10yfe0==1 gen subman10yfe23=(manfe-mmanfe)/sdmanfe if mediocre10yfe23==1 matrix counter=(0,0,0,0,0,0,0,0,0,0,0,0) sum counter10yfe0 return list matrix counter[1,1]=(r(mean)) sum counter10yfe23 return list matrix counter[1,2]=(r(mean)) sum stdmanfe return list matrix counter[1,3]=(r(mean)) sum difcounter10yfe0 return list matrix counter[1,4]=(r(mean)) sum difcounter10yfe23 return list matrix counter[1,5]=(r(mean)) sum difcounter10yfe230 return list matrix counter[1,6]=(r(mean)) sum counter10yfe0 if mediocre10yfe0==1 return list matrix counter[1,7]=(r(mean)) sum counter10yfe23 if mediocre10yfe23==1 return list matrix counter[1,8]=(r(mean)) sum stdmanfe if mediocre10yfe0==1 return list matrix counter[1,9]=(r(mean)) sum stdmanfe if mediocre10yfe23==1 return list matrix counter[1,10]=(r(mean)) sum difcounter10yfe0 if mediocre10yfe0==1 return list matrix counter[1,11]=(r(mean)) sum difcounter10yfe23 if mediocre10yfe23==1 return list matrix counter[1,12]=(r(mean)) matrix list counter capture program drop bootcounter program define bootcounter, rclass preserve bsample *select sub gen bootmediocre10yfe0=1 if manfeav10yentfe & period==spellstartperiod sort manestid period replace bootmediocre10yfe0=1 if bootmediocre10yfe0[_n-1]==1 & manestid[_n]==manestid[_n-1] replace bootmediocre10yfe0=0 if bootmediocre10yfe0==. gen bootmediocre10yfe23=1 if manfeav10yentfe+23/100 & period==spellstartperiod sort manestid period replace bootmediocre10yfe23=1 if bootmediocre10yfe23[_n-1]==1 & manestid[_n]==manestid[_n-1] replace bootmediocre10yfe23=0 if bootmediocre10yfe23==. gen bootcounter10yfe0=manfe if bootmediocre10yfe0==0 & entrant==1 gen bootcounter10yfe23=manfe if bootmediocre10yfe23==0 & entrant==1 gen bootmanfe=(manfe-mmanfe)/sdmanfe ****Generate draw cap drop random minrandom gen random=runiform() sort random replace bootcounter10yfe0=bootcounter10yfe0[_n-1] if bootcounter10yfe0==. replace bootcounter10yfe23=bootcounter10yfe23[_n-1] if bootcounter10yfe23==. gen minrandom=-random sort minrandom replace bootcounter10yfe0=bootcounter10yfe0[_n-1] if bootcounter10yfe0==. replace bootcounter10yfe23=bootcounter10yfe23[_n-1] if bootcounter10yfe23==. replace bootcounter10yfe0=manfe if bootmediocre10yfe0==0 replace bootcounter10yfe23=manfe if bootmediocre10yfe23==0 replace bootcounter10yfe0=(bootcounter10yfe0-mmanfe)/sdmanfe replace bootcounter10yfe23=(bootcounter10yfe23-mmanfe)/sdmanfe ***store the counterfactual sum bootcounter10yfe0 return scalar boot1=(r(mean)) sum bootcounter10yfe23 return scalar boot2=(r(mean)) sum bootmanfe return scalar boot3=(r(mean)) gen bootdifcounter10yfe0=bootcounter10yfe0-bootmanfe sum bootdifcounter10yfe0 return scalar boot4=(r(mean)) gen bootdifcounter10yfe23=bootcounter10yfe23-bootmanfe sum bootdifcounter10yfe23 return scalar boot5=(r(mean)) gen bootdifcounter10yfe230=bootcounter10yfe23-bootcounter10yfe0 sum bootdifcounter10yfe230 return scalar boot6=(r(mean)) sum bootcounter10yfe0 if mediocre10yfe0==1 return scalar boot7=(r(mean)) sum bootcounter10yfe23 if mediocre10yfe23==1 return scalar boot8=(r(mean)) sum bootmanfe if mediocre10yfe0==1 return scalar boot9=(r(mean)) sum bootmanfe if mediocre10yfe23==1 return scalar boot10=(r(mean)) sum bootdifcounter10yfe0 if mediocre10yfe0==1 return scalar boot11=(r(mean)) sum bootdifcounter10yfe23 if mediocre10yfe23==1 return scalar boot12=(r(mean)) restore end simulate counter10yfe0=r(boot1) counter10yfe23=r(boot2) manfe=r(boot3) difcounter10yfe0=r(boot4) difcounter10yfe23=r(boot5) difcounter10yfe230=r(boot6) subcounter10yfe0=r(boot7) subcounter10yfe23=r(boot8) subman10yfe0=r(boot9) subman10yfe23=r(boot10) subdifcounter10yfe0=r(boot11) subdifcounter10yfe23=r(boot12), reps(100): bootcounter *******************SHOW THE BOOTSTRAP RESULT********************************* ***** Results reported in table 5 of paper (note that bootstrap can lead to small variations in these numbers as they rely on random draws) bstat, stat(counter) n(`feobs') ************CREATE GRAPHS FOR FIGURE 4********************** ***Superimposed histograms of counter and real use efficiencyintermediate.dta, clear twoway (kdensity stdmanfe if stdmanfe>-3 & stdmanfe<4, lpattern(solid) color(black)) /// (kdensity counter10yfe23 if counter10yfe23>-3 & counter10yfe23<4, lpattern(longdash) color(black)), legend(order(1 "Actual" 2 "Medciore Threshold")) /// graphregion(color(white)) bgcolor(white) xtitle("Estimated ability") ytitle("Density") graph save Figure4panelB.gph, replace twoway (kdensity stdmanfe if stdmanfe>-3 & stdmanfe<4 & mediocre10yfe23==1, lpattern(solid) color(black)) /// (kdensity counter10yfe23 if counter10yfe23>-3 & counter10yfe23<4 & mediocre10yfe23==1, lpattern(dash) color(black)), /// legend(order(1 "Actual" 2 "Medciore Threshold")) graphregion(color(white)) bgcolor(white) xtitle("Estimated ability") ytitle("Density") graph save Figure4panelA.gph, replace *************************************************************************************************************************************** ********************************PART 3: REPEAT THE PROCEDURE FOR ADD WIN PERC********************************************************** *************************************************************************************************************************************** *************************************************************************************************************************************** *****************************FIGURE OUT THE SOCIALLY EFFICIENT THRESHOLD*************************************************************** *************************************************************************************************************************************** use managercareerprofiles.dta, replace keep if period>99 drop if manaddwinperc==. rename manaddwinperc manaddwp egen sdmanaddwp=sd(manaddwp) ***Identify mediocre managers egen countaddwp=count(manaddwp) sum countaddwp local feobs=r(mean) ****All entrants gen entrant=1 if 99av10yentaddwinperc+`k'/500 & period==spellstartperiod *mark further down career path sort manestid period replace mediocre10y`k'=1 if mediocre10y`k'[_n-1]==1 & manestid[_n]==manestid[_n-1] replace mediocre10y`k'=0 if mediocre10y`k'==. } } gen random=runiform() gen minrandom=-random gen run=1 forvalues k=0(1)60 { quietly{ *take the non-mediocre entrants gen counter10yaddwp`k'=manaddwp if mediocre10y`k'==0 & entrant==1 *replace all non-entrants by non-mediocre entrants sort random replace counter10yaddwp`k'=counter10yaddwp`k'[_n-1] if counter10yaddwp`k'==. sort minrandom replace counter10yaddwp`k'=counter10yaddwp`k'[_n-1] if counter10yaddwp`k'==. *reinstate the non-mediocre rehired workers replace counter10yaddwp`k'=manaddwp if mediocre10y`k'==0 replace counter10yaddwp`k'=counter10yaddwp`k'/sdmanaddwp } } save efficiencyintermediateaddwp.dta, replace ***store the counterfactuals preserve collapse mediocre10y* counter10y*, by(run) save thresholdsearchaddwp.dta, replace restore forvalues j=2(1)210 { di `j' quietly{ replace run=`j' *take a new draw replace random=runiform() replace minrandom=-random forvalues k=0(1)60 { *reset the values replace counter10yaddwp`k'=. *take the non-mediocre entrants replace counter10yaddwp`k'=manaddwp if mediocre10y`k'==0 & entrant==1 *replace all non-entrants by non-mediocre entrants sort random replace counter10yaddwp`k'=counter10yaddwp`k'[_n-1] if counter10yaddwp`k'==. sort minrandom replace counter10yaddwp`k'=counter10yaddwp`k'[_n-1] if counter10yaddwp`k'==. *reinstate the non-mediocre rehired workers replace counter10yaddwp`k'=manaddwp if mediocre10y`k'==0 replace counter10yaddwp`k'=counter10yaddwp`k'/sdmanaddwp } ***store the counterfactuals preserve collapse mediocre10y* counter10y*, by(run) append using thresholdsearchaddwp.dta save thresholdsearchaddwp.dta, replace restore } } use thresholdsearchaddwp.dta, replace sort run keep if _n<201 ******THE RESULTING MEDIOCRITY THRESHOLD, NEEDED IN FURTHER ANALYSIS****** sum mediocre10y* **Ability sum counter10y* egen maxcounter10yaddwp=rowmax(counter10yaddwp*) gen maximum10yaddwp=. forvalues k=1(1)60{ replace maximum10yaddwp=`k' if counter10yaddwp`k'==maxcounter10yaddwp } ***What is the threshold for each estimation method in each run? for var maximum10yaddwp: tab X for var maximum10yaddwp: egen modeX=mode(X) sum mode* sum maximum* cap log close ********************************************************************************************************************************** ***********************************PART 4: THIS MAKES THE ILLUSTRATION GRAPHS FIGURE 2******************************************** ********************************************************************************************************************************** use managercareerprofiles.dta, replace ****Set aside the Wenger Ferguson etc. graph**** preserve keep manestid period manestobs manwpobs manspellfe manfe manwfe manaddwinperc manwinperc finalmanfe finalmanaddwinperc manengentryperiod id manager drop if manager=="caretaker" sort manestid period gen estobservedperiod=1 if manestobs[_n-1]50, p(25) bysort manperiod: egen Q3fe=pctile(manfe) if manobsperiod>50, p(75) bysort manperiod: egen Medianfe=pctile(manfe) if manobsperiod>50, p(50) bysort manperiod: egen Q1wp=pctile(manaddwinperc) if manobsperiod>50, p(25) bysort manperiod: egen Q3wp=pctile(manaddwinperc) if manobsperiod>50, p(75) bysort manperiod: egen Medianwp=pctile(manaddwinperc) if manobsperiod>50, p(50) *Manager selection gen Wengerfe=manfe if manestid==45 & estobservedperiod==1 gen Wengerwp=manaddwinperc if manestid==45 & estobservedperiod==1 gen Adamsfe=manfe if manestid==591 & estobservedperiod==1 gen Adamswp=manaddwinperc if manestid==591 & estobservedperiod==1 gen McMahonfe=manfe if manestid==772 & estobservedperiod==1 gen McMahonwp=manaddwinperc if manestid==772 & estobservedperiod==1 sum collapse Wenger* Adams* McMahon* Q* Median*, by(manperiod) save graphsample.dta, replace sum manperiod if Wengerfe!=. quietly return list local m=r(max) twoway (rarea Q1fe Q3fe manperiod, bcolor(gs12)) (line Wengerfe Adamsfe McMahonfe Medianfe manperiod, lpattern(longdash shortdash dash solid) cmissing(n n n n) color(black black black black)) if manperiod<100, xtitle(months since career start) ytitle(Ability Estimate) legend(label(2 "Wenger") label(3 "Adams") label(4 "McMahon") label(5 "Median") order(2 3 4 5)) graphregion(color(white)) bgcolor(white) graph save Figure2.gph, replace ***Two additional graphs, not featured in the final paper twoway (rarea Q1fe Q3fe manperiod, bcolor(gs12)) (line Wengerfe Adamsfe McMahonfe Medianfe manperiod, cmissing(n n n n)) if manperiod<100, xtitle(months since career start) ytitle(Ability Estimate) legend(label(2 "Wenger") label(3 "Adams") label(4 "McMahon") label(5 "Median") order(2 3 4 5)) graphregion(color(white)) bgcolor(white) graph save Figure2_color.gph, replace twoway (rarea Q1wp Q3wp manperiod, bcolor(gs12)) (line Wengerwp Adamswp McMahonwp Medianwp manperiod, lpattern(longdash shortdash dash solid) cmissing(n n n n) color(black black black black)) if manperiod<100, xtitle(months since career start) ytitle(Addwin%) legend(label(2 "Wenger") label(3 "Adams") label(4 "McMahon") label(5 "Median") order(2 3 4 5)) graphregion(color(white)) bgcolor(white) graph save Figure2_addwp.gph, replace restore ********************************************************************************************************* *******************PART 5: THIS MAKES SUMMARY STATS AS REPORTED IN TABLE 1, 3 AND B1********************* ********************************************************************************************************* use managercareerprofiles.dta, replace log using indsumstats.log, replace egen mmanfe=mean(manfe) egen mmanaddwp=mean(manaddwinperc) egen mmanresfe=mean(manresfe) egen mmanelofe=mean(manelofe) egen mmanivfe=mean(manivfe) egen mmanexpfe=mean(manexpfe) egen mmanspellfe=mean(manspellfe) egen mmanwfe=mean(manwfe) egen mmanivexpfe=mean(manivexpfe) egen mmanivspellfe=mean(manivspellfe) egen mmanivwfe=mean(manivwfe) egen sdmanfe=sd(manfe) egen sdmanaddwp=sd(manaddwinperc) egen sdmanresfe=sd(manresfe) egen sdmanelofe=sd(manelofe) egen sdmanivfe=sd(manivfe) egen sdmanexpfe=sd(manexpfe) egen sdmanspellfe=sd(manspellfe) egen sdmanwfe=sd(manwfe) egen sdmanivexpfe=sd(manivexpfe) egen sdmanivspellfe=sd(manivspellfe) egen sdmanivwfe=sd(manivwfe) gen stdmanfe=(manfe-mmanfe)/sdmanfe gen stdmanresfe=(manresfe-mmanresfe)/sdmanresfe gen stdmanelofe=(manelofe-mmanelofe)/sdmanelofe gen stdmanaddwp=(manaddwinperc-mmanaddwp)/sdmanaddwp gen stdmanivfe=(manivfe-mmanivfe)/sdmanivfe gen stdmanexpfe=(manexpfe-mmanexpfe)/sdmanexpfe gen stdmanspellfe=(manspellfe-mmanspellfe)/sdmanspellfe gen stdmanwfe=(manwfe-mmanwfe)/sdmanwfe gen stdmanivexpfe=(manivexpfe-mmanivexpfe)/sdmanivexpfe gen stdmanivspellfe=(manivspellfe-mmanivspellfe)/sdmanivspellfe gen stdmanivwfe=(manivwfe-mmanivwfe)/sdmanivwfe ****Determine a manager's first period, total # of periods, running total of periods and periods with observations for var manage manexp manengexp manforeign manplayermanager maninternhire manothermanexp manplayedprof manplaybigfour mannumengteams manexplayer manexpint: replace X=. if manager=="caretaker" sort manestid period gen estobservedperiod=1 if manestobs[_n-1]manestid[_n-1] replace estobservedperiod=0 if estobservedperiod==. gen wpobservedperiod=1 if manwpobs[_n-1]manestid[_n-1] replace wpobservedperiod=0 if wpobservedperiod==. sort manestid period gen manfirstpresent=period if manestid[_n-1]0 gen manestobsperiods=_n-manfirstestobsline+1 if manidhelp>0 sort manestid period replace manestobsperiods=manestobsperiods[_n-1] if manestobsperiods==. & manidhelp==0 bysort manestid: egen manmaxestobsperiods=max(manestobsperiods) bysort manestid: egen mannumfe=count(manfe) gen manidhelp2=manestid*wpobservedperiod sort manidhelp2 period gen manfirstwpobsline=_n if manidhelp2[_n-1]0 gen manwpobsperiods=_n-manfirstwpobsline+1 if manidhelp2>0 sort manestid period replace manwpobsperiods=manwpobsperiods[_n-1] if manwpobsperiods==. & manidhelp2==0 bysort manestid: egen manmaxwpobsperiods=max(manwpobsperiods) bysort manestid: egen mannumwp=count(manaddwinperc) sort manestid id period gen firsttenperiod=period if id[_n-1]50 ***Measures of tenure and firings gen manfireperiod=0 gen manterminationperiod=0 replace manfireperiod=1 if spellendperiod==period & mancareerprogress<3 & period<380 replace manterminationperiod=1 if spellendperiod==period & period<380 tab manfireperiod manterminationperiod ****Log some charateristics sum manage manexp mantenure mantenperiod gen manlexp=log(manexp) gen manlexpsq=manlexp^2 gen manlage=log(manage) gen manlagesq=manlage^2 gen manltenure=log(mantenure) gen manltenperiod=log(mantenperiod) gen manlfirstpresent=log(manfirstpresent) **Year of spell starts gen spellstartyear=int(spellstartperiod/10)+1973 *******Summary stats for paper preserve collapse stdman* manestobs manwpobs manage manexp manengexp manforeign manplayermanager maninternhire manothermanexp manplayedprof manplaybigfour mannumengteams manexplayer manexpint totalperiodsobs totalgamesobs manmaxwpobs manmaxestobs division mannumfe mannumwp mantotalestobs mantotalwpobs manentrydiv, by(manestid) **Quartiles sum totalperiodsobs totalgamesobs xtile quartobs=totalgamesobs, n(4) xtile quartfe=stdmanfe if stdmanfe!=., n(4) xtile quartwp=stdmanaddwp if stdmanaddwp!=. , n(4) xtile quartresfe=stdmanresfe if stdmanresfe!=., n(4) xtile quartelofe=stdmanelofe if stdmanelofe!=., n(4) xtile quartivfe=stdmanivfe if stdmanivfe!=. , n(4) xtile quartexpfe=stdmanexpfe if stdmanexpfe!=. , n(4) xtile quartspellfe=stdmanspellfe if stdmanspellfe!=. , n(4) xtile quartwfe=stdmanwfe if stdmanwfe!=. , n(4) xtile quartivexpfe=stdmanivexpfe if stdmanivexpfe!=. , n(4) xtile quartivwfe=stdmanivwfe if stdmanivwfe!=. , n(4) xtile quartivspellfe=stdmanivspellfe if stdmanivspellfe!=. , n(4) sum quart* replace manage=manage/365 **********************************OUTPUT TABLE 1********************************** tabstat totalgamesobs totalperiodsobs manage manexp manengexp manforeign manplayermanager manothermanexp maninternhire division manentrydiv manplayedprof manplaybigfour mannumengteams manexplayer manexpint, by(quartobs) col(stat) stat(count mean sd) longstub **********************************OUTPUT TABLE 3********************************** tabstat stdmanfe mannumfe mantotalestobs, by(quartfe) col(stat) stat(count mean sd) longstub tabstat stdmanaddwp mannumwp mantotalwpobs, by(quartwp) col(stat) stat(count mean sd) longstub **********************************OUTPUT TABLE APPENDIX B1********************************** tabstat stdmanresfe, by(quartresfe) col(stat) stat(count mean sd) longstub tabstat stdmanelofe, by(quartelofe) col(stat) stat(count mean sd) longstub tabstat stdmanivfe, by(quartivfe) col(stat) stat(count mean sd) longstub tabstat stdmanexpfe, by(quartexpfe) col(stat) stat(count mean sd) longstub tabstat stdmanspellfe, by(quartspellfe) col(stat) stat(count mean sd) longstub tabstat stdmanwfe, by(quartwfe) col(stat) stat(count mean sd) longstub tabstat stdmanivexpfe, by(quartivexpfe) col(stat) stat(count mean sd) longstub tabstat stdmanivspellfe, by(quartivspellfe) col(stat) stat(count mean sd) longstub tabstat stdmanivwfe, by(quartivwfe) col(stat) stat(count mean sd) longstub restore cap log close **************************************************************************************************************************** *************************PART 6: THIS DOES THE REGRESSION ON LEARNING, CAREER PROGRESS IN APPENDIX D************************ **************************************************************************************************************************** log using learning.log, replace ***********************************************Part 6.1: the baseline measure********************************************* ****Create a panel of observations as time and manid as cross preserve drop if estobservedperiod==0 gen month=period-10*floor(period/10) xtset manestid manestobsperiods ****Create difference for var manspellfe manfe: gen dif1X=D.X ****Create some meaningful lags for var manspellfe manfe: gen lag5X=L5.X for var manspellfe manfe: gen lag1X=L.X for var manspellfe manfe: gen lagdif1X=D.dif1X sum lag5* lag1* ***************************************EXAMINE ATTRITION********************************* *****Generate a table of average FE at quintiles of tenure bysort mantenperiod: egen tenperiodobs=count(manfe) egen maxtenperiodobs=max(tenperiodobs) gen quinttenperiods=int(tenperiodobs/(maxtenperiodobs/5)-0.01)+1 sum tenperiodobs tab quinttenperiods sort mantenperiod gen quint1tenobs=1 if quinttenperiods[_n-1]==5 & quinttenperiods[_n]==4 gen quint2tenobs=1 if quinttenperiods[_n-1]==4 & quinttenperiods[_n]==3 gen quint3tenobs=1 if quinttenperiods[_n-1]==3 & quinttenperiods[_n]==2 gen quint4tenobs=1 if quinttenperiods[_n-1]==2 & quinttenperiods[_n]==1 replace quint1tenobs=quint1tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint2tenobs=quint2tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint3tenobs=quint3tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint4tenobs=quint4tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint1tenobs=0 if quint1tenobs==. replace quint2tenobs=0 if quint2tenobs==. replace quint3tenobs=0 if quint3tenobs==. replace quint4tenobs=0 if quint4tenobs==. tabstat mantenperiod if quint1tenobs==1, stat(mean sd) tabstat mantenperiod if quint2tenobs==1, stat(mean sd) tabstat mantenperiod if quint3tenobs==1, stat(mean sd) tabstat mantenperiod if quint4tenobs==1, stat(mean sd) tabstat manfe if mantenperiod==1, by(spellstartdiv) stat(co mean sd) tabstat manfe if quint1tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manfe if quint2tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manfe if quint3tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manfe if quint4tenobs==1, by(spellstartdiv) stat(co mean sd) ***********************************Regression Analysis**************** ***LPM model reg manterminationperiod manfe, vce(bootstrap) outreg2 using TableD1, excel replace slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No) reg manterminationperiod manfe dif1manfe, vce(bootstrap) outreg2 using TableD1, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No) reg manterminationperiod manfe dif1manfe manltenure manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1, excel append slow(750) keep(manfe dif1manfe manltenure manlage manlexp) dec(3) addtext(Division FE, Yes, Month FE, Yes, Year FE, Yes) reg manfireperiod manfe, vce(bootstrap) outreg2 using TableD1_extra, excel replace slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manfireperiod manfe dif1manfe, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manfireperiod manfe dif1manfe manltenure manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) keep(manfe dif1manfe manltenure manlage manlexp) dec(3) addtext(Division FE, Yes, Month FE, Yes, Year FE, Yes, Model, LPM) ***Cox model gen coxstopper=0 if spellendperiod==380 replace coxstopper=1 if coxstopper==. stset mantenperiod, failure(coxstopper) stcox manfe, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, Cox) stcox manfe dif1manfe, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, Cox) stcox manfe dif1manfe manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) keep(manfe dif1manfe manlage manlexp) dec(3) addtext(Division FE, No, Month FE, Yes, Year FE, Yes, Model, Cox) ***********************************EXAMINE THE SPEED OF LEARNING************************** xtset manestid manestobsperiods ***How well can we predict your estimate 1 or 5 periods in the future in each period? *At entry reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==1 *outreg2 using predictquality, excel replace slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 1) quietly ereturn list gen R2fe1=e(r2) if manestobsperiodstrunc==1 gen R2afe1=e(r2_a) if manestobsperiodstrunc==1 gen R2anofe1=e(r2_a) if manestobsperiodstrunc==1 reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==1 & manmaxestobsperiods>50 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, Sel, Lag, 1) quietly ereturn list gen R2fe1sel=e(r2) if manestobsperiodstrunc==1 gen R2afe1sel=e(r2_a) if manestobsperiodstrunc==1 gen R2anofe1sel=e(r2_a) if manestobsperiodstrunc==1 reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==5 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 5) quietly ereturn list gen R2fe5=e(r2) if manestobsperiodstrunc==5 gen R2afe5=e(r2_a) if manestobsperiodstrunc==5 gen R2anofe5=e(r2_a) if manestobsperiodstrunc==5 reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==5 & manmaxestobsperiods>50 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, Sel, Lag, 5) quietly ereturn list gen R2fe5sel=e(r2) if manestobsperiodstrunc==5 gen R2afe5sel=e(r2_a) if manestobsperiodstrunc==5 gen R2anofe5sel=e(r2_a) if manestobsperiodstrunc==5 *Does your entry division predict your quality? reg manfe i.manentrydiv if manestobsperiodstrunc==1 outreg2 using ReplyTable2, excel replace slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 1) reg manfe i.manentrydiv if manestobsperiodstrunc==5 outreg2 using ReplyTable2, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 5) *Moving along the career path quietly{ forvalues t=2/50{ noisily di `t' in y *no lag reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==`t' quietly ereturn list replace R2anofe1=e(r2_a) if manestobsperiodstrunc==`t' replace R2anofe5=e(r2_a) if manestobsperiodstrunc==`t' & `t'>5 reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manestobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2anofe1sel=e(r2_a) if manestobsperiodstrunc==`t' replace R2anofe5sel=e(r2_a) if manestobsperiodstrunc==`t' & `t'>5 *lag 1 reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag1manfe if manestobsperiodstrunc==`t' quietly ereturn list replace R2fe1=e(r2) if manestobsperiodstrunc==`t' replace R2afe1=e(r2_a) if manestobsperiodstrunc==`t' reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag1manfe if manestobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2fe1sel=e(r2) if manestobsperiodstrunc==`t' replace R2afe1sel=e(r2_a) if manestobsperiodstrunc==`t' } *lag 5 forvalues t=6/50{ noisily di `t' in y reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag5manfe if manestobsperiodstrunc==`t' quietly ereturn list replace R2fe5=e(r2) if manestobsperiodstrunc==`t' replace R2afe5=e(r2_a) if manestobsperiodstrunc==`t' reg manfe manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag5manfe if manestobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2fe5sel=e(r2) if manestobsperiodstrunc==`t' replace R2afe5sel=e(r2_a) if manestobsperiodstrunc==`t' } } collapse R2*, by(manestobsperiodstrunc) save learning.dta, replace restore ***********************************************part 6.2: the added win%******************************************************** ****Now create a panel of observations as time and manid as cross preserve drop if wpobservedperiod==0 gen month=period-10*floor(period/10) gen manwpobsperiodstrunc=manwpobsperiods replace manwpobsperiodstrunc=51 if manwpobsperiods>50 xtset manestid manwpobsperiods ****Create difference for var manaddwinperc: gen dif1X=D.X ****Create some meaningful lags for var manaddwinperc: gen lag5X=L5.X for var manaddwinperc: gen lag1X=L.X for var manaddwinperc: gen lagdif1X=D.dif1X sum lag5* lag1* ***************************************EXAMINE ATTRITION********************************* *****Generate a table by quintile of tenure bysort mantenperiod: egen tenperiodobs=count(manaddwinperc) egen maxtenperiodobs=max(tenperiodobs) gen quinttenperiods=int(tenperiodobs/(maxtenperiodobs/5)-0.01)+1 sum tenperiodobs tab quinttenperiods sort mantenperiod gen quint1tenobs=1 if quinttenperiods[_n-1]==5 & quinttenperiods[_n]==4 gen quint2tenobs=1 if quinttenperiods[_n-1]==4 & quinttenperiods[_n]==3 gen quint3tenobs=1 if quinttenperiods[_n-1]==3 & quinttenperiods[_n]==2 gen quint4tenobs=1 if quinttenperiods[_n-1]==2 & quinttenperiods[_n]==1 replace quint1tenobs=quint1tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint2tenobs=quint2tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint3tenobs=quint3tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint4tenobs=quint4tenobs[_n-1] if mantenperiod[_n]==mantenperiod[_n-1] replace quint1tenobs=0 if quint1tenobs==. replace quint2tenobs=0 if quint2tenobs==. replace quint3tenobs=0 if quint3tenobs==. replace quint4tenobs=0 if quint4tenobs==. tabstat mantenperiod if quint1tenobs==1, stat(mean sd) tabstat mantenperiod if quint2tenobs==1, stat(mean sd) tabstat mantenperiod if quint3tenobs==1, stat(mean sd) tabstat mantenperiod if quint4tenobs==1, stat(mean sd) tabstat manaddwinperc if mantenperiod==1, by(spellstartdiv) stat(co mean sd) tabstat manaddwinperc if quint1tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manaddwinperc if quint2tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manaddwinperc if quint3tenobs==1, by(spellstartdiv) stat(co mean sd) tabstat manaddwinperc if quint4tenobs==1, by(spellstartdiv) stat(co mean sd) ***LPM model reg manfireperiod manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manfireperiod manaddwinperc dif1manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manfireperiod manaddwinperc dif1manaddwinperc manltenure manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1_extra, excel append keep(manaddwinperc dif1manaddwinperc manltenure manlage manlexp) slow(750) dec(3) addtext(Division FE, Yes, Month FE, Yes, Year FE, Yes, Model, LPM) reg manterminationperiod manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manterminationperiod manaddwinperc dif1manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, LPM) reg manterminationperiod manaddwinperc dif1manaddwinperc manltenure manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1_extra, excel append keep(manaddwinperc dif1manaddwinperc manltenure manlage manlexp) slow(750) dec(3) addtext(Division FE, Yes, Month FE, Yes, Year FE, Yes, Model, LPM) ***Cox model gen coxstopper=0 if spellendperiod==380 replace coxstopper=1 if coxstopper==. stset mantenperiod, failure(coxstopper) stcox manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, Cox) stcox dif1manaddwinperc manaddwinperc, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) dec(3) addtext(Division FE, No, Month FE, No, Year FE, No, Model, Cox) stcox dif1manaddwinperc manaddwinperc manlage manlexp i.spellstartdiv i.spellstartyear i.month, vce(bootstrap) outreg2 using TableD1_extra, excel append slow(750) keep(manaddwinperc dif1manaddwinperc manlage manlexp) dec(3)addtext(Division FE, Yes, Month FE, Yes, Year FE, Yes, Model, Cox) ***********************************EXAMINE THE SPEED OF LEARNING************************** ***How well can we predict your estimate 5 or 1 periods in the future in each period? *At entry reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==5 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 1) quietly ereturn list gen R2addwinperc5=e(r2) if manwpobsperiodstrunc==5 gen R2aaddwinperc5=e(r2_a) if manwpobsperiodstrunc==5 gen R2anoaddwinperc5=e(r2_a) if manwpobsperiodstrunc==5 reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==5 & manmaxestobsperiods>50 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, Sel, Lag, 1) quietly ereturn list gen R2addwinperc5sel=e(r2) if manwpobsperiodstrunc==5 gen R2aaddwinperc5sel=e(r2_a) if manwpobsperiodstrunc==5 gen R2anoaddwinperc5sel=e(r2_a) if manwpobsperiodstrunc==5 reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==1 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, No sel, Lag, 5) quietly ereturn list gen R2addwinperc1=e(r2) if manwpobsperiodstrunc==1 gen R2aaddwinperc1=e(r2_a) if manwpobsperiodstrunc==1 gen R2anoaddwinperc1=e(r2_a) if manwpobsperiodstrunc==1 reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==1 & manmaxestobsperiods>50 *outreg2 using predictquality, excel append slow(750) dec(3) addstat("Adj. R2", e(r2_a)) addtext(Sample, Sel, Lag, 5) quietly ereturn list gen R2addwinperc1sel=e(r2) if manwpobsperiodstrunc==1 gen R2aaddwinperc1sel=e(r2_a) if manwpobsperiodstrunc==1 gen R2anoaddwinperc1sel=e(r2_a) if manwpobsperiodstrunc==1 *Moving along the career path quietly{ forvalues t=2/50{ noisily di `t' in y *no lag reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==`t' quietly ereturn list replace R2anoaddwinperc1=e(r2_a) if manwpobsperiodstrunc==`t' replace R2anoaddwinperc5=e(r2_a) if manwpobsperiodstrunc==`t' & `t'>5 reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire if manwpobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2anoaddwinperc1sel=e(r2_a) if manwpobsperiodstrunc==`t' replace R2anoaddwinperc5sel=e(r2_a) if manwpobsperiodstrunc==`t' & `t'>5 *lag 1 reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag1manaddwinperc if manwpobsperiodstrunc==`t' quietly ereturn list replace R2addwinperc1=e(r2) if manwpobsperiodstrunc==`t' replace R2aaddwinperc1=e(r2_a) if manwpobsperiodstrunc==`t' reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag1manaddwinperc if manwpobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2addwinperc1sel=e(r2) if manwpobsperiodstrunc==`t' replace R2aaddwinperc1sel=e(r2_a) if manwpobsperiodstrunc==`t' } *lag5 forvalues t=6/50{ noisily di `t' in y reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag5manaddwinperc if manwpobsperiodstrunc==`t' quietly ereturn list replace R2addwinperc5=e(r2) if manwpobsperiodstrunc==`t' replace R2aaddwinperc5=e(r2_a) if manwpobsperiodstrunc==`t' reg manaddwinperc manlage* manlfirstpresent manforeign manplayedprof manplayengland mannumengteams manplaybigfour manexpint manplayermanager manothermanexp maninternhire lag5manaddwinperc if manwpobsperiodstrunc==`t' & manmaxestobsperiods>50 quietly ereturn list replace R2addwinperc5sel=e(r2) if manwpobsperiodstrunc==`t' replace R2aaddwinperc5sel=e(r2_a) if manwpobsperiodstrunc==`t' } } collapse R2*, by(manwpobsperiodstrunc) rename manwpobsperiodstrunc manestobsperiodstrunc merge 1:1 manestobsperiodstrunc using learning.dta, nogen save learning.dta, replace restore use learning.dta, replace ***********************Draw the graphs*********** gen xaxis1=manestobsperiodstrunc-1 gen xaxis5=manestobsperiodstrunc-5 replace xaxis5=. if xaxis5>45 replace xaxis1=. if xaxis5>50 twoway line R2afe1 R2afe1sel R2anofe1 R2anofe1sel xaxis1 if xaxis1>-1, xtitle(Months Observed) ytitle(Adj. R2) legend(label(1 "no selection, incl. current") label(2 "selection, incl. current") label(3 "no selection, no current") label(4 "selection, no current")) graphregion(color(white)) bgcolor(white) lpattern(longdash shortdash dash solid) color(black black black black) graph save FigureD1panelA.gph, replace twoway line R2afe5 R2afe5sel R2anofe5 R2anofe5sel xaxis5 if xaxis5>-1, xtitle(Months Observed) ytitle(Adj. R2) legend(label(1 "no selection, incl. current") label(2 "selection, incl. current") label(3 "no selection, no current") label(4 "selection, no current")) graphregion(color(white)) bgcolor(white) lpattern(longdash shortdash dash solid) color(black black black black) graph save FigureD1panelB.gph, replace twoway line R2aaddwinperc1 R2aaddwinperc1sel R2anoaddwinperc1 R2anoaddwinperc1sel xaxis1 if xaxis1>-1, xtitle(Months Observed) ytitle(Adj. R2) legend(label(1 "no selection, incl. current") label(2 "selection, incl. current") label(3 "no selection, no current") label(4 "selection, no current")) graphregion(color(white)) bgcolor(white) lpattern(longdash shortdash dash solid) color(black black black black) graph save FigureD1panelA_extra.gph, replace twoway line R2aaddwinperc5 R2aaddwinperc5sel R2anoaddwinperc5 R2anoaddwinperc5sel xaxis5 if xaxis5>-1, xtitle(Months Observed) ytitle(Adj. R2) legend(label(1 "no selection, incl. current") label(2 "selection, incl. current") label(3 "no selection, no current") label(4 "selection, no current")) graphregion(color(white)) bgcolor(white) lpattern(longdash shortdash dash solid) color(black black black black) graph save FigureD1panelB_extra.gph, replace cap log close clear*