楼主: econfj
2687 9

[回归分析求助] treatment effect第二个stage的模型类型,只能是OLS吗? [推广有奖]

  • 1关注
  • 3粉丝

教授

19%

还不是VIP/贵宾

-

威望
0
论坛币
32534 个
通用积分
28.9504
学术水平
1 点
热心指数
5 点
信用等级
2 点
经验
1020 点
帖子
456
精华
0
在线时间
1621 小时
注册时间
2010-4-2
最后登录
2022-7-14

1500论坛币
在treatment effect的第一个stage是probit,然后得到IMR
第二个stage看到的都是OLS,然后把第一个stage得到的IMR放入第二个stage.

问题:第二个stage可以是probit或者negative binomial 吗? 如果可以,是不是也是把IMR直接放入到第二个stage?

非常感谢!



最佳答案

蓝色 查看完整内容

理论上是可以的 maddal的书上就有例子 程序估计需要自己编写。 或许你看看 cmp 命令 https://bbs.pinggu.org/thread-927406-1-1.html 这里原来讨论过相关的 Maximum likelihood estimation of endogenous switching and sample selection models for binary, ordinal, and count variables
关键词:treatment Effect treat stage FECT 模型
沙发
蓝色 发表于 2013-5-25 00:33:15 |只看作者 |坛友微信交流群
理论上是可以的
maddal的书上就有例子

程序估计需要自己编写。
或许你看看
cmp  命令


https://bbs.pinggu.org/thread-927406-1-1.html
这里原来讨论过相关的


Maximum likelihood estimation of endogenous switching and sample selection models for binary, ordinal, and count variables
Miranda, A. and Rabe-Hesketh, S. (2006) Maximum likelihood estimation.pdf (326.47 KB)

使用道具

藤椅
econfj 发表于 2013-5-27 16:33:14 |只看作者 |坛友微信交流群
有直接可以用的stata程序吗?many thanks!

使用道具

板凳
econfj 发表于 2013-5-28 20:32:03 |只看作者 |坛友微信交流群
蓝色 发表于 2013-5-25 11:22
理论上是可以的
maddal的书上就有例子
maddal的哪本书啊?maddal 一个印度的统计学家?

使用道具

报纸
蓝色 发表于 2013-5-28 22:25:56 |只看作者 |坛友微信交流群
G. S. Maddala, Limited Dependent and Qualitative Variables in Econometrics

使用道具

地板
econfj 发表于 2013-5-29 15:08:06 |只看作者 |坛友微信交流群
蓝色 发表于 2013-5-25 11:22
理论上是可以的
maddal的书上就有例子
我读了Maximum likelihood estimation of endogenous switching and sample selection models for binary, ordinal, and count variables.pdf, 觉得里面的ssm就是能解决我的问题的命令. 但是很奇怪的是不论是他paper里面的还是help文件的simulated examples,运行后都有出错信息.

