想想风吧 发表于 2019-6-8 23:12
做关于变量index的DF检验,可是一直显示<br>
no observations ,不知道怎么回事,请求各位帮帮小白我。 ...
gen month_new=month(month)
<br>
gen year=year(month)
<br>
tsset month
<br>
tsline index, title(\"苹果价格指数图形\") note(\"PJY制图\")
<br>
<br>
*========2
<br>
tsreport
<br>
mdesc
<br>
drop if month==.
<br>
drop if month_new==.
<br>
drop if index==.
<br>
<br>
cap gen ln_index=log(index)
<br>
gen rate=ln_index[_n]-ln_index[_n-1]
<br>
lab var rate \"苹果价格月度增长率\"
<br>
line rate month
<br>
<br>
*=========3
<br>
gen season=quarter(month)
<br>
tab season,gen(s)
<br>
reg index s2-s4
<br>
*由t检验可以看出,不存在显著季节性趋势。
<br>
order index month month_new year season ln_index rate
<br>
*==========4
<br>
dfuller index
<br>
<br>
dfuller index,lags(2)