*Open dataset "brown_yucel_date.dta" in stata then run this dofile. *adf tests: varsoc to select lags *ln_hh varsoc ln_hh if week_no < 523 *Use 2 lags for dfuller on ln_hh based on SBIC. No trend or drift based on visualization. week_no 522 correspinds to end of BY sample. dfuller ln_hh if week_no <523, lags(2) gen dln_hh = D.ln_hh varsoc dln_hh if week_no < 523 *Use one lag for dln_hh based on SBIC dfuller dln_hh if week_no <523, lags(1) *Now full sample varsoc ln_hh dfuller ln_hh, lags(2) varsoc dln_hh dfuller dln_hh, lags(1) *Now with trends dfuller ln_hh if week_no <523, trend lags(2) dfuller ln_hh, trend lags(2) *ln_wti varsoc ln_wti if week_no < 523 dfuller ln_wti if week_no < 523, lags(3) gen dln_wti = D.ln_wti if week_no < 523 dfuller dln_wti if week_no < 523, lags(2) varsoc ln_wti dfuller ln_wti, lags(4) varsoc dln_wti dfuller dln_wti, lags(3) *Now with trends dfuller ln_wti if week_no <523, trend lags(3) dfuller ln_wti, trend lags(4) *hdds varsoc hdds if week_no < 523 dfuller hdds if week_no < 523, lags(1) varsoc hdds dfuller hdds, lags(4) *dev_hdds varsoc dev_hdds if week_no < 523 dfuller dev_hdds if week_no < 523, lags(1) varsoc dev_hdds dfuller dev_hdds, lags(1) *cdds varsoc cdds if week_no < 523 dfuller cdds if week_no < 523, lags(4) varsoc cdds dfuller cdds, lags(4) *dev_cdds varsoc dev_cdds if week_no < 523 dfuller dev_cdds if week_no < 523, lags(3) varsoc dev_cdds dfuller dev_cdds, lags(4) *stor_diff varsoc stor_diff if week_no < 523 dfuller stor_diff if week_no < 523, lags(3) gen dstor_diff = D.stor_diff varsoc dstor_diff if week_no < 523 dfuller dstor_diff if week_no < 523, lags(1) varsoc stor_diff dfuller stor_diff, lags(2) varsoc dstor_diff dfuller dstor_diff, lags(1) dfuller stor_diff if week_no < 523, drift lags(3) dfuller stor_diff, drift lags(2) *hurr_shutin_bcf varsoc hurr_shutin_bcf if week_no < 523 dfuller hurr_shutin_bcf if week_no < 523, lags(1) varsoc hurr_shutin_bcf dfuller hurr_shutin_bcf, lags(1) *Now we use vecrank to test for the existence of cointegrating vectors with and without exogenous variables vecrank ln_hh ln_wti if week_no < 523, lags(5) levela max vecrank ln_hh ln_wti if week_no < 523, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf) levela max vecrank ln_hh ln_wti, lags(5) levela max vecrank ln_hh ln_wti, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf) levela max *Now we run VEC's (5 lags to get 4 lags in vec). Not clear if BY did this. vec ln_hh ln_wti if week_no < 523, lags(5) vec ln_hh ln_wti if week_no < 523, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf) vec ln_hh ln_wti, lags(5) vec ln_hh ln_wti, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf) *Post sample vecrank ln_hh ln_wti if week_no > 522, lags(5) levela max vec ln_hh ln_wti if week_no > 522, lags(5) vecrank ln_hh ln_wti if week_no > 522, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf) levela max vec ln_hh ln_wti if week_no > 522, lags(5) sindicators(hdds dev_hdds cdds dev_cdds stor_diff hurr_shutin_bcf)