/* fair.def YEAR VOTE PARTY PERSON DURATION WAR GROWTH INFLATION GOODNEWS Obs: 33 year year vote Incumbent share of the two-party presidential vote party = 1 if Democratic incumbent at election time; -1 if a Republican incumbent person = 1 if incumbent is running for election and 0 otherwise duration number of terms incumbent administration in power war = 1 for elections of 1920, 1944, and 1948 and 0 otherwise. growth growth rate GDP in first three quarters of the election year inflation inflation rate in first 15 quarters of admin, 0 for 1920, 1944, 1948 goodnews number of quarters in first 15 with real GDP per capita growth > 3.2 Data source: http://fairmodel.econ.yale.edu/vote2008/index2.htm Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- year | 33 1944 38.67816 1880 2008 vote | 33 52.09939 6.056636 36.119 62.458 party | 33 -.1515152 1.003781 -1 1 person | 33 .5757576 .5018904 0 1 duration | 33 .7121212 .6647404 0 2 -------------+-------------------------------------------------------- war | 33 .0909091 .2919371 0 1 growth | 33 .6242728 5.455028 -14.499 11.765 inflation | 33 2.666303 2.106304 0 7.831 goodnews | 33 5.272727 2.90767 0 10 */ data vote; input YEAR VOTE PARTY PERSON DURATION WAR 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 0.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 0.183 7 1932 40.841 -1 1 1.25 0 -14.499 7.2 4 1936 62.458 1 1 0 0 11.765 2.497 9 1940 54.999 1 1 1 0 3.902 0.081 8 1944 53.774 1 1 1.25 1 4.279 0 0 1948 52.37 1 1 1.5 1 3.579 0 0 1952 44.595 1 0 1.75 0 0.691 2.362 7 1956 57.764 -1 1 0 0 -1.451 1.935 5 1960 49.913 -1 0 1 0 0.377 1.967 5 1964 61.344 1 1 0 0 5.109 1.26 10 1968 49.596 1 0 1 0 5.043 3.139 7 1972 61.789 -1 1 0 0 5.914 4.815 4 1976 48.948 -1 0 1 0 3.751 7.63 5 1980 44.697 1 1 0 0 -3.597 7.831 5 1984 59.17 -1 1 0 0 5.44 5.259 8 1988 53.902 -1 0 1 0 2.178 2.906 4 1992 46.545 -1 1 1.25 0 2.662 3.28 2 1996 54.736 1 1 0 0 3.121 2.062 4 2000 50.265 1 0 1 0 1.219 1.605 8 2004 51.233 -1 1 0 0 2.69 2.325 1 2008 46.6 -1 0 1 0 0.22 2.88 3 ; proc reg data = vote; model vote = growth inflation / cov; test growth + inflation; run; /* Select variables using backward selection technique (a directed search). */ title 'Backward Selection of Model'; proc reg data = vote; model vote = party person duration war growth inflation goodnews/ selection = backward; run; /* Select variables using maximum adjusted R-square criterion (a comprehensive search). */ title 'Comprehensive Search for Best Model using the Adjusted R-Square Criterion'; title2 'Adjusted R-Square = 1 - (1 - R^2)(N - 1)/(N-K) where K = number of explanatory'; title3 'variables including the Constant Term'; proc reg data = vote; model vote = party person duration war growth inflation goodnews/ selection = adjrsq; run; /* Both model selection procedures resulted in the same final equation: party duration growth inflation and goodnews were the explanatory variables that were selected. */ /* Get residuals for the purpose of producing residual plots to diagnose heteroscedasticity. */ title 'Getting Residuals for White Test for Heteroskedasticity'; proc reg data= vote; model vote = party duration growth inflation goodnews; 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; plot resid*goodnews; 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; goodnews2 = goodnews**2; /* Here is White's auxilliary test equation for heteroscedasticity. Look at the overall F-statistic. */ title 'White Test for Heteroskedasticity'; proc reg data = result; model res2 = party duration growth inflation goodnews duration2 growth2 inflation2 goodnews2; run; /* Just for the heck of it, we produce the regression while reporting White's heteroscedasticity-consistent standard errors for the OLS coefficient estimates. All of the coefficients are still statistically significant. */ title 'White Heteroskedasticity Consistent Standard Errors for OLS Estimates'; proc reg data= vote; model vote = party duration growth inflation goodnews/ white; run;