全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 统计软件培训班VIP答疑区
1562 1
2011-07-22
本人想用模拟的方法重现,AB(1991)文章,表2倒数第2列的内容,但模拟结果和文中相差很大,重复多次仍然如此,不知是什么原因?望连老师指点。程序如下,该程序计算了在a=0.2,0.8,0.5时,拒绝原假设的个数。为了节省时间,只循环了20次。原文的链接在https://bbs.pinggu.org/thread-1138852-1-1.html  的附件中。


local reps=20
foreach b of numlist 0.5 0.2 0.8 {
mat P = J(`reps',1,.)
forval i=1/`reps' {
qui xtarsim y x eta, n(100) t(7) gamma(`b') beta(1) rho(0.8) one(rand 1) sn(9)
xtabond y x
est store onestep
gen ly=l.y
qui reg y ly x
est store ols
qui hausman  onestep ols   
mat P[`i',1] = scalar(r(chi2))
}
svmat P, names(p)
keep p1
drop if _n>`reps'
qui count  if p1>invchi2(1,0.95)
local c=`b'*10
scalar n_onesh_`c'=r(N)
}
dis n_onesh_5
dis n_onesh_2
dis n_onesh_8

运行结果如下:

. dis n_onesh_5
13
.
. dis n_onesh_2
20
.
. dis n_onesh_8
2
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-7-23 21:29:10
我这两天在外地出差,要到29号才能抽出时间回答这个问题,望见谅。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群