977 2

[程序分享] 【久菜盒子stata程序分享】svar程序与代码-留言答疑-已实现过 [推广有奖]

  • 1关注
  • 0粉丝

已卖:1份资源

硕士生

29%

还不是VIP/贵宾

-

威望
0
论坛币
2728 个
通用积分
0.2329
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1011 点
帖子
57
精华
0
在线时间
214 小时
注册时间
2022-3-31
最后登录
2024-1-22

楼主
久菜盒子工作室 发表于 2022-11-11 10:13:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
save "G:\公众号:久菜盒子工作室\2022年6月\stata.dta", replace
cd
replace trall=ln(1+trall)
replace outp=ln(1+outp)
replace imp=ln(1+imp)
replace surp=ln(1+surp) if surp>0
replace surp=ln(1-surp) if surp<0
replace dtrall=ln(1+dtrall) if dtrall>0
replace doutp=ln(1+doutp)   if doutp>0
replace dimp=ln(1+dimp)     if dimp>0
replace dtrall=ln(1-dtrall) if dtrall<0
replace doutp=ln(1-doutp)   if doutp<0
replace dimp=ln(1-dimp)     if dimp<0
replace dsurp=ln(1+dsurp) if dsurp>0
replace dsurp=ln(1-dsurp) if dsurp<0
sum2docx er trall outp imp surp dtrall doutp dimp dsurp  using 描述性统计056.docx,replace stats (N mean(%9.3f) median(%9.3f) min(%9.3f) max(%9.3f) p25 p75 sd) title("描述性统计")
clear
encode t1,gen(tt1)
encode t2,gen(tt2)
drop t1 t2
sum2docx er trall outp imp surp dtrall doutp dimp dsurp  trallr outpr impr surpr using 描述性统计056.docx,replace stats (N mean(%9.3f) median(%9.3f) min(%9.3f) max(%9.3f) p25 p75 sd) title("描述性统计")
dfuller er
tset t1
tset tt1
dfuller er
dfuller outp
dfuller imp
dfuller surp
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
dfuller trall
dfuller outp
dfuller imp
dfuller surp
* ***********************************************************************************************************************************************************
* ***********************************************************************************************************************************************************
dfuller trallr
dfuller outpr
dfuller impr
dfuller surpr
help dfuller
dfuller surpr
help dfuller,nonconstant
dfuller surpr
help dfuller
help dfuller,noconstant
help dfuller, noconstant
dfuller surpr
dfuller surpr, noconstant
dfuller surpr, trend
* *******进行调整****************************************************************************************************************************************************
dfuller trall,trend
dfuller outp,,trend
dfuller outp,trend
dfuller imp,trend
dfuller surp,,trend
dfuller surp,trend
dfuller er,trend
dfuller er,trend noconstant
dfuller er,trend
dfuller er,trend lag(1)
dfuller er,trend lag(2)
dfuller er,trend lag(3)
dfuller er,trend lag(4)
dfuller er,trend lag(5)
dfuller er,trend lag(6)
dfuller er,trend lag(7)
dfuller er
dfuller er
dfuller trall,trend
dfuller outp,trend
dfuller imp,trend
dfuller surp,trend
save "G:\公众号:久菜盒子工作室\2022年6月\分析第一部分er.dta"
save "G:\公众号:久菜盒子工作室\2022年6月\分析第一部分er.dta", replace
clear
dfuller der,trend
clear
encode t2,gen(t)
tset t
dfuller er,trend
dfuller der,trend
dfuller der
dfuller der,trend
clear
encode t2,gen(t)
tset t
dfuller err
clear
clear
tset t
encode t2,gen(t)
tset t
* *******确定最优阶数****************************************************************************************************************************************************
clear
replace dtrall=ln(1+dtrall) if dtrall>0
replace doutp=ln(1+doutp)   if doutp>0
replace dimp=ln(1+dimp)     if dimp>0
replace dtrall=ln(1-dtrall) if dtrall<0
replace doutp=ln(1-doutp)   if doutp<0
replace dimp=ln(1-dimp)     if dimp<0
replace dsurp=ln(1+dsurp) if dsurp>0
replace dsurp=ln(1-dsurp) if dsurp<0
dfuller der
dfuller dtrall
encode t2,gen(t)
tset t
dfuller der
dfuller dtrall
dfuller doutp
dfuller dimp
dfuller dsurp
replace er=ln(1+er)
replace trall=ln(1+trall)
replace outp=ln(1+outp)
replace imp=ln(1+imp)
replace surp=ln(1+surp) if surp>0we
replace surp=ln(1-surp) if surp<0
replace surp=ln(1+surp) if surp>0
dfuller er
dfuller trall
dfuller outp
dfuller imp
dfuller surp
***********************************************************************************************************************************************
dfuller er,trend
dfuller trall,trend
dfuller outp,trend
dfuller imp,trend
dfuller surp,trend
varsoc der dtrall doutp dimp dsurp,maxlag(10)
varsoc der dtrall doutp dimp dsurp,maxlag(5)
varsoc der dtrall doutp dimp dsurp,maxlag(6)
varsoc der dtrall doutp dimp dsurp,maxlag(5)
varsoc err trallr outpr impr surpr,maxlag(5)
vecrank der dtrall doutp dimp dsurp,lag(3)
vecrank der dtrall doutp dimp dsurp,lag(5)
xtcointtest kao  der dtrall doutp dimp dsurp
gen order=1
xtset order t
xtcointtest kao  der dtrall doutp dimp dsurp
var  der dtrall doutp dimp dsurp , lags(1/3) dfk small
vecrank  err trallr outpr impr surpr,lag(2)
vecrank  err trallr outpr impr ,lag(2)
varsoc der dtrall doutp dimp ,maxlag(6)
vecrank der dtrall doutp dimp,lag(3)
vargranger
var  der dtrall doutp dimp dsurp , lags(1/3) dfk small
vargranger
matlist e(Sigma)
quietly var  der dtrall doutp dimp dsurp , lags(1/3) dfk small
irf create var1, step(20) set(myirf) replace
irf graph oirf, impulse( der dtrall doutp dimp dsurp )   response( der dtrall doutp dimp dsurp )  yline(0,lcolor(black))   xlabel(0(4)20)  byopts(yrescale)
irf graph oirf, impulse( der )   response( der dtrall doutp dimp dsurp )  yline(0,lcolor(black))   xlabel(0(4)20)  byopts(yrescale)
quietly var  der dtrall doutp dimp dsurp , lags(1/3) dfk small
irf create Response, step(20) set(myirf) replace
irf graph oirf, impulse( der )   response(dtrall doutp dimp dsurp )  yline(0,lcolor(black))   xlabel(0(4)20)  byopts(yrescale)
quietly var  der dtrall doutp dimp dsurp , lags(1/3) dfk small
irf create Response, step(20) set(myirf) replace
irf graph oirf, impulse( der )   response(dtrall doutp dimp dsurp )  yline(0,lcolor(black))   xlabel(0(4)20)  byopts(yrescale)


二维码

扫码加我 拉你入群

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

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

关键词:stata程序 Stata SVAR tata VaR
相关内容:stata代码实现

沙发
久菜盒子工作室 发表于 2022-11-11 10:14:34
【免费经管数据】上市公司偿债能力数据集截止至2022年
https://bbs.pinggu.org/thread-11246442-1-1.html

藤椅
久菜盒子工作室 发表于 2022-11-11 10:15:44
【免费经管数据】上市公司偿债能力数据集截止至2022年  https://bbs.pinggu.org/thread-11246442-1-1.html
【久菜盒子stata程序分享】svar程序与代码-留言答疑-已实现过 https://bbs.pinggu.org/forum.php ... ;extra=#pid84052112

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

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