楼主: chwcy
23467 12

[一般统计问题] 请教:stata中的Heckman命令如何执行? [推广有奖]

  • 0关注
  • 1粉丝

已卖:415份资源

博士生

75%

还不是VIP/贵宾

-

威望
0
论坛币
1945 个
通用积分
7.3578
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
4946 点
帖子
149
精华
0
在线时间
486 小时
注册时间
2005-5-9
最后登录
2023-5-8

楼主
chwcy 发表于 2005-9-5 09:30:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

例如:我想分析农户是否发生土地租佃,看作两个决策:第一个是是否租佃,是否租入用rentin表示,第二个是租佃规模,租入规模用landin表示,解释变量为age edu land等等,那么在Stata中用Heckman命令如何执行?我在stata8.0中打开后,从statistics中找到seleciton models,然后选择Heckman seleciton model(two step), 我不太明白selection DV是什么意思,必须在前面的方框里勾上,Selection independent variables中输入的变量与前面的Independent有什么区别?是否完全一样?Dependent variable是否输入landin?还有,Heckman seleciton model(ML)与Heckman seleciton model(two step)有何区别?刚学STATA,敬请高手指正,谢谢了。

二维码

扫码加我 拉你入群

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

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

关键词:heckman Stata tata HEC Man Stata 命令 heckman

沙发
zhuyurong123 发表于 2009-9-5 17:30:28
同问  高手呢?
加油

藤椅
johnayl 发表于 2009-9-5 23:00:41
try this:

heckman landin age edu land, select(rentin=age edu land xxx)

where xxx must be another IV that is not included in the predictive model.

also, it's always better to use the two step option, as convergence is less of a problem there.
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
gingerlinger + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

板凳
gongxiaobo2006 发表于 2011-3-9 22:18:54
我也不会啊,试一下看看吧
我是吉林大学商学院数经的,Q564778089
人人id 290226950

报纸
lavendercao 发表于 2011-8-13 13:13:53
怎么没有更详细的呢。

地板
芜华 发表于 2012-4-9 11:06:40
唉。。。。

7
南欧月宇 学生认证  发表于 2012-12-23 11:28:43
同求高手解答啊!!!学习用stata都知道到从那开始学习的好

8
fgleric 发表于 2012-12-23 11:48:02
刚刚编写了一个heckman two step的教程,参见下面代码:

/* how to construct Heckman  two step estimator*/

/* step 1: construct the primary equation: y=b0+b1*x1+b2*x2+u;*/
/* in order to avoid endogeneity, assume x1, x2 and u are IID Normal*/
clear
set obs 1000
gen x1=rnormal()
gen x2=rnormal()


/*for comparision purpose, assume b0=3,b1=0.5,b2=2*/
scalar b0=3
scalar b1=0.5
scalar b2=2

/*error term is from normal distribution*/
gen u=rnormal()

/*get simulated values of y*/
gen y=b0+b1*x1+b2*x2+u


/* step2: construct the selection function: dstar=c0+c1*x1+c2*x2+c3*z+v */
gen z=rnormal()
gen v=rnormal()
scalar c0=0.4
scalar c1=0.2
scalar c2=0.3
scalar c3=0.4
gen dstar=c0+c1*x1+c2*x2+c3*z+v

/* d=1 if dstar>0 and 0 otherwise*/
gen d=dstar>=0
replace y=. if d==0

/*step 3: do probit regression to get normalpdf(dhat)/normalcdf(dhat), or n1/n2*/
probit d x1 x2 z
predict dhat,xb
gen n1=normalden(dhat)
gen n2=normal(dhat)
gen gamma=n1/n2

/*step 4: put gamma into primary equation, and then do OLS;compare with no correction term*/
reg y x1 x2 gamma
reg y x1 x2

/*step 5: use STATA Package to compare the results*/
heckman y x1 x2, twostep select(d= x1 x2 z)
reg y x1 x2 gamma
已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
Sunknownay + 100 + 5 + 1 + 1 + 1 热心帮助其他会员

总评分: 经验 + 100  论坛币 + 5  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

9
sungmoo 发表于 2012-12-24 09:12:50

10
xingxf 发表于 2013-1-29 07:50:37
语法是:heckman depvar [indepvars] [if] [in], twostep select([depvar_s =] varlist_s [, noconstant]) [heckman_ts_options]
建议你看帮助文档里的示例,通过use网络数据,看看示例里的数据结构是怎么设置的,根据示例模仿,很容易操作的。

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

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