楼主: yffhm
13705 31

[面板数据求助] bootstrap结果分析 [推广有奖]

21
yffhm 学生认证  发表于 2014-4-5 19:37:33
jjjj6666 发表于 2014-4-4 22:25
you commented cout "xtreg" in the program bootsXtregF, xtreg was not run in the bootstrap, that may  ...
什么意思?不太明白  能说下怎么修正吗?

22
jjjj6666 发表于 2014-4-5 21:24:01
you have a "*" in front of xtreg, delete "*"

23
yffhm 学生认证  发表于 2014-4-7 11:25:19
jjjj6666 发表于 2014-4-5 21:24
you have a "*" in front of xtreg, delete "*"
谢谢  我在尝试一下 这样就能就得出的P值对门槛效应是否显著进行判断了吧?

24
zhizhelege 发表于 2014-4-7 17:14:26
不是有提示了吗

25
yffhm 学生认证  发表于 2014-4-9 23:03:54
jjjj6666 发表于 2014-4-5 21:24
you have a "*" in front of xtreg, delete "*"
你好 能不能说一下如何在上述模拟结果的基础上  在进行一次模拟  即通过不断的模拟 达到自己想要的显著性水平  也就是多次重复以上过程 万分谢谢

26
jjjj6666 发表于 2014-4-14 03:07:02
you can do a outside loop with different seed and record the result for each loop.  Is this a good practice by manipulating the results?

27
yffhm 学生认证  发表于 2014-4-14 20:53:10
jjjj6666 发表于 2014-4-14 03:07
you can do a outside loop with different seed and record the result for each loop.  Is this a good p ...
能否说一下具体在stata中如何操作呢?谢谢

28
jjjj6666 发表于 2014-4-15 04:26:08
using reg as an example,

reg y x
predict xb
mat F=e(F)
predict r, r
tempfile f1
save `f1'

use `f1'

cap prog drop bootsRegF
prog def bootsRegF, rclass
  preserve
  bsample
  gen new_y = xb+r
  * if treating x as fixed
  reg new_y x
  *reg y x
  return sca F = e(F)
  restore
end

local iter = 20
mat R = J(`iter',4,.)
qui forv i=1/`iter' {
        if `i' == 1 {
                noi _dots 0
        }
        noi _dots `i' 0
        drop _all
        use `f1'
        set seed `i'
        simulate F=r(F), reps(20) : bootsRegF
        bstat, stat(F)
        mat b=e(b)
        mat b_bs=e(b_bs)
        mat se = e(se)
        mat R[`i',1] = `i'
        mat R[`i',2] = b[1,1]
        mat R[`i',3] = b_bs[1,1]
        mat R[`i',4] = se[1,1]
}

drop _all
svmat R
rename R1 seed
rename R2 est
rename R3 bs_est
rename R4 bs_se

29
yffhm 学生认证  发表于 2014-4-17 19:03:58
jjjj6666 发表于 2014-4-15 04:26
using reg as an example,

reg y x
太厉害了  不得不佩服

30
yffhm 学生认证  发表于 2014-5-3 10:31:36
jjjj6666 发表于 2014-4-15 04:26
using reg as an example,

reg y x
不得不说太厉害了!还有一个疑问  这样运行完之后 怎么得出P值呢?谢谢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 21:15