/* This is the Airline Passenger data originally analyzed by Box and Jenkins in their classic textbook(1970). The following Buys Ballot "Seasons by Year" plot program was written by student Jacob Williamson in 2007. */ options pagesize=60 linesize=74 nodate; goptions rotate=landscape gsfmode=append; *border; /*Create Airline data set*/ data airline; format date monyy5.; input date:monyy5. pass @@; cards; 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 ; /* Plot Airline Data using gplot */ 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; /*Create the month and year variables for the date column within the Airline data set*/ data airline; set airline; label series_yr = "Series Year" series_mon = "Month"; series_yr = year(date); series_mon = month(date); run; /*Sets the axis parameters*/ axis1 label=('Month') minor=none value=('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec') order=(1 to 12 by 1) offset = (2) width = 3; axis2 label=(angle=90 'Passengers') order=(100 to 700 by 50); /*Creates a Unique line color for each of the 12 years*/ symbol1 color=black interpol=spline value=none; symbol2 color=blue interpol=spline value=none; symbol3 color=brown interpol=spline value=none; symbol4 color=libg interpol=spline value=none; symbol5 color=cyan interpol=spline value=none; symbol6 color=gold interpol=spline value=none; symbol7 color=gray interpol=spline value=none; symbol8 color=green interpol=spline value=none; symbol9 color=lilac interpol=spline value=none; symbol10 color=steel interpol=spline value=none; symbol11 color=magenta interpol=spline value=none; symbol12 color=maroon interpol=spline value=none; /*Graph the data - Seasons by Year*/ legend1 position = (bottom center outside); title1 'Airline Passenger Volume 1949 to 1960'; title2 '(Thousands of Passengers) '; title2 'Buys Ballot "Seasons By Year" Plot'; proc gplot data=airline; plot pass*series_mon=series_yr / haxis=axis1 vaxis=axis2 vminor=1 legend=legend1; run; data airline; set airline; lpass = log(pass); 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; /*Sets the axis parameters*/ axis1 label=('Month') minor=none value=('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec') order=(1 to 12 by 1) offset = (2) width = 3; axis2 label=(angle=90 'Passengers') order=(4 to 7 by 0.2); title1 'Log of Airline Passenger Volume 1949 to 1960'; title2 '(Log of Thousands of Passengers) '; title2 'Buys Ballot "Seasons By Year" Plot'; proc gplot data=airline; plot lpass*series_mon=series_yr / haxis=axis1 vaxis=axis2 vminor=1 legend=legend1; run; quit;