As my diagram indicates, xtreg, fe is OLS (and vice versa) under special conditions. In general, it's not OLS. Only if you remove all between-unit variance by subtracting off the group means do they become equivalent. It's kinda like asking if correlation is the same thing as ANOVA is the same thing as regression is the same thing as a T-test. Well, under certain conditions, yes, they are the same. But only if the right conditions (one dummy variable and one continuous variable) are they the same. They overlap, but only under special conditions.
Code:
clear set seed 1971 set obs 150 gen y=rnormal() gen x=1 if y>0 & uniform()>.75 replace x=0 if x==. pwcorr y x, sig ttest y, by(x) reg y x anova y x
Comment