1、为什么我跟着连老师的这个得出来的图形不一样(p1是我的,02是正常的)
2、pac图形我也得不出来结果显示invalid syntax
3、corrgram 命令结果显示if not allowed不知道为什么

4、连老师命令如下:
* 图形法:自相关系数图ac和偏自相关系数图pac
use B2_lutkepohl.dta, clear
tsset year
reg ln_consum ln_income
predict e1, res
* ac (auto-correlation cofficient)
* rho_j = Cov(y_t, y_t-j)/Var(y_t)
* pac (partial auto-correlation cofficient)
* phi_j = Cov(y_t|E(...t-j-1), y_t-j)
* reg y_t on y_t-1 y_t-2 ... y_t-j
ac e1 /*Auto-correlation*/
pac e1
corrgram e1,lags(8)
preserve /*white noise 的自相关和偏自相关函数*/
clear
set obs 100
gen x = invnorm(uniform())
gen t = _n
tsset t
ac x
restore
谢谢各位大佬解答
{:0_288:}{:0_288:}{:0_288:}


雷达卡



京公网安备 11010802022788号







