quietly { /* DFBETAS are similar to DFITS. Instead of looking at the difference in fitted value when the i-th observation is included or exlcuded, DFBETAS looks at the change in each regression coefficient. The DFBETAs are standardized so we might be interested in values exceeding 2. But, in large samples this may underestimate changes in the regression coefficients due to deletion. Beleley et al. (1990) suggest a cutoff of 2/(n^.5) */ regress y x dfbeta rename DFx dfbeta1 regress y1 x dfbeta rename DFx dfbeta2 regress y2 x dfbeta rename DFx dfbeta3 local n=10 local dfbetap=2/(`n'^.5) local dfbetam=`dfbetap'*-1 local dfbetacrit=round(`dfbetap',.001) noisily di _n "dfbeta critical=" %5.3f `dfbetacrit' format dfbeta1 dfbeta2 dfbeta3 %9.4f noisily list x y dfbeta1 y1 dfbeta2 y2 dfbeta3, noobs divider format dfbeta1 dfbeta2 dfbeta3 %9.1f #delimit ; graph twoway (scatter dfbeta1 obs), ylabel(-.7(.2).7) xlabel(1(1)10) title("Original Data") yline(`dfbetam' 0 `dfbetap', lp(dash) lw(thick)) ytitle("") xtitle("") name(dfbeta1, replace) nodraw ; #delimit cr #delimit ; graph twoway (scatter dfbeta2 obs), ylabel(-.7(.2).7) xlabel(1(1)10) title("Scenario #1") yline(`dfbetam' 0 `dfbetap', lp(dash) lw(thick)) ytitle("") xtitle("") name(dfbeta2, replace) nodraw ; #delimit cr #delimit ; graph twoway (scatter dfbeta3 obs), ylabel(-.7(.3)1.9) xlabel(1(1)10) title("Scenario #2") yline(`dfbetam' 0 `dfbetap', lp(dash) lw(thick)) ytitle("") xtitle("") name(dfbeta3, replace) nodraw ; #delimit cr #delimit ; graph combine dfbeta1 dfbeta2 dfbeta3, title("Plot of DFBETAs") note("|DFBETA| > `dfbetacrit'") name(dfbeta, replace) ; #delimit cr drop dfbeta* }