/* This statement is optional. It suppresses printing of the date and time. */ OPTIONS NODATE; DATA ATTIC; /* Creating a time index variable. */ TIME = _N_ ; INPUT ATTIC OUTSIDE WIND ; DATALINES; 71.1 60.3 5.9 70.1 59.8 5.4 69.1 59.7 5.2 68.2 59.7 4.7 67.8 59.9 6.2 67.4 60.1 6.9 67.0 60.1 7.5 66.8 60.7 8.1 66.6 60.6 8.2 66.8 61.0 8.1 67.1 61.6 8.1 67.6 62.8 9.3 69.1 63.6 11.4 70.9 64.6 10.0 73.5 64.0 12.1 74.1 62.9 10.0 74.4 62.1 10.5 73.3 61.8 8.8 71.7 61.6 8.7 70.3 61.1 7.8 69.7 60.2 6.2 68.8 60.1 4.7 68.3 59.8 5.1 67.8 59.6 3.6 67.6 59.4 4.6 67.2 59.5 3.2 67.0 59.7 3.2 67.2 59.5 2.8 67.2 59.8 2.7 67.2 59.8 3.7 66.9 59.9 3.9 66.8 60.0 5.7 66.8 60.1 4.7 66.5 61.0 2.8 67.0 62.9 3.7 69.3 64.5 3.9 75.7 66.6 2.7 84.1 68.6 3.8 87.8 71.1 5.0 91.5 72.8 4.3 96.5 75.2 5.1 102.1 76.8 6.7 102.7 78.1 6.4 101.5 78.4 5.8 101.5 75.3 7.7 98.9 71.2 7.8 90.3 70.1 5.9 85.3 69.5 5.9 81.9 68.1 5.5 79.5 66.8 5.4 77.7 66.0 5.2 76.0 64.6 5.5 74.3 63.5 5.2 72.7 62.7 3.6 71.4 62.2 2.6 70.2 62.3 4.2 69.3 64.0 4.1 70.0 64.0 5.7 70.8 66.5 5.0 71.9 70.4 6.0 76.0 72.9 7.0 81.4 75.2 7.4 89.2 77.2 7.2 93.1 79.7 7.1 98.9 81.3 7.2 104.8 81.3 7.9 106.5 81.2 10.1 102.1 79.2 11.3 95.5 72.4 9.8 92.1 70.1 6.0 87.4 68.9 6.0 83.1 67.1 8.1 78.7 64.6 7.2 76.3 63.8 3.7 74.8 63.8 6.7 73.4 62.2 7.3 72.2 59.4 12.2 69.9 58.2 10.5 68.3 57.0 10.7 66.5 55.7 11.5 65.8 53.5 12.6 63.7 52.7 12.3 62.9 52.7 13.7 62.0 53.3 12.3 61.5 53.4 11.2 62.1 54.8 11.6 63.6 56.2 12.2 66.2 58.6 12.5 71.0 60.0 10.8 73.0 61.4 7.9 78.0 60.7 9.2 81.1 61.8 7.1 83.8 62.1 6.1 81.8 60.2 6.2 77.3 57.0 6.5 72.2 54.4 4.9 68.4 53.1 3.7 65.9 52.3 2.2 64.1 52.2 1.6 62.4 50.8 1.9 61.2 50.1 1.6 60.2 48.5 2.0 58.8 47.3 2.2 58.0 47.5 1.6 57.2 48.4 1.8 56.7 52.5 3.7 60.7 57.1 4.8 67.4 60.7 5.3 76.2 63.1 5.8 85.8 66.5 7.3 93.9 69.2 8.4 98.3 69.2 8.5 101.2 70.7 9.1 102.6 71.2 9.4 102.5 71.7 9.5 99.2 70.0 9.8 94.7 67.0 8.8 90.4 62.6 8.5 85.2 58.5 6.6 77.7 55.8 4.3 72.7 54.4 3.3 68.6 53.4 2.0 65.8 51.6 3.3 63.9 50.6 3.0 62.7 50.7 2.6 61.6 50.8 3.1 61.6 50.5 3.0 60.6 50.5 4.2 59.4 51.5 4.8 59.1 54.7 5.7 61.1 57.8 6.1 65.1 62.2 7.7 74.0 65.6 10.1 81.1 67.0 11.3 86.7 67.8 11.7 92.1 68.5 11.7 95.6 68.8 12.0 97.7 70.6 11.5 98.8 70.2 10.9 97.3 69.7 9.9 95.0 68.0 9.2 90.4 64.8 7.6 85.5 62.0 3.0 81.1 59.0 2.2 74.0 55.4 1.4 69.4 52.8 1.9 66.4 52.4 1.7 64.5 51.5 1.9 63.2 51.1 2.9 62.2 49.0 1.9 61.0 46.4 2.0 59.5 47.5 1.8 58.5 49.6 2.2 58.1 55.4 4.5 61.7 61.0 7.8 69.3 65.1 9.3 76.7 68.0 11.6 82.8 69.8 11.5 87.3 71.7 10.4 93.9 72.3 10.4 98.8 73.0 12.2 101.7 72.7 11.8 102.0 72.9 10.1 101.8 72.6 9.5 98.9 71.1 8.4 94.8 68.6 7.8 89.5 64.0 6.2 82.9 60.5 4.0 75.4 59.4 2.2 71.6 57.1 2.2 69.0 55.9 1.3 66.8 54.9 2.9 65.6 55.1 3.4 64.8 54.8 3.3 64.4 54.3 2.3 64.1 54.0 3.3 63.6 54.3 2.8 63.5 55.3 2.9 64.3 56.5 2.5 65.4 57.5 2.7 66.6 57.1 3.7 67.2 59.0 3.5 67.1 59.7 3.5 70.0 60.9 3.7 72.2 62.8 5.0 74.6 62.2 5.4 76.5 64.6 6.2 80.4 64.1 7.6 83.3 62.0 6.0 85.3 60.5 5.9 78.4 59.7 6.4 73.3 58.1 6.7 70.0 56.7 5.6 67.3 57.1 7.2 65.8 56.4 5.5 65.0 55.7 6.3 64.8 54.9 7.2 64.3 55.8 8.7 63.6 56.4 9.2 63.2 56.9 7.6 63.6 57.6 6.6 63.0 61.9 7.7 65.5 66.1 9.4 70.5 68.9 9.9 76.3 72.2 9.3 83.5 75.5 9.3 91.0 77.4 10.3 97.0 78.9 10.6 101.7 80.3 10.4 102.8 82.6 10.4 105.3 83.9 10.8 106.7 83.2 9.8 103.9 83.0 10.2 99.8 81.2 7.1 94.8 77.4 4.9 90.2 74.9 5.1 84.9 72.4 5.2 81.4 70.9 5.4 78.8 68.9 4.2 76.9 67.7 4.3 75.1 66.3 2.5 73.6 64.2 2.9 72.1 63.4 3.2 70.7 62.5 3.5 70.0 62.3 2.5 69.0 64.6 3.3 70.1 68.9 3.7 74.0 72.9 3.5 80.2 77.8 3.4 88.6 78.4 3.4 97.6 82.0 2.9 105.1 84.3 3.7 108.8 85.1 3.8 109.7 85.5 3.6 109.0 85.4 3.4 107.1 84.0 4.4 104.1 81.3 6.8 99.8 77.0 6.5 95.1 72.6 6.2 89.5 69.1 4.4 ; /* Viewing the data set just created. */ PROC PRINT DATA=ATTIC; RUN; /* Computing correlations among the variables. */ PROC CORR DATA=ATTIC; VAR ATTIC OUTSIDE WIND; RUN; /* Creating time series plots. */ PROC SGPLOT DATA=ATTIC; SERIES X=TIME Y=ATTIC; SERIES X=TIME Y=OUTSIDE; SERIES X=TIME Y=WIND; RUN; /* Giving WIND its own y-axis. */ PROC SGPLOT DATA=ATTIC; SERIES X=TIME Y=ATTIC; SERIES X=TIME Y=OUTSIDE; SERIES X=TIME Y=WIND / Y2AXIS; RUN; /* Creating scatter plots. */ PROC SGPLOT DATA=ATTIC; SCATTER X=OUTSIDE Y=ATTIC; RUN; PROC SGPLOT DATA=ATTIC; SCATTER X=WIND Y=ATTIC; RUN; /* This proc step: 1. Fits a regression model, 2. Tests the residuals for serial correlation using the Durbin-Watson statistic, and 3. Creates a data set named ATPLUS containing the variables in the ATTIC data set plus the residuals and predicted values. */ PROC REG DATA=ATTIC; MODEL ATTIC = OUTSIDE WIND / DWPROB; OUTPUT OUT=ATPLUS P=YHAT R=RESID; RUN; /* Create a times series plot of the residuals. */ PROC SGPLOT DATA=ATPLUS; SERIES X=TIME Y=RESID; RUN; /* Print the data along with the predictions and residuals. */ PROC PRINT DATA=ATPLUS; RUN;