***************************START HERE********************************************** * A small do-file to calculate AIC and SIC in STATA 6.0 * use "C:\Econ472\auto2.dta" * gen t=_n * label variable t "Integer time period" * tsset t * * Model 1.1: Full Model regress gas L.gas LD.gas price D.price LD.price income D.income LD.income matrix b1=get(_b) scalar AIC1=log(_result(4)/_result(1))+(colsof(b1)/_result(1))*2 scalar SIC1=log(_result(4)/_result(1))+(colsof(b1)/_result(1))*log(_result(1)) * * Model 1.2: Drop LD.income regress gas L.gas LD.gas price D.price LD.price income D.income matrix b2=get(_b) scalar AIC2=log(_result(4)/_result(1))+(colsof(b2)/_result(1))*2 scalar SIC2=log(_result(4)/_result(1))+(colsof(b2)/_result(1))*log(_result(1)) * * Model 1.3: Drop LD.price regress gas L.gas LD.gas price D.price income D.income LD.income matrix b3=get(_b) scalar AIC3=log(_result(4)/_result(1))+(colsof(b3)/_result(1))*2 scalar SIC3=log(_result(4)/_result(1))+(colsof(b3)/_result(1))*log(_result(1)) * * Model 1.4: Drop LD.gas regress gas L.gas price D.price LD.price income D.income LD.income matrix b4=get(_b) scalar AIC4=log(_result(4)/_result(1))+(colsof(b4)/_result(1))*2 scalar SIC4=log(_result(4)/_result(1))+(colsof(b4)/_result(1))*log(_result(1)) * * Model 1.5: Drop LD.price, LD.income regress gas L.gas LD.gas price D.price income D.income matrix b5=get(_b) scalar AIC5=log(_result(4)/_result(1))+(colsof(b5)/_result(1))*2 scalar SIC5=log(_result(4)/_result(1))+(colsof(b5)/_result(1))*log(_result(1)) * * Model 1.6: Drop LD.gas, LD.income regress gas L.gas price D.price LD.price income D.income matrix b6=get(_b) scalar AIC6=log(_result(4)/_result(1))+(colsof(b6)/_result(1))*2 scalar SIC6=log(_result(4)/_result(1))+(colsof(b6)/_result(1))*log(_result(1)) * * Model 1.7: Drop LD.gas, LD.price regress gas L.gas price D.price income D.income LD.income matrix b7=get(_b) scalar AIC7=log(_result(4)/_result(1))+(colsof(b7)/_result(1))*2 scalar SIC7=log(_result(4)/_result(1))+(colsof(b7)/_result(1))*log(_result(1)) * * Model 1.8: Drop LD.gas, LD.price, LD.income regress gas L.gas price D.price income D.income matrix b8=get(_b) scalar AIC8=log(_result(4)/_result(1))+(colsof(b8)/_result(1))*2 scalar SIC8=log(_result(4)/_result(1))+(colsof(b8)/_result(1))*log(_result(1)) * * Model 1.9: Drop LD.gas, LD.price, D.income, LD.income regress gas L.gas price D.price income matrix b9=get(_b) scalar AIC9=log(_result(4)/_result(1))+(colsof(b9)/_result(1))*2 scalar SIC9=log(_result(4)/_result(1))+(colsof(b9)/_result(1))*log(_result(1)) * * Model 1.10: Drop LD.gas, D.price, LD.price, LD.income regress gas L.gas price income D.income matrix b10=get(_b) scalar AIC10=log(_result(4)/_result(1))+(colsof(b10)/_result(1))*2 scalar SIC10=log(_result(4)/_result(1))+(colsof(b10)/_result(1))*log(_result(1)) * * Model 1.11: Drop LD.gas, D.price, LD.price, D.income, LD.income regress gas L.gas price income matrix b11=get(_b) scalar AIC11=log(_result(4)/_result(1))+(colsof(b11)/_result(1))*2 scalar SIC11=log(_result(4)/_result(1))+(colsof(b11)/_result(1))*log(_result(1)) * * Model 1.12: Drop all lags and differences regress gas price income matrix b12=get(_b) scalar AIC12=log(_result(4)/_result(1))+(colsof(b12)/_result(1))*2 scalar SIC12=log(_result(4)/_result(1))+(colsof(b12)/_result(1))*log(_result(1)) * * List all calculated AICs and SICs scalar list clear *****************************END HERE**********************************************