paper里面的simulated example:
clear
set seed 12345678
set obs 3500
local lambda=0.4
gen double ve=invnormal(uniform())
gen double zeta=invnormal(uniform())
gen double tau=invnormal(uniform())
gen double x1=invnormal(uniform())
gen double x2=invnormal(uniform())
gen double x3=invnormal(uniform())
gen double x4=invnormal(uniform())
replace x3=(x3>0)
replace x4=(x4>0)
gen double selstar=0.58+0.93*x1+0.45*x2-0.64*x3+0.6*x4+(ve+zeta)/sqrt(2)
gen sel=(selstar>0)
gen double ystar=0.17+0.30*x1+0.11*x2+(`lambda'*ve+tau)/sqrt(1+`lambda'^2)
gen y=(ystar>0)
replace y=. if sel==0

*heckprob y x1 x2, select(sel=x1 x2 x3 x4)
ssm y x1 x2, s(sel=x1 x2 x3 x4) q(16) family(binom) link(probit) sel adapt

出错信息是:

(error occurred in ML computation)
(use trace option and check correctness of initial model)
equation id1_1l not found


help里面的simulated example:

clear
    set seed 12345678
    set obs 3500
    local lambda = 0.4
    gen double ve = invnorm(uniform())
    gen double zeta = invnorm(uniform())
    gen double tau = invnorm(uniform())
    gen double x1=invnorm(uniform())
    gen double x2=invnorm(uniform())
    gen double x3=invnorm(uniform())
    gen double x4=invnorm(uniform())
    gen selstar = 0.58 + 0.93*x1 + 0.45*x2 - 0.64*x3 + 0.6*x4 + (ve +  ///
        zeta)/sqrt(2)
    gen double sel = (selstar>0)
    gen double ystar = 0.30*x1 + 0.11*x2 + (`lambda'*ve +  ///
        tau)/sqrt(1+`lambda'^2)
    gen double ordvar = 0
    qui replace ordvar=1 if ystar>-0.40 & ystar<=0.17
    qui replace ordvar=2 if ystar>0.17 & ystar<=0.45
    qui replace ordvar=3 if ystar>0.45 & ystar<=0.80
    qui replace ordvar=4 if ystar>0.80 & ystar<=1.25
    qui replace ordvar=5 if ystar>1.25
    replace ordvar=. if sel==0


ssm y x1 x2, s(sel = x1 x2 x3 x4) q(15) fam(bin) link(probit) sel
出错信息是:

r(2000);


我到底什么地方弄错了,实在非常感谢!!!

使用道具

7
econfj 发表于 2013-6-5 14:42:52 |只看作者 |坛友微信交流群
蓝色 发表于 2013-5-25 11:22
理论上是可以的
maddal的书上就有例子
蓝色兄,你有运行国ssm命令嘛? thanks! 我想这就是我要的命令,但是我在我的电脑上运行不通.

使用道具

8
蓝色 发表于 2013-6-5 20:40:47 |只看作者 |坛友微信交流群
好像不行,你给命令作者写信问问吧

使用道具

9
h3327156 发表于 2013-6-5 21:25:46 |只看作者 |坛友微信交流群
econfj 发表于 2013-5-29 15:08
我读了Maximum likelihood estimation of endogenous switching and sample selection models for binary ...
"paper里面的simulated example: "
经测试这个是可以运行的。
运行的结果,我贴在下面给您看

Sample Selection Probit Regression
(Adaptive quadrature -- 16 points)

                                                     Number of obs  =     3500
                                                     Wald chi2(6)   =  1021.27
Log likelihood = -2915.0225                          Prob > chi2    =   0.0000
  
------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
y            |
          x1 |   .3770491   .0509867     7.40   0.000     .2771172    .4769811
          x2 |   .1400234   .0331205     4.23   0.000     .0751083    .2049384
       _cons |   .1274961   .0735357     1.73   0.083    -.0166311    .2716234
-------------+----------------------------------------------------------------
selection    |
          x1 |   .9681283   .0342559    28.26   0.000      .900988    1.035269
          x2 |   .4240503    .027396    15.48   0.000      .370355    .4777455
          x3 |  -.5845267   .0519791   -11.25   0.000    -.6864038   -.4826495
          x4 |   .6702432   .0528234    12.69   0.000     .5667113    .7737751
       _cons |   .4499317   .0430671    10.45   0.000     .3655217    .5343416
-------------+----------------------------------------------------------------
         rho |   .3929739     .11401     3.45   0.001     .0832102    .5465966
------------------------------------------------------------------------------
Likelihood ratio test for rho=0: chi2(1)= 9.95 Prob>=chi2 = 0.002


"help里面的simulated example:"
请细看人家建立的资料,
最后一步应当修正成
ssm ordvar x1 x2, s(sel = x1 x2 x3 x4) q(15) fam(bin) link(oprobit) sel
运行的结果,我贴在下面给您看

Sample Selection Ordered Probit Regression
(15 quadrature points)

                                                     Number of obs  =     3500
                                                     Wald chi2(6)   =  1165.04
Log likelihood = -5175.5765                          Prob > chi2    =   0.0000
  
------------------------------------------------------------------------------
      ordvar |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ordvar       |
          x1 |   .3154247   .0292513    10.78   0.000     .2580932    .3727563
          x2 |   .1470224   .0236525     6.22   0.000     .1006643    .1933805
-------------+----------------------------------------------------------------
selection    |
          x1 |   .9573866   .0356374    26.86   0.000     .8875386    1.027235
          x2 |    .421744   .0286755    14.71   0.000      .365541    .4779469
          x3 |  -.5968155   .0303954   -19.64   0.000    -.6563894   -.5372415
          x4 |   .6372247   .0308598    20.65   0.000     .5767405    .6977089
       _cons |   .5448698   .0288654    18.88   0.000     .4882946    .6014449
-------------+----------------------------------------------------------------
aux_ordvar   |
       _cut1 |  -.4012287   .0460497    -8.71   0.000    -.4914844    -.310973
       _cut2 |   .1583411    .041944     3.78   0.000     .0761323    .2405498
       _cut3 |   .4265039   .0409125    10.42   0.000     .3463168     .506691
       _cut4 |    .787388   .0404784    19.45   0.000     .7080518    .8667242
       _cut5 |   1.229028   .0420108    29.26   0.000     1.146688    1.311367
-------------+----------------------------------------------------------------
         rho |   .3181832   .0688194     4.62   0.000     .1624427    .4320005
------------------------------------------------------------------------------
Likelihood ratio test for rho=0: chi2(1)= 19.42 Prob>=chi2 = 0.000

使用道具

10
蓝色 发表于 2013-6-5 21:30:07 |只看作者 |坛友微信交流群
怪了,为什么我的也不能运行


http://www.stata.com/statalist/archive/2011-07/msg00738.html
看来有错的不止一两个人啊

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 12:26