513 0

[统计软件] 有foreach和没有foreach导出的outreg2结果一样,为什么还要加foreach [推广有奖]

  • 0关注
  • 0粉丝

初中生

66%

还不是VIP/贵宾

-

威望
0
论坛币
55 个
通用积分
4.3230
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
595 点
帖子
9
精华
0
在线时间
28 小时
注册时间
2021-9-24
最后登录
2024-4-16

楼主
玉兔捣药Nancy 发表于 2022-11-6 14:56:49 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
·foreach var of varlist DD_chn DD_f_chn poll_emp_so2_chn poll_emp_pt_chn poll_emp_no2_chn poll_emp_pca_chn {
        sort prefect_adj age_group year
        bysort prefect_adj age_group: gen f_`var'=`var'[_n+1]
        }
·ivreg2 d_All_mortality (f_shock_pca_chn=f_shock_pca_f_chn) i.region_year if age_group==1 & year>=1990 & year<=2000 [aweight=weight], endog(f_shock_pca_chn) first ffirst savefirst partial(i.region_year) cluster(province)
·matrix stat=e(first)
·local temp1=stat[15,1]
·outreg2 using "$dir/result/result_age0_future_f.tex", keep(f_shock_pca_chn f_DD_chn) dec(3) addstat("Fstat PollExpShock", `temp1') tex replace
·ivreg2 d_All_mortality (f_DD_chn=f_DD_f_chn) i.region_year if age_group==1 & year>=1990 & year<=2000 [aweight=weight], endog(f_DD_chn) first ffirst savefirst partial(i.region_year) cluster(province)
·matrix stat=e(first)
·local temp1=stat[15,1]
·outreg2 using "$dir/result/result_age0_future_f.tex", keep(f_shock_pca_chn f_DD_chn) dec(3) addstat("Fstat ExpShock", `temp1') tex append
·ivreg2 d_All_mortality (f_shock_pca_chn f_DD_chn=f_shock_pca_f_chn f_DD_f_chn) i.region_year if age_group==1 & year>=1990 & year<=2000 [aweight=weight], endog(f_shock_pca_chn f_DD_chn) first ffirst savefirst partial(i.region_year) cluster(province)
·matrix stat=e(first)
·local temp1=stat[15,1]
·local temp2=stat[15,2]
·outreg2 using "$dir/result/result_age0_future_f.tex", keep(f_shock_pca_chn f_DD_chn) dec(3) addstat("Fstat PollExpShock", `temp1',"Fstat ExpShock", `temp2') tex append

二维码

扫码加我 拉你入群

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

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

关键词:allowed Allow LOWE dog End

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

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-30 00:57