/* Using the Deterministic Trend/Seasonal Model to model the Wood Flooring data. */ options pagesize=60 linesize=74 nodate; goptions device=win rotate=landscape border; OPTIONS PAGESIZE=60 LINESIZE=74 NODATE; DATA SALES; INPUT year 2. month 2. SALES BCI67NS JQIND RMMTGNS EEA HUSTS; /* BCI67NS = Building and Construction Cost Index (1967 = 100, NSA) JQIND = Industrial Production Index RMMTGNS = 30 yr. mortgage interest rate EEA = Nonagricultural Employment Husts = Housing Units Starts */ date = mdy(month,1,year); lsales = log(sales); cards; 7902 7245 2.576 0.8214 10.41 88.985 1.52 7903 8555 2.59 0.82368 10.43 89.426 1.847 7904 8041 2.593 0.81597 10.5 89.363 1.748 7905 9180 2.5986 0.82539 10.69 89.681 1.876 7906 8696 2.6751 0.82559 11.04 89.955 1.913 7907 7309 2.704 0.8196 11.09 90.019 1.76 7908 10084 2.7393 0.8163 11.09 90.159 1.778 7909 7439 2.799 0.81689 11.3 90.149 1.832 7910 8990 2.811 0.8203 11.64 90.36 1.681 7911 6781 2.815 0.81623 12.83 90.466 1.524 7912 4914 2.826 0.8145 12.9 90.617 1.498 8001 8220 2.809 0.8183 12.88 90.729 1.341 8002 6642 2.807 0.81892 13.04 90.876 1.35 8003 5832 2.839 0.81868 15.28 90.995 1.047 8004 5310 2.826 0.80271 16.32 90.78 1.051 8005 5497 2.799 0.78283 14.26 90.316 0.927 8006 6633 2.841 0.77291 12.71 89.974 1.196 8007 7264 2.891 0.76795 12.19 89.676 1.269 8008 7033 2.921 0.77696 12.56 89.964 1.436 8009 6443 2.924 0.78846 13.2 90.046 1.471 8010 7150 2.925 0.79413 13.7 90.334 1.523 8011 6136 2.96 0.80695 14.21 90.55 1.51 8012 5830 2.986 0.81095 14.79 90.774 1.482 8101 6384 2.982 0.80396 14.9 91.003 1.547 8102 6702 2.984 0.80781 15.13 91.095 1.246 8103 8048 2.9805 0.81147 15.4 91.206 1.306 8104 9013 3.055 0.80604 15.58 91.219 1.36 8105 7510 3.073 0.81279 16.4 91.142 1.14 8106 7268 3.083 0.81789 16.7 91.285 1.045 8107 6509 3.121 0.82513 16.83 91.41 1.041 8108 7137 3.135 0.82144 17.28 91.32 0.94 8109 6553 3.166 0.81478 18.16 91.191 0.911 8110 7030 3.1912 0.80857 18.46 91.216 0.873 8111 5738 3.236 0.79726 17.82 91.014 0.837 8112 5187 3.2329 0.78831 16.95 90.831 0.91 8201 5413 3.233 0.77562 17.48 90.448 0.843 8202 5367 3.254 0.79235 17.6 90.474 0.866 8203 6947 3.244 0.78681 17.16 90.337 0.931 8204 6001 3.251 0.77938 16.89 90.031 0.917 8205 5975 3.255 0.77341 16.68 89.965 1.025 8206 6212 3.294 0.77083 16.7 89.703 0.902 8207 5782 3.3425 0.7645 16.82 89.38 1.166 8208 6733 3.343 0.76046 16.27 89.177 1.046 8209 7322 3.35 0.75488 15.43 88.995 1.144 8210 6705 3.348 0.74863 14.61 88.787 1.173 8211 6339 3.356 0.74664 13.82 88.649 1.372 8212 6215 3.4 0.7405 13.62 88.675 1.303 8301 8003 3.4201 0.75628 13.25 88.826 1.586 8302 6541 3.475 0.75453 13.04 88.758 1.699 8303 8690 3.481 0.76204 12.8 88.946 1.606 8304 8486 3.474 0.77159 12.78 89.211 1.472 8305 8401 3.479 0.78089 12.63 89.497 1.776 8306 8953 3.535 0.78529 12.87 89.886 1.733 8307 7107 3.573 0.79922 13.43 90.313 1.785 8308 8940 3.594 0.80995 13.81 89.973 1.91 8309 8791 3.597 0.82377 13.73 91.088 1.71 8310 9044 3.576 0.83027 13.54 91.408 1.715 8311 8091 3.583 0.82945 13.44 91.727 1.785 8312 7268 3.561 0.83369 13.42 92.11 1.688 8401 8564 3.555 0.85102 13.37 92.524 1.897 8402 9373 3.562 0.84968 13.23 93.043 2.26 8403 9545 3.571 0.85906 13.39 93.312 1.663 8404 8482 3.585 0.86362 13.65 93.65 1.851 8405 9341 3.581 0.86859 13.94 93.952 1.774 8406 8895 3.578 0.87251 14.42 94.325 1.843 8407 7514 3.579 0.87426 14.67 94.647 1.732 8408 10716 3.593 0.87415 14.47 94.885 1.586 8409 10322 3.597 0.87294 14.35 95.186 1.698 8410 9869 3.587 0.86885 14.13 95.499 1.59 8411 9311 3.583 0.86956 13.64 95.829 1.689 8412 7653 3.562 0.86567 13.18 95.997 1.612 8501 9486 3.566 0.86871 13.08 96.249 1.711 8502 8655 3.573 0.87618 12.92 96.397 1.632 8503 10036 3.528 0.8784 13.17 96.734 1.8 8504 9829 3.542 0.87982 13.2 96.896 1.821 8505 9862 3.5516 0.88183 12.91 97.163 1.68 8506 10542 3.5928 0.87967 12.22 97.28 1.676 8507 9900 3.6216 0.87583 12.03 97.465 1.684 8508 11104 3.6055 0.88107 12.19 97.696 1.743 8509 10971 3.595 0.88638 12.19 97.878 1.676 8510 12447 3.5983 0.87872 12.14 98.098 1.834 8511 10244 3.6051 0.88375 11.78 98.286 1.698 8512 8688 3.5949 0.8899 11.26 98.5 1.942 8601 11088 3.5951 0.89612 10.89 98.599 1.972 8602 10614 3.6202 0.88972 10.71 98.718 1.848 8603 12223 3.6227 0.88076 10.08 98.796 1.876 8604 12404 3.6384 0.88749 9.94 98.974 1.933 8605 12454 3.6748 0.88551 10.15 99.096 1.854 8606 11810 3.6842 0.88247 10.69 98.973 1.847 8607 11255 3.6928 0.88534 10.51 99.276 1.782 8608 12584 3.6884 0.88783 10.2 99.435 1.807 8609 12734 3.6995 0.887 10.01 99.747 1.687 8610 14717 3.7136 0.89499 9.98 99.98 1.681 8611 11189 3.7134 0.89942 9.7 100.145 1.623 8612 12179 3.7147 0.90772 9.32 100.394 1.833 8701 12411 3.7163 0.90196 9.2 100.543 1.774 8702 12271 3.7086 0.9124 9.08 100.772 1.784 8703 14588 3.7196 0.91583 9.04 101.005 1.726 8704 13555 3.7276 0.91958 9.83 101.367 1.614 8705 14112 3.7293 0.92361 10.6 101.564 1.628 8706 15916 3.7295 0.93159 10.54 101.713 1.594 8707 14533 3.7572 0.93721 10.28 102.047 1.575 8708 15846 3.7757 0.93828 10.33 102.266 1.605 8709 16780 3.7802 0.93743 10.89 102.43 1.695 8710 17325 3.8023 0.95014 11.26 102.98 1.515 8711 14290 3.7956 0.9529 10.65 103.2 1.656 8712 12248 3.8319 0.95855 10.64 103.544 1.4 8801 15043 3.8103 0.95926 10.38 103.623 1.271 8802 15163 3.8128 0.96243 9.89 104.046 1.473 8803 18117 3.8272 0.96259 9.93 104.311 1.532 8804 15912 3.835 0.96816 10.2 104.537 1.573 8805 17345 3.8365 0.96891 10.46 104.811 1.421 8806 19185 3.8405 0.9696 10.46 105.132 1.478 8807 13017 3.8462 0.97593 10.43 105.4 1.467 8808 16780 3.8654 0.98117 10.6 105.599 1.493 8809 16393 3.866 0.97766 10.48 105.814 1.492 8810 16279 3.8663 0.98035 10.3 106.091 1.522 8811 14904 3.8723 0.98771 10.27 106.368 1.569 8812 15334 3.8732 0.99275 10.61 106.691 1.563 8901 16070 3.877 0.99827 10.73 106.993 1.621 8902 14492 3.8681 0.99038 10.65 107.244 1.425 8903 20971 3.8726 0.99968 11.03 107.438 1.422 8904 16751 3.8774 1.00213 11.05 107.637 1.339 8905 17452 3.8796 0.99583 10.77 107.738 1.331 8906 18900 3.8873 0.99407 10.2 107.838 1.397 8907 14618 3.8938 0.98424 9.88 107.933 1.427 8908 19122 3.9058 0.98824 9.99 108.048 1.332 8909 18985 3.949 0.98623 10.13 108.178 1.279 8910 16831 3.9545 0.98171 9.95 108.29 1.41 8911 16587 3.9581 0.9856 9.77 108.571 1.351 8912 15622 3.966 0.99032 9.74 108.692 1.251 9001 15888 3.9566 0.98572 9.9 108.946 1.551 9002 16051 3.9497 0.99081 10.2 109.263 1.437 9003 19923 3.9564 0.99559 10.27 109.461 1.289 9004 16351 3.9604 0.98959 10.37 109.499 1.248 9005 18713 3.9831 0.9935 10.48 109.79 1.212 9006 18470 4.0193 0.9933 10.16 109.869 1.177 9007 15409 4.02 0.99284 10.04 109.707 1.171 9008 19165 4.0197 0.99477 10.1 109.543 1.115 9009 18732 4.0407 0.99613 10.18 109.457 1.11 9010 17134 4.0378 0.99064 10.17 109.274 1.014 9011 15184 4.0407 0.97748 10.01 109.074 1.145 9012 14167 4.0255 0.97171 9.67 108.965 0.969 9101 14300 4.0266 0.96693 9.64 108.759 0.798 9102 15077 4.0214 0.95929 9.37 108.5 0.965 9103 18673 4.0203 0.95046 9.5 108.33 0.921 9104 17090 4.0101 0.95379 9.5 108.145 1.001 9105 16434 4.0307 0.9612 9.47 108.107 0.996 9106 17914 4.046 0.97244 9.62 108.2 1.036 9107 13795 4.0811 0.97321 9.58 108.131 1.063 9108 17253 4.1327 0.97445 9.24 108.215 1.049 9109 17972 4.123 0.98375 9.01 108.223 1.015 9110 18613 4.1232 0.9828 8.86 108.209 1.079 9111 16561 4.1319 0.98143 8.71 108.115 1.103 9112 16052 4.1212 0.9751 8.5 108.121 1.079 9201 19089 4.1204 0.97559 8.43 108.084 1.176 9202 16336 4.1081 0.98144 8.76 108.077 1.25 9203 19392 4.1435 0.98907 8.94 108.119 1.297 9204 18387 4.1585 0.99654 8.85 108.301 1.099 9205 16487 4.1856 0.9989 8.67 108.495 1.214 9206 18518 4.2 0.9974 8.51 108.541 1.145 9207 17279 4.2112 1.00474 8.13 108.595 1.139 9208 20108 4.224 1.0021 7.98 108.741 1.226 9209 21074 4.2282 1.0069 7.92 108.807 1.186 9210 19537 4.2444 1.01236 8.09 108.941 1.244 9211 17435 4.2524 1.01763 8.31 109.119 1.214 9212 18931 4.2553 1.01734 8.21 109.266 1.227 9301 20588 4.2724 1.02123 7.99 109.502 1.21 9302 20909 4.2713 1.02581 7.68 109.816 1.21 9303 24914 4.3149 1.02815 7.5 109.749 1.083 9304 20487 4.4045 1.03176 7.46 110.055 1.258 9305 20967 4.5455 1.02695 7.47 110.398 1.26 9306 24292 4.5385 1.03011 7.42 110.539 1.28 9307 17770 4.4964 1.03111 7.21 110.744 1.254 9308 22893 4.4609 1.0286 7.11 110.957 1.3 9309 26245 4.4541 1.03973 6.91 111.204 1.343 9310 21914 4.664 1.04455 6.83 111.525 1.392 9311 20650 4.4828 1.04865 7.16 111.78 1.376 9312 24229 4.5079 1.05648 7.17 112.034 1.533 9401 19583 4.5458 1.05877 7.07 112.302 1.272 9402 23451 4.597 1.06058 7.15 112.532 1.337 9403 26614 4.6119 1.06991 7.68 112.982 1.564 9404 22476 4.6288 1.07581 8.32 113.35 1.465 9405 23673 4.6253 1.08485 8.6 113.697 1.526 9406 31523 4.6111 1.09158 8.4 113.98 1.409 9407 20989 4.5995 1.09519 8.61 114.333 1.439 9408 28404 4.6025 1.10085 8.51 114.673 1.45 9409 30476 4.6125 1.10316 8.64 114.98 1.474 9410 27360 4.6118 1.10946 8.93 115.235 1.45 9411 25830 4.602 1.11633 9.17 115.641 1.511 9412 27310 4.6034 1.1269 9.2 115.918 1.455 9501 25352 4.6061 1.13343 9.15 116.259 1.407 9502 25264 4.6055 1.13181 8.83 116.521 1.316 9503 30237 4.5928 1.1344 8.46 116.687 1.249 9504 24451 4.5889 1.13301 8.32 116.864 1.267 9505 26552 4.5832 1.13767 7.96 116.841 1.314 9506 31398 4.5812 1.14284 7.57 117.05 1.281 9507 22210 4.6093 1.1381 7.61 117.137 1.461 9508 29447 4.6193 1.15135 7.86 117.449 1.416 9509 31890 4.602 1.15627 7.64 117.648 1.369 9510 27727 4.6142 1.15472 7.48 117.784 1.369 9511 27817 4.6344 1.15801 7.38 117.942 1.452 9512 27867 4.6297 1.15855 7.2 118.087 1.431 9601 24538 4.6282 1.15557 7.03 118.08 1.467 9602 26188 4.6342 1.16903 7.08 118.534 1.491 9603 32246 4.6411 1.16612 7.62 118.795 1.424 9604 27460 4.66 1.17958 7.93 118.958 1.516 9605 28808 4.6785 1.18976 8.07 119.288 1.504 9606 34649 4.7039 1.19821 8.32 119.535 1.467 9607 25312 4.7221 1.1991 8.25 119.742 1.472 9608 33873 4.7629 1.20698 8 120.02 1.557 9609 36855 4.8053 1.21247 8.23 120.172 1.475 9610 32274 4.8814 1.21181 7.92 120.413 1.392 9611 31125 4.8905 1.22072 7.62 120.698 1.489 9612 34137 4.9012 1.22409 7.6 120.893 1.37 9701 31489 4.9324 1.22966 7.82 121.131 1.373 9702 30233 4.9336 1.2403 7.65 121.427 1.532 9703 36046 4.9183 1.24507 7.9 121.782 1.471 9704 34225 4.9795 1.25236 8.14 122.065 1.487 9705 31547 4.9988 1.25788 7.94 122.292 1.429 9706 40775 5.0269 1.26557 7.69 122.524 1.502 9707 29249 5.0206 1.27171 7.5 122.822 1.437 9708 34212 5.0104 1.27988 7.48 122.894 1.399 9709 40392 5.0007 1.28807 7.43 123.302 1.534 9710 36934 4.9916 1.29609 7.29 123.626 1.519 9711 31837 4.9586 1.30173 7.21 123.949 1.502 9712 39679 4.9881 1.30598 7.1 124.263 1.525 9801 33348 4.9785 1.30872 6.99 124.58 1.527 9802 33016 4.9917 1.30738 7.04 124.773 1.644 9803 39423 4.9853 1.31082 7.13 124.961 1.583 9804 33029 4.9961 1.31654 7.14 125.22 1.542 9805 34957 4.9941 1.32434 7.14 125.478 1.541 9806 43540 5.0013 1.31481 7 125.689 1.626 9807 27026 5.0044 1.31291 6.95 125.808 1.719 9808 40268 5.0198 1.33593 6.92 126.17 1.615 9809 47153 5.054 1.33548 6.72 126.361 1.576 9810 38514 5.0663 1.34108 6.71 126.567 1.698 9811 35689 5.0684 1.33777 6.87 126.841 1.654 9812 43008 5.0611 1.33801 6.74 127.186 1.75 9901 33841 5.0693 1.34052 6.79 127.378 1.82 9902 38418 5.0581 1.34509 6.81 127.73 1.752 9903 51985 5.0487 1.35147 7.04 127.813 1.746 9904 41449 5.0641 1.35472 6.92 128.134 1.577 9905 44073 5.0648 1.36215 7.15 128.162 1.668 9906 56530 5.0813 1.36639 7.55 128.443 1.607 9907 33963 5.1213 1.37363 7.63 128.816 1.68 9908 45210 5.1429 1.37597 7.97 128.945 1.655 9909 55389 5.186 1.37643 7.82 129.048 1.626 9910 42409 5.1875 1.38502 7.85 129.311 1.628 ; /* We use PROC GPLOT to generate graphs of sales and log(sales) to help use determine the proper transformation of the data before proceeding with our analysis. */ PROC GPLOT DATA=SALES; Title height=1 'SALES: 1979:2 - 1999:10'; axis2 LABEL=(F=DUPLEX 'SALES'); AXIS1 label=(f=duplex 'Date'); SYMBOL1 i=join; PLOT SALES*DATE=1/vaxis=axis2 haxis=axis1; format date monyy5.; run; PROC GPLOT DATA=SALES; Title height=1 ' LOG SALES: 1979:2 - 1999:10'; axis2 LABEL=(F=DUPLEX 'Log(Sales)'); AXIS1 label=(f=duplex 'Date'); SYMBOL1 i=join; PLOT lsales*DATE=1/vaxis=axis2 haxis=axis1; format date monyy5.; run; /* Here we use PROC ARIMA and the autocorrelation function to see if there are signs of nonstationarity (trend) and seasonality in the data. */ title2 'Use of PROC ARIMA and the autocorrelation function to look for'; title2 'trend and seasonality'; proc arima data=sales; identify var=sales nlag=36; identify var=sales(1) nlag=36; run; /* Here we create the seasonal dummy variables and log of sales. */ DATA SALES; SET SALES; Lsales=log(sales); t = _n_; if month = 1 then d1 = 1; else d1 = 0; if month = 2 then d2 = 1; else d2 = 0; if month = 3 then d3 = 1; else d3 = 0; if month = 4 then d4 = 1; else d4 = 0; if month = 5 then d5 = 1; else d5 = 0; if month = 6 then d6 = 1; else d6 = 0; if month = 7 then d7 = 1; else d7 = 0; if month = 8 then d8 = 1; else d8 = 0; if month = 9 then d9 = 1; else d9 = 0; if month = 10 then d10 = 1; else d10 = 0; if month = 11 then d11 = 1; else d11 = 0; if month = 12 then d12 = 1; else d12 = 0; run; /* Here we estimate the deterministic seasonal model in 3 equivalent ways. The first method we will call the "relative to January" method. The second method we will call "each month has its own intercept" method. The third method we will call the "sum to zero" method. */ title 'Relative to January Method'; proc reg data=sales; model lsales = t d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12; output out = resid r = resid; run; title 'Each Month has its Own Intercept Method'; proc reg data=sales; model lsales = t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 / noint; run; title 'Sum to Zero Method'; proc reg data=sales; model lsales = t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12; restrict d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 + d12; run; /* Here we use PROC ARIMA to see if the residuals from the deterministic trend/seasonal model are autocorrelated. */ title 'Using PROC ARIMA to examine the OLS residuals for autocorrelation'; proc arima data=resid; identify var=resid; run; /* It appears that an AR(3) model is appropriate for the errors of the model. The ACF of the residuals damps out while the PaCF of the residuals has 3 spikes in it and then it cuts off. */ title1 'Adjusting the three methods for autocorrelated errors'; title2 'using PROC AUTOREG'; proc autoreg data=sales; model lsales = t d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12/ nlag=3 dw=3 dwprob method=ml; test d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12; model lsales = t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 / nlag=3 dw=3 dwprob method=ml noint; test d1 - d2, d2 - d3, d3 - d4, d4 - d5, d5 - d6, d6 - d7, d7 - d8, d8 - d9, d9 - d10, d10 - d11, d11 - d12; model lsales = t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 / nlag=3 dw=3 dwprob method=ml; restrict d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 + d12; test d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12; run; /* You will notice that in the last parametrization above (the one where the seasonal dummy variable coefficients are forced to add to zero) the estimated model is not of full rank. This is because PROC AUTOREG first estimates the UNRESTRICTED model to get the least squares residuals before doing any restricted estimation and thus PROC AUTOREG encounters a model of insufficient rank. This shortcoming of PROC AUTOREG forces us to approach the problem differently. We overcome the deficient rank model problem by implementing the following code. */ data sales; set sales; x1 = d1 - d12; x2 = d2 - d12; x3 = d3 - d12; x4 = d4 - d12; x5 = d5 - d12; x6 = d6 - d12; x7 = d7 - d12; x8 = d8 - d12; x9 = d9 - d12; x10 = d10 - d12; x11 = d11 - d12; /* In this model we have directly imposed the summing up restriction of the coefficients by substituting in the zero sum coefficient restriction and, as a result, redefining the explanatory variables of the model to satisfy the constraint. Now the coeffients on the variables x1 through x11 are the seasonal coefficients on the months January through November while the December coefficient is obtained by summing the x1 through x11 coefficients and subtracting this sum from one. */ title1 'Producing the Sum to Zero Seasonal Coefficients Using Restricted'; title2 'Formulation of PROC AUTOREG Equation'; proc autoreg data = sales outest = coef; model lsales = t x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 / nlag = 3 dw = 3 dwprob method = ml; test x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11; run; data coef; set coef; x12 = - x1 - x2 - x3 - x4 - x5 - x6 - x7 - x8 - x9 - x10 - x11; keep x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12; title1 'Getting the sum to zero seasonal coefficients'; title2 'produced by PROC AUTOREG'; proc print data = coef; run; /* Now we are going to forecast with the model. But first we have to add the out-of-sample data to the original data set. We use PROC APPEND to do that. */ data base; set sales; keep lsales t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12; data add; input lsales t d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12; datalines; . 250 0 0 0 0 0 0 0 0 0 0 1 0 . 251 0 0 0 0 0 0 0 0 0 0 0 1 . 252 1 0 0 0 0 0 0 0 0 0 0 0 . 253 0 1 0 0 0 0 0 0 0 0 0 0 . 254 0 0 1 0 0 0 0 0 0 0 0 0 . 256 0 0 0 1 0 0 0 0 0 0 0 0 . 257 0 0 0 0 1 0 0 0 0 0 0 0 . 258 0 0 0 0 0 1 0 0 0 0 0 0 . 259 0 0 0 0 0 0 1 0 0 0 0 0 . 260 0 0 0 0 0 0 0 1 0 0 0 0 . 261 0 0 0 0 0 0 0 0 1 0 0 0 . 262 0 0 0 0 0 0 0 0 0 1 0 0 . 263 0 0 0 0 0 0 0 0 0 0 1 0 . 264 0 0 0 0 0 0 0 0 0 0 0 1 ; proc append base = base data = add; run; title1 'Getting the Forecasts for 14 Months ahead including'; title2 'upper and lower 95% confidence limits'; proc autoreg data=base; model lsales = t d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12/ nlag=3 dw=3 dwprob method=ml; output out=forecast alphacli = 0.05 p=p_ar3 lcl=l_ar3 ucl=u_ar3; run; data forecast; set forecast; if t > 249; v = (u_ar3 - l_ar3)/(2*1.96); forecast = exp(p_ar3 + 0.5*v*v); u = exp(u_ar3); l = exp(l_ar3); keep t p_ar3 u_ar3 l_ar3 forecast u l; proc print data=forecast; run;