/* the data set "raw" has the raw seasonal data read in with a cards statement*/ data raw; infile cards; input year index indexwd rrate prices dividend ; cards; 1900.01 49.0999 55.4199 3.197 57 0.166798 1.024234 1900.02 50 56.5 3.172 57.2999 0.147936 0.881713 1900.03 50.4 57.1399 3.164 57.2999 0.155635 1.045878 1900.04 51 58.09 3.15 57.2 0.155093 0.990682 1900.05 48.5999 55.57 3.178 56.0999 0.170216 1.091078 1900.06 47.2 54.0499 3.192 55.5 0.176343 1.029942 1900.07 47.2 54.27 3.192 55.7999 0.170336 0.960291 1900.08 47.7999 55.11 3.194 55.7 0.184349 1.075949 1900.09 46.7 54.07 3.199 56.0999 0.178404 0.96211 1900.1 48.4 56.2 3.202 55.2999 0.172882 0.963394 1900.11 52.2 60.95 3.183 55.4 0.167105 0.960945 1900.12 55.2999 64.75 3.16 55.0999 0.181557 1.08014 1901.01 56.9 66.8799 3.152 55.2 0.180959 0.990884 1901.02 58.2999 68.79 3.14 54.7 0.184352 1.012795 1901.03 60.4 71.3799 3.141 54.5 0.184508 0.994997 1901.04 65.5 77.61 3.151 54.4 0.196541 1.058983 1901.05 62.2 73.8399 3.178 54.0999 0.192981 0.976137 1901.06 68.4 81.4899 3.172 54.0999 0.205063 1.056376 1901.07 63.7999 76.23 3.19 54.5 0.203741 0.987727 1901.08 64.6999 77.51 3.208 55.4 0.200505 0.97834 1901.09 64.4 77.3899 3.217 56.0999 0.20807 1.031635 1901.1 63.5999 76.7699 3.219 56.0999 0.210425 1.00537 1901.11 65.0999 78.8799 3.2 56.5999 0.212501 1.00392 1901.12 64 77.91 3.205 57.7 0.214017 1.001195 1902.01 65.3 79.7399 3.198 56.7999 0.219557 1.019836 1902.02 65.9 80.6999 3.197 56.7 0.225502 1.021021 1902.03 66 81.05 3.201 56.5 0.218898 0.96499 1902.04 68.3 84.12 3.2 57.4 0.218207 0.990932 1902.05 68.0999 84.05 3.217 58.2999 0.216971 0.98845 1902.06 67.6999 83.8799 3.234 58.7999 0.214445 0.982492 1902.07 69.1999 86.05 3.252 59.0999 0.213792 0.991026 1902.08 71 88.5899 3.271 58 0.217813 1.012734 1902.09 71.1999 88.9899 3.29 58.7 0.218606 0.997648 1902.1 68.9 86.4599 3.325 63.2 0.218667 0.994299 1902.11 66.3 83.4899 3.339 60.7 0.224083 1.01863 1902.12 64.8 81.94 3.364 61.5 0.220281 0.977134 1903.01 68.0999 86.36 3.362 62.5999 0.229181 1.034141 1903.02 67.6999 86.15 3.38 62 0.222857 0.966527 1903.03 65.0999 83.0899 3.427 60.2999 0.221927 0.98979 1903.04 62.4 79.9 3.464 60 0.228846 1.024931 1903.05 61.2 78.6299 3.451 59 0.224454 0.974846 1903.06 57.7999 74.54 3.486 59 0.221532 0.980977 1903.07 55.0999 71.5199 3.532 58.5999 0.220682 0.99009 1903.08 53.2999 69.4 3.578 58.7999 0.213924 0.963446 1903.09 52.0999 67.98 3.586 59.5 0.210356 0.977289 1903.1 50.4 66.23 3.554 58.7 0.21019 0.993081 1903.11 50.5999 66.73 3.53 58.2999 0.20937 0.989983 1903.12 52.7999 69.94 3.542 58.2 0.210823 1.000751 1904.01 53.7999 71.51 3.537 59.7 0.207367 0.977567 1904.02 52.2999 69.72 3.55 60.7 0.205368 0.98428 1904.03 52.2 69.79 3.565 60.5 0.206577 0.999721 1904.04 53.4 71.66 3.549 59.2999 0.195858 0.942296 1904.05 52.2999 70.4499 3.539 58.5 0.197911 1.004286 1904.06 52.4 70.9 3.522 58.4 0.199981 1.00426 1904.07 54.5 74.1699 3.491 58.5 0.206572 1.02664 1904.08 56.4 76.9499 3.484 59.2 0.214703 1.033017 1904.09 58.9 80.5299 3.49 59.7999 0.210705 0.975397 1904.1 62.4 85.6299 3.487 59.9 0.224953 1.061111 1904.11 65.6999 90.44 3.48 60.7 0.221211 0.977375 1904.12 66.4 91.76 3.473 61.0999 0.22819 1.025269 1905.01 67.8 94.0599 3.449 60.5999 0.216903 0.944754 1905.02 70.8 98.57 3.441 61 0.233326 1.069169 1905.03 72.8 101.5 3.453 60.2999 0.232257 0.989369 1905.04 72 100.9 3.461 60.4 0.232663 0.995662 1905.05 68.4 96.07 3.467 59.2999 0.225553 0.963553 1905.06 69.1999 97.6399 3.464 59.2999 0.232136 1.022935 1905.07 71.4 101 3.455 59.4 0.228807 0.979665 1905.08 74.0999 105.3 3.458 60.0999 0.22897 0.994625 1905.09 74.1999 105.5999 3.459 59.5999 0.231202 1.003599 1905.1 75.3 107.5 3.46 59.9 0.220395 0.947447 1905.11 74.9 107.0999 3.483 60.0999 0.225048 1.014876 1905.12 76.8 110.3 3.491 61 0.220861 0.975393 ; /* We must now create a SAS date variable, because the SAS procedure which deseasonalizes the data requires this. I will call it "date". As my data starts in January of 1900, the value I must use below is "01jan00". If my data had started in August of 1965, I would use "01aug65". The command which creates this date variable is "intnx" below. */ data raw; set raw; date= intnx( 'month', '01jan00'd, _n_-1); proc x11 data=raw; monthly date=date printout=none charts=none; var dividend; output out=deseas d11=new_div; data new; merge raw deseas; proc print; format date date7.;