clear use "C:\Users\janva\Dropbox (Erasmus Universiteit Rotterdam)\0AAHULP\2021\Johan Cruijff\Revision August 2021\Data and analysis\ELO-rating.dta" drop score dif1 elohome2 dif2 eloaway2 d m y ppg PT_exp CumPT_exp gen FELO=(home=="Feyenoord")*(elohome1)+(home~="Feyenoord")*(eloaway1) gen TegenELO=(home=="Feyenoord")*(eloaway1)+(home~="Feyenoord")*(elohome1) ** Graphs ELO rating - Figure 2a *twoway line FELO wnr if season==1982,lcolor(black) lpattern(longdash) || line FELO wnr if season==1983,lcolor(blue) lpattern(solid)|| line FELO wnr if season==1984, lcolor(red) lpattern(longdash) ytitle("ELO-rating") title("") xtitle("Match") graphregion(color(white)) bgcolor(white) xlabel(2(2)34) legend(label(1 "Season 1982/83") label(2 "Season 1983/84")label(3 "Season 1984/85")) legend(cols(3)) gen TS1000=TS/1000 by season: gen cumTS=sum(TS1000) * Stadium attendance figure 2b *twoway line cumTS wnr if season==1982,lcolor(black) lpattern(longdash) || line cumTS wnr if season==1983,lcolor(blue) lpattern(solid)|| line cumTS wnr if season==1984, lcolor(red) lpattern(longdash) ytitle("Cumulative stadium attendance (1000)") title("") xtitle("Match") graphregion(color(white)) bgcolor(white) xlabel(2(2)34) legend(label(1 "Season 1982/83") label(2 "Season 1983/84")label(3 "Season 1984/85")) legend(cols(3)) ******* FIGURE 2 ******************* *hist TS1000 if season>1981, by(season) frequency graphregion(color(white)) width(5) xlabel(0(10)60) bstyle(outline) xtitle("Attendance (1000)") gen Fhome=home=="Feyenoord" gen opponent=away*Fhome+home*(1-Fhome) encode opponent,gen(tegenstander) sort season wnr gen points=(home=="Feyenoord")*((for>against)*2+(for==against))+(home~="Feyenoord")*((foragainst)+(home~="Feyenoord")*(for1981,robust reg goaldif jcdummy Fhome TegenELO100 if season>1981,robust reg win jcdummy Fhome TegenELO100 if season>1981,robust reg loss jcdummy Fhome TegenELO100 if season>1981,robust reg FELO100 jcdummy if season>1981,robust * Tabel 2b Performance II xtset tegenstander * non-linear xtreg points jcdummy Fhome if season>1981, fe robust xtreg goaldif jcdummy Fhome if season>1981, fe robust xtreg win jcdummy Fhome if season>1981, fe robust xtreg loss jcdummy Fhome if season>1981, fe robust by season: gen cumpoints=sum(points) sort season wnr gen lagcumpoints=cumpoints[_n-34] gen pointsurp=(cumpoints[_n-1]-lagcumpoints[_n-1])*(wnr>1) replace pointsurp = 0 in 35 gen weekday=wd<6 gen Jennett100=Jennett_ch*100 gen expect100=expected*100 gen Sparta=(away=="Sparta Rotterdam") gen PSV=(away=="PSV Eindhoven") ***************** * Table 2c attendance I reg TS1000 jcdummy pointsurp expect100 Jennett100 Sparta PSV weekday if away~="Ajax", robust reg TS1000 jcdummy pointsurp expect100 Sparta PSV if away~="Ajax", robust reg TS1000 jcdummy expect100 Sparta PSV if away~="Ajax", robust reg TS1000 jcdummy pointsurp Sparta PSV if away~="Ajax", robust reg TS1000 jcdummy if away~="Ajax", robust * Table 2d attendance II xtreg TS1000 jcdummy pointsurp expect100 Jennett100 weekday if away~="Ajax",fe robust xtreg TS1000 jcdummy pointsurp expect100 if away~="Ajax",fe robust xtreg TS1000 jcdummy expect100 if away~="Ajax",fe robust xtreg TS1000 jcdummy pointsurp if away~="Ajax",fe robust * Suggesties Thomas Peeters clear use "C:\Users\janva\Dropbox (Erasmus Universiteit Rotterdam)\0AAHULP\2021\Johan Cruijff\Revision August 2021\Data and analysis\ELO-rating.dta" gen TS1000=TS/1000 gen FELO=(home=="Feyenoord")*(elohome1)+(home~="Feyenoord")*(eloaway1) gen TegenELO=(home=="Feyenoord")*(eloaway1)+(home~="Feyenoord")*(elohome1) gen expected=(home=="Feyenoord")*(hw*0.02+dr*0.01)+(home~="Feyenoord")*(aw*0.02+dr*0.01) gen points=(home=="Feyenoord")*((for>against)*2+(for==against))+(home~="Feyenoord")*((for1) replace pointsurp = 0 in 35 * Table 3 Performance without JC season reg TS1000 jcdummy pointsurp expect100 Sparta PSV Jennett100 weekday if away~="Ajax" & season~=1983, robust predict TS1000a tabstat TS1000a TS1000 if away~="Ajax",by(season) * excluding last 4 matches tabstat TS1000a TS1000 if away~="Ajax" & wnr<31,by(season)