悬赏 68 个论坛币 未解决
Do a Monte Carlo experiment by following the following procedure
let b_0=b_1=1
step1) draw xi(i=1~n) from chisq distribution (df=4)
step2) draw u1i(i=1~n) from standard nomal distribution; u2i (i=1~n)from chisq distribution (df=1); u3i(i=1~n) from t distribution (df=2) (nsize=10)
step3) define yji=b_0+b_1xi+uji , for j=1,2,3
step4) OLS estimators for bhat _1with {(xi, y1i)}(i=1~n) is bhat_11,{(xi, y1i)}(i=1~n) is bhat_12,{(xi, y1i)}(i=1~n) is bhat_13
step5)compute tj =(bhat_1j - b_1)/s.e(bhat_1j) for j=1,2,3
repeat (step1)through (step5) b=10000 times so that you have 10000 many t1,t2,t3 for n=10,30,100.
compare the empirical pdf's of tj, j=1,2,3 with the pdf of N(0,1)
疑问:
1)怎样将stata中simulation的命令用于t值?
2)想在得出的t值的直方图上画上标准正太分布的pdf,以便做比较,是用hist ~~,norm freq吗?
3)stata做回归的时候,t值结果会自动保存为什么格式?比如系数为e(b),系数方差为e(v),那么t- value呢?需要自己generate t=_b[x1]/_se[x1]才可以吗?
4)请大侠们给出具体的命令好吗?