data vote; input year vote party person duration way growth inflation goodnews; datalines; 1880 50.22 -1 0 1.75 0 3.879 1.974 9 1884 49.846 -1 0 2 0 1.589 1.055 2 1888 50.414 1 1 0 0 -5.553 .604 3 1892 48.268 -1 1 0 0 2.763 2.274 7 1896 47.76 1 0 0 0 -10.024 3.41 6 1900 53.171 -1 1 0 0 -1.425 2.548 7 1904 60.006 -1 0 1 0 -2.421 1.442 5 1908 54.483 -1 0 1.25 0 -6.281 1.879 8 1912 54.708 -1 1 1.5 0 4.164 2.172 8 1916 51.682 1 1 0 0 2.229 4.252 3 1920 36.119 1 0 1 1 -11.463 0 0 1924 58.244 -1 1 0 0 -3.872 5.161 10 1928 58.82 -1 0 1 0 4.623 .183 7 1932 40.841 -1 1 1.25 0 -14.557 7.16 4 1936 62.458 1 1 0 0 11.677 2.454 9 1940 54.999 1 1 1 0 3.611 .055 8 1944 53.774 1 1 1.25 1 4.433 0 0 1948 52.37 1 1 1.5 1 2.858 0 0 1952 44.595 1 0 1.75 0 .84 2.316 6 1956 57.764 -1 1 0 0 -1.394 1.93 5 1960 49.913 -1 0 1 0 .417 1.963 5 1964 61.344 1 1 0 0 5.109 1.267 10 1968 49.596 1 0 1 0 5.07 3.156 7 1972 61.789 -1 1 0 0 6.125 4.813 4 1976 48.948 -1 0 1 0 4.026 7.579 4 1980 44.697 1 1 0 0 -3.594 7.926 5 1984 59.17 -1 1 0 0 5.568 5.286 8 1988 53.902 -1 0 1 0 2.261 3.001 4 1992 46.545 -1 1 1.25 0 2.223 3.333 2 1996 54.736 1 1 0 0 2.712 2.146 4 2000 50.265 1 0 1 0 1.603 1.679 7 ; /* Select variables using backward selection technique (a directed search). */ proc reg data = vote; model vote = party person duration way growth inflation goodnews/ selection = backward; run; /* Select variables using maximum adjusted R-square criterion (a comprehensive search). */ proc reg data = vote; model vote = party person duration way growth inflation goodnews/ selection = adjrsq; run; /* Get residuals for the purpose of producing residual plots to diagnose heteroscedasticity. */ proc reg data= vote; model vote = party duration growth inflation; output out = result r = resid; run; /* Do residual plots to visually inspect for possibility of heteroscedasticity */ proc plot data = result; plot resid*party; plot resid*duration; plot resid*growth; plot resid*inflation; run; /* Check for heteroscedasticity using White's test for heteroscedastity */ data result; set result; res2 = resid**2; duration2 = duration**2; growth2 = growth**2; inflation2 = inflation**2; /* Here is White's auxilliary test equation for heteroscedasticity. Look at the overall F-statistic. */ proc reg data = result; model res2 = party duration duration2 inflation inflation2; run; /* Just for the heck of it, we produce the regression while reporting White's heteroscedasticity-consistent standard errors for the OLS coefficient estimates. */ proc reg data= vote; model vote = party duration growth inflation / hcc acov; run;