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)


雷达卡



京公网安备 11010802022788号







