version 12.1
* Compositional differences
use http://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear
ttest educ, by(black)
ttest jobexp, by(black)
ttest income, by(black)
* Differences in effects
use http://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear
* estimate model for blacks
regress income educ jobexp if black == 1
est store black
* estimate model for whites
regress income educ jobexp if black == 0
est store white
* estimate pooled model
regress income educ jobexp
est store both
* Test for any differences in coefficients
lrtest (black white) both, stats
* Appendix A: Incremental F test
use http://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear
bysort black: regress income educ jobexp
reg income educ jobexp
di invF(3,494,.95)
di Ftail(3,494,14.91)
* Appendix B: Wald test & Suest command
use http://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear
reg income educ jobexp if !black
est store white
reg income educ jobexp if black
est store black
suest black white
* Include the constant in the equality tests
test [black_mean = white_mean], constant coef
* Allow the constants to differ while other coefficients are the same
test [black_mean = white_mean], coef