/* This is the Airline Passenger data originally analyzed by Box and Jenkins in their classic textbook(1970). */ data airline; format date monyy5.; input date:monyy5. pass @@; datalines; jan49 112 feb49 118 mar49 132 apr49 129 may49 121 jun49 135 jul49 148 aug49 148 sep49 136 oct49 119 nov49 104 dec49 118 jan50 115 feb50 126 mar50 141 apr50 135 may50 125 jun50 149 jul50 170 aug50 170 sep50 158 oct50 133 nov50 114 dec50 140 jan51 145 feb51 150 mar51 178 apr51 163 may51 172 jun51 178 jul51 199 aug51 199 sep51 184 oct51 162 nov51 146 dec51 166 jan52 171 feb52 180 mar52 193 apr52 181 may52 183 jun52 218 jul52 230 aug52 242 sep52 209 oct52 191 nov52 172 dec52 194 jan53 196 feb53 196 mar53 236 apr53 235 may53 229 jun53 243 jul53 264 aug53 272 sep53 237 oct53 211 nov53 180 dec53 201 jan54 204 feb54 188 mar54 235 apr54 227 may54 234 jun54 264 jul54 302 aug54 293 sep54 259 oct54 229 nov54 203 dec54 229 jan55 242 feb55 233 mar55 267 apr55 269 may55 270 jun55 315 jul55 364 aug55 347 sep55 312 oct55 274 nov55 237 dec55 278 jan56 284 feb56 277 mar56 317 apr56 313 may56 318 jun56 374 jul56 413 aug56 405 sep56 355 oct56 306 nov56 271 dec56 306 jan57 315 feb57 301 mar57 356 apr57 348 may57 355 jun57 422 jul57 465 aug57 467 sep57 404 oct57 347 nov57 305 dec57 336 jan58 340 feb58 318 mar58 362 apr58 348 may58 363 jun58 435 jul58 491 aug58 505 sep58 404 oct58 359 nov58 310 dec58 337 jan59 360 feb59 342 mar59 406 apr59 396 may59 420 jun59 472 jul59 548 aug59 559 sep59 463 oct59 407 nov59 362 dec59 405 jan60 417 feb60 391 mar60 419 apr60 461 may60 472 jun60 535 jul60 622 aug60 606 sep60 508 oct60 461 nov60 390 dec60 432 ; data airline; set airline; lpass=log(pass); pass1 = dif(pass); pass12 = dif12(pass); pass112 = dif(pass12); lpass1 = dif(lpass); lpass12 = dif12(lpass); lpass112 = dif(lpass12); run; title1 'Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(thousands of passengers)'; axis1 label=('Year'); axis2 order=(100 to 700 by 50) label=(angle=90 'Passengers'); proc gplot data=airline; plot pass*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '1st Diff. Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(thousands of passengers)'; axis1 label=('Year'); axis2 order=(-120 to 100 by 20) label=(angle=90 '1st Diff. Passengers'); proc gplot data=airline; plot pass1*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '12th Diff. Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(thousands of passengers)'; axis1 label=('Year'); axis2 order=(-20 to 100 by 20) label=(angle=90 '12th Diff. Passengers'); proc gplot data=airline; plot pass12*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '1-12th Diff. Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(thousands of passengers)'; axis1 label=('Year'); axis2 order=(-50 to 70 by 10) label=(angle=90 '1-12th Diff. Passengers'); proc gplot data=airline; plot pass112*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 'Log of Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(Log of thousands of passengers)'; axis1 label=('Year'); axis2 order=(4 to 7 by .25) label=(angle=90 'Log of Passengers'); proc gplot data=airline; plot lpass*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '1st Diff. Log of Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(Log of thousands of passengers)'; axis1 label=('Year'); axis2 order=(-0.30 to 0.30 by 0.1) label=(angle=90 '1st Diff. Log of Passengers'); proc gplot data=airline; plot lpass1*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '12th Diff. Log of Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(Log of thousands of passengers)'; axis1 label=('Year'); axis2 order=(-0.1 to 0.50 by 0.1) label=(angle=90 '12th Diff. Log of Passengers'); proc gplot data=airline; plot lpass12*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title1 '1-12th Diff. Log of Airline Passengers Jan. 1949 - Dec. 1960'; title2 '(Log of thousands of passengers)'; axis1 label=('Year'); axis2 order=(-0.2 to 0.20 by 0.05) label=(angle=90 '1-12th Diff. Log of Passengers'); proc gplot data=airline; plot lpass112*date / haxis=axis1 vaxis=axis2; symbol1 i=join; format date year4.; run; title ' '; /* Well it appears that the log transformation is as good as any. Let's us it. */ /* Starting to work on constructing the Hasza-Fuller (1982) test equation for testing that the Airline data have both a first-order unit root and a seasonal unit root thus necessitating the use of the Box-Jenkins Airline filter of delta1*delta12. In particular see the augmented test equation of (4.1) on page 1213 in Hasza-Fuller (1982). */ data airline; set airline; lpass=log(pass); lpass_1 = lag(lpass); lpass12 = dif12(lpass); lpass12_1 = lag(lpass12); lpass1 = dif(lpass); lpass1_12 = lag12(lpass1); lpass112 = dif(lpass12); lpass112_1 = lag(lpass112); lpass112_2 = lag2(lpass112); lpass112_3 = lag3(lpass112); lpass112_4 = lag4(lpass112); lpass112_5 = lag5(lpass112); lpass112_6 = lag6(lpass112); lpass112_7 = lag7(lpass112); lpass112_8 = lag8(lpass112); lpass112_9 = lag9(lpass112); lpass112_10 = lag10(lpass112); lpass112_11 = lag11(lpass112); lpass112_12 = lag12(lpass112); run; /* Here we try to determine the number of augmenting terms to include in the test equation. */ title1 'On determining the number of augmenting terms to use'; title2 'in the Hasza-Fuller test for first and seasonal differencing'; proc reg data = airline; model lpass = lpass_1 lpass12_1 lpass1_12 lpass112_1-lpass112_12/noint; run; /* It appears that all 12 augmenting terms are required. Recall that the appropriate critical values for the Hasza-Fuller test are to be found in Table 5.1, p. 1214 in the Hasza-Fuller (1982) paper. The p-values printed out as the result of the test procedure are not to be used. */ proc reg data = airline; model lpass = lpass_1 lpass12_1 lpass1_12 lpass112_1 lpass112_9 lpass112_12/noint; test lpass_1 = 1, lpass12_1 = 0, lpass1_12 = 1; run; /* From the results here it appears that the null hypothesis of both a ordinary and seasonal unit root for the log transformed Airline data is not rejected at the conventional 5% level but is rejected at the 10% level. Thus, these results offer weak support for the ordinary/seasonal span differencing filter that Box and Jenkins (1970) used in their original analysis of the data. */ /* Just "for practice" I am going to conduct the Dickey/Hasza/Fuller (1984) test of the hypothesis that the seasonal span difference of the data is sufficient to render the Airline Data to be stationary. You can the t-statistic associated with the variable lpass_12. The appropriate table is Table 3, p. 359. The appropriate critical value at the 5% level is -2.09. The observed t-statistic is 2.35 and therefore the null hypothesis that the seasonal span difference is needed is supported by the data. However, we have seen from the previous Hasza-Fuller test that the (1,12) differencing is supported by the data. */ data airline; set airline; lpass_12 = lag12(lpass); lpass12_1 = lag(lpass12); lpass12_2 = lag2(lpass12); lpass12_3 = lag3(lpass12); lpass12_4 = lag4(lpass12); title 'The Dickey-Hasza-Fuller test for Seasonal span difference'; proc reg data = airline; model lpass12 = lpass_12 lpass12_1 lpass12_2 lpass12_3 lpass12_4 / noint; run;