Hi folks,

I run a random effect model and would like to make a robustness test with monte carlo. I am pretty new in this field, and am unsure about the results.


my model

-----------
use "C:\STATA\20190118 fbdata.dta", replace
xtset ID year
xtreg MATH football age sex parentaleducation parentalincome, re
-----------


my monte carlo simulation:

-----------
capture program drop regprog
program regprog, rclass
drop _all
set obs 100
use "C:\STATA\20190118 fbdata.dta", replace
gen u=invnorm(uniform())
xtset ID year
xtreg MATH football+u age sex parentaleducation year
return scalar b0 = _coef[_cons]
return scalar b1 = _coef[football]
return scalar b2 = _coef[age]
return scalar b3 = _coef[sex]
return scalar b4 = _coef[parentaleducation]
return scalar b5 = _coef[year]
return scalar b6 = u
end

simulate b0 = r(b0) b1 = r(b1) b2 = r(b2) b3 = r(b3) b4 = r(b4) b5 = r(b5) b6 = r(b6), reps(100): regprog
sum
histogram b1, kdensity plot(function stdnorm = normalden(x,0,1), lpattern(dash))

----------------

the results seems to look weird.

for the random effect model I get
MATH
football 0.838
age 4.935
sex -0.586
parentaleducation 0.882
year 0.183
for the monte carlo simulation I get
b0 -173
b1 -0.041
b2 4.986
b3 -0.543
b4 0.878
b5 0.181
b6 0.164

On my interpretation, the values look all very good. also u is with 0.164 close to 0. but why is b1 so different from the coefficient of football? When I change the random variable to i.e. sex, I have the same phenomenon. All coefficients are almost identical to the monte carlo simulation but not sex, even if the error term has a standard deviation.

can somebody help me to get the point? thank you very much for your appreciate help!