全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
589 0
2024-10-28

cd "D:\nev"

use 数据.dta //数据存放于D盘名为“nev”的文件夹

*(1) OLS-LOGIT 得到表6OLS(1)-(3)列结果

reg y price_actual lic cpk hp_w  mktdum2-mktdum29 ctg2-ctg3,r

est store ols_logit1

reg y price_actual lic cpk hp_w ftdum_erev ftdum_bev ftdum_phev mktdum2-mktdum29 ///

ctg2-ctg3,r

est store ols_logit2

reg y price_actual lic cpk hp_w ftdum_erev ftdum_bev ftdum_phev ///

typedum_mpv typedum_suv typedum_sports mktdum2-mktdum29 ctg2-ctg3,r

est store ols_logit3

*(2) IV-LOGIT 得到表6OLS(4)-(6)列结果

ivregress 2sls y lic cpk hp_w mktdum2-mktdum29 ///

(price_actual = iv2_f_lic iv2_f_cpk iv2_f_hp_w  ///

iv3_r_lic iv3_r_cpk iv3_r_hp_w ) ctg2-ctg3, r

est store iv_logit1

ivregress 2sls y lic cpk hp_w ftdum_erev ftdum_bev ftdum_phev mktdum2-mktdum29 ///

(price_actual = iv2_f_lic iv2_f_cpk iv2_f_hp_w iv2_f_ftdum_erev iv2_f_ftdum_bev ///

iv2_f_ftdum_phev ///

iv3_r_lic iv3_r_cpk iv3_r_hp_w iv3_r_ftdum_erev iv3_r_ftdum_bev ///

iv3_r_ftdum_phev ) ctg2-ctg3, r   

est store iv_logit2

ivregress 2sls y lic cpk hp_w ftdum_erev ftdum_bev ftdum_phev  ///

typedum_mpv typedum_suv typedum_sports mktdum2-mktdum29 ///

( price_actual = iv2_f_lic iv2_f_cpk iv2_f_hp_w iv2_f_ftdum_erev iv2_f_ftdum_bev ///

iv2_f_ftdum_phev iv2_f_typedum_mpv iv2_f_typedum_suv iv2_f_typedum_sports ///

iv3_r_lic iv3_r_cpk iv3_r_hp_w iv3_r_ftdum_erev iv3_r_ftdum_bev ///

iv3_r_ftdum_phev iv3_r_typedum_mpv iv3_r_typedum_suv iv3_r_typedum_sports) ctg2-ctg3, r   

est store iv_logit3

ssc install estout

* 报告结果,得到表6

esttab ols_logit1 ols_logit2 ols_logit3 ///

iv_logit1 iv_logit2 iv_logit3 ///

using results_logit.rtf, ///

star(* 0.10 ** 0.05 *** 0.01) r2 ar2 se replace nogap ///

b(%9.4f) se(%9.4f) //保留4位小数

code来源:
国栋,罗瑞琦,谷永芬.政府推广政策与新能源汽车需求:来自上海的证据[J].中国工业经济,2019,(04):42-61.

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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