Some simple models of US county voting outcomes

Woodley convinced me that these are of actual interest. As some of you may recall, I compiled a large county level (n≈3000) dataset some time ago, but didn’t use it for anything. I just thought it would be a cool dataset, but that results were not too interesting. Well, since someone did think these were important analyses enough to do a study using state level data on, I took a look at the superior dataset. The outcome variables are the fractions of votes for Democrats, Republicans as well as Libertarians and Greens for the 2016 election. Results for Dems and Reps are also available for 2012 and 2008. The 2016 data also has the various smaller candidates (e.g. this guy) but these were of little interest so I did not examine them.

Data sources

The cognitive ability (CA) score is from what used to be called the Global Report Card but which changed name to (mumble mumble), but one can find them here. I think these are actually from NAEP testing, but I’m not quite sure. They are some kind of scholastic testing, so not exactly standard IQ data, but good enough. The S — general socioeconomic factor (a fancy general social status metric) — is extracted from some varied 28 indicators, as detailed in this study. The voter outcome data comes from NYT’s map here. It took a bit of a scrape job to get them out, but I managed. The data are actually not the final counts, as I thought they were when I downloaded them, but they are very close to the finals, and so I didn’t bother updating them. I guess I should now that someone wants to publish this in some journal with my name on it! Demographic data was from the ACS.

Regressions

While one should use path models, I know that some will want to see the straight regressions. Regressions are basically path models where all the predictors are modeled as being causally independent and which cause the dependent outcome. Thus, one assumes that S is not caused by CA or by demographics. What this basically does is underestimate the variables which mainly work thru other variables (indirect effects).

What am I reporting? I report the standardized betas for the predictors, some model meta-data including cross-validated R2 (10 fold), and the etas. What are etas? These are the square root of the more common eta2., It’s an R2-type measure, i.e. about variance, so it is non-linear and not so easy to interpret correctly. Taking the square root puts it on the same scale as the correlation. The etas here are derived from the analysis of variance fit by stats::aov, which is passed to lsr::etaSquared function. This uses type 2 errors by default and I too like to live dangerously so I didn’t check method variance by trying the other methods. If you wonder what these are, you can find them explained here, here and here.

live dangerously

Etas have an advantage in comparison to the standardized betas which is that they make it possible to compare the importance of variables for the model’s overall explanatory power. Standardized betas do not allow for this because while they are standardized, a variable may be highly correlated with other variables such that it is redundant. Categorical variables may not have much variation. Being a type B may be associated with a large negative effect for some outcome, but if the dataset consists of 99% type A’s and 1% type B’s, variation in type will not explain much variation in the outcome. Etas take this into account.

Furthermore, categorical variables, such as state, are given a beta for n-1 of their levels (the last level is the reference level and thus has beta=0 using standard contrast coding). So if we have two categorical predictors, one with 5 levels and one with 10, we get a set of 4 betas vs. a set of 9 betas. This makes it hard to assess the relative importance of a categorical predictor compared to … any other predictor. Etas deal away with this problem because each categorical predictor is only assigned 1 eta value, just as every other variable is.

A problem with etas is that they are directionless (because based on eta2). However, we can look up the direction for the non-categorical variables using the betas. The categorical predictors of course do not have any consistent directions.

Choosing metrics for relative comparison of predictors is actually very difficult and I only used a simple method here because this is the only method I have implemented in my model summary function so far. I should implement the functions from the relaimpo package, but alas, I don’t have infinite time. So for now we will pretend that etas are totally fine for this purpose.

Here’s the results (6 long tables of numbers):

Democrats, 2016
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                     -0.0934      0.017   -0.127   -0.060
S                       0.1281      0.019    0.092    0.164
Black                   0.7662      0.017    0.733    0.800
Asian                   0.2719      0.012    0.248    0.296
Hispanic                0.3831      0.015    0.354    0.412
State: Alabama          0.0000         NA       NA       NA
State: Arizona          1.1032      0.165    0.779    1.427
State: Arkansas         0.4404      0.091    0.263    0.618
State: California       0.7013      0.107    0.491    0.912
State: Colorado         1.0043      0.101    0.807    1.202
State: Connecticut      1.6893      0.202    1.293    2.085
State: Delaware         1.0288      0.314    0.413    1.645
State: Florida          0.5031      0.095    0.318    0.689
State: Georgia         -0.0547      0.078   -0.208    0.099
State: Idaho            0.3316      0.108    0.121    0.543
State: Illinois         0.9745      0.088    0.802    1.147
State: Indiana          0.9326      0.090    0.756    1.109
State: Iowa             1.2884      0.090    1.113    1.464
State: Kansas           0.3538      0.089    0.180    0.528
State: Kentucky         0.7534      0.086    0.584    0.923
State: Louisiana       -0.1778      0.093   -0.361    0.005
State: Maine            2.1385      0.150    1.843    2.434
State: Maryland         0.8010      0.130    0.547    1.055
State: Massachusetts    2.5254      0.161    2.211    2.840
State: Michigan         1.3539      0.091    1.175    1.532
State: Minnesota        1.3040      0.092    1.123    1.485
State: Mississippi     -0.0042      0.089   -0.178    0.170
State: Missouri         0.6297      0.086    0.462    0.798
State: Montana          1.0762      0.102    0.876    1.277
State: Nebraska         0.3433      0.092    0.162    0.524
State: Nevada           0.2345      0.147   -0.054    0.523
State: New Hampshire    2.1916      0.183    1.833    2.550
State: New Jersey       0.8934      0.145    0.609    1.178
State: New Mexico       0.5739      0.125    0.328    0.820
State: New York         1.3975      0.098    1.205    1.590
State: North Carolina   0.7083      0.086    0.540    0.877
State: North Dakota     0.8483      0.104    0.644    1.053
State: Ohio             1.1032      0.092    0.924    1.283
State: Oklahoma         0.2687      0.092    0.088    0.449
State: Oregon           1.2490      0.115    1.024    1.474
State: Pennsylvania     1.1244      0.096    0.936    1.313
State: Rhode Island     2.2675      0.248    1.780    2.755
State: South Carolina   0.2430      0.102    0.043    0.443
State: South Dakota     1.0742      0.098    0.881    1.267
State: Tennessee        0.4817      0.087    0.310    0.653
State: Texas           -0.2096      0.085   -0.376   -0.044
State: Utah             0.2185      0.123   -0.022    0.459
State: Vermont          2.9258      0.159    2.613    3.238
State: Virginia         0.7378      0.083    0.576    0.900
State: Washington       1.3852      0.111    1.167    1.604
State: West Virginia    0.6874      0.100    0.491    0.884
State: Wisconsin        1.7170      0.095    1.530    1.904
State: Wyoming          0.2856      0.132    0.026    0.545

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 dem16_frac 3062 0.72    0.72  0.71

Etas from analysis of variance
 eta eta.part
 CA       0.052    0.098
 S        0.066    0.125
 Black    0.429    0.632
 Asian    0.216    0.380
 Hispanic 0.247    0.424
 State    0.474    0.670

 

Republicans, 2016
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                       0.101      0.018    0.065     0.14
S                       -0.172      0.019   -0.210    -0.13
Black                   -0.746      0.018   -0.781    -0.71
Asian                   -0.272      0.013   -0.297    -0.25
Hispanic                -0.386      0.016   -0.416    -0.36
State: Alabama           0.000         NA       NA       NA
State: Arizona          -1.253      0.173   -1.592    -0.91
State: Arkansas         -0.621      0.095   -0.806    -0.44
State: California       -0.845      0.112   -1.065    -0.62
State: Colorado         -1.264      0.105   -1.471    -1.06
State: Connecticut      -1.754      0.211   -2.167    -1.34
State: Delaware         -1.136      0.328   -1.779    -0.49
State: Florida          -0.531      0.099   -0.725    -0.34
State: Georgia           0.039      0.082   -0.122     0.20
State: Idaho            -0.940      0.112   -1.160    -0.72
State: Illinois         -1.113      0.092   -1.293    -0.93
State: Indiana          -1.052      0.094   -1.236    -0.87
State: Iowa             -1.409      0.094   -1.592    -1.23
State: Kansas           -0.523      0.093   -0.705    -0.34
State: Kentucky         -0.859      0.090   -1.036    -0.68
State: Louisiana         0.118      0.097   -0.073     0.31
State: Maine            -2.384      0.157   -2.692    -2.08
State: Maryland         -0.873      0.135   -1.138    -0.61
State: Massachusetts    -2.649      0.168   -2.978    -2.32
State: Michigan         -1.504      0.095   -1.690    -1.32
State: Minnesota        -1.554      0.096   -1.743    -1.37
State: Mississippi      -0.013      0.093   -0.194     0.17
State: Missouri         -0.726      0.090   -0.902    -0.55
State: Montana          -1.299      0.107   -1.508    -1.09
State: Nebraska         -0.445      0.096   -0.634    -0.26
State: Nevada           -0.537      0.154   -0.839    -0.24
State: New Hampshire    -2.275      0.191   -2.650    -1.90
State: New Jersey       -0.878      0.152   -1.175    -0.58
State: New Mexico       -1.087      0.131   -1.343    -0.83
State: New York         -1.516      0.103   -1.717    -1.32
State: North Carolina   -0.712      0.090   -0.888    -0.54
State: North Dakota     -1.111      0.109   -1.325    -0.90
State: Ohio             -1.207      0.096   -1.395    -1.02
State: Oklahoma         -0.406      0.096   -0.594    -0.22
State: Oregon           -1.500      0.120   -1.735    -1.27
State: Pennsylvania     -1.159      0.101   -1.357    -0.96
State: Rhode Island     -2.342      0.259   -2.851    -1.83
State: South Carolina   -0.334      0.107   -0.543    -0.12
State: South Dakota     -1.256      0.103   -1.457    -1.05
State: Tennessee        -0.538      0.091   -0.717    -0.36
State: Texas             0.189      0.088    0.016     0.36
State: Utah             -1.243      0.128   -1.493    -0.99
State: Vermont          -3.081      0.166   -3.407    -2.75
State: Virginia         -0.840      0.086   -1.010    -0.67
State: Washington       -1.572      0.116   -1.800    -1.34
State: West Virginia    -0.822      0.105   -1.028    -0.62
State: Wisconsin        -1.806      0.099   -2.001    -1.61
State: Wyoming          -0.525      0.138   -0.796    -0.25

Model meta-data
 outcome    N  R2 R2-adj. R2-cv
 1 rep16_frac 3062 0.7    0.69  0.68

Etas from analysis of variance
 eta eta.part
 CA       0.056     0.10
 S        0.089     0.16
 Black    0.418     0.61
 Asian    0.216     0.37
 Hispanic 0.248     0.41
 State    0.496     0.67

 

Greens, 2016
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                      -0.150      0.025   -0.198   -0.101
S                        0.076      0.027    0.023    0.128
Black                   -0.093      0.024   -0.140   -0.045
Asian                    0.097      0.017    0.063    0.131
Hispanic                -0.030      0.021   -0.072    0.012
State: Alabama           0.000         NA       NA       NA
State: Arizona           1.561      0.215    1.139    1.983
State: Arkansas          0.542      0.118    0.310    0.773
State: California        1.970      0.142    1.691    2.248
State: Colorado          1.466      0.133    1.206    1.726
State: Connecticut       1.942      0.263    1.426    2.458
State: Delaware          1.605      0.407    0.806    2.404
State: Florida           0.399      0.124    0.157    0.642
State: Idaho             0.990      0.141    0.712    1.267
State: Illinois          1.163      0.116    0.936    1.390
State: Iowa              0.403      0.118    0.171    0.635
State: Kansas            2.333      0.117    2.103    2.563
State: Kentucky          0.362      0.114    0.138    0.586
State: Louisiana         0.273      0.121    0.036    0.510
State: Maine             2.606      0.196    2.221    2.991
State: Maryland          1.284      0.169    0.952    1.615
State: Massachusetts     2.365      0.210    1.954    2.777
State: Michigan          1.129      0.120    0.895    1.364
State: Minnesota         1.077      0.122    0.837    1.316
State: Mississippi      -0.045      0.115   -0.271    0.181
State: Missouri          0.475      0.113    0.253    0.696
State: Montana           1.407      0.135    1.143    1.671
State: Nebraska          0.603      0.122    0.363    0.842
State: New Hampshire     0.944      0.239    0.477    1.412
State: New Jersey        0.895      0.190    0.522    1.268
State: New Mexico        1.037      0.164    0.715    1.359
State: New York          2.048      0.129    1.795    2.301
State: North Dakota      1.145      0.137    0.876    1.415
State: Ohio              0.700      0.121    0.463    0.937
State: Oregon            2.651      0.150    2.356    2.946
State: Pennsylvania      0.653      0.127    0.405    0.902
State: Rhode Island      1.675      0.323    1.041    2.308
State: South Carolina    0.301      0.133    0.041    0.560
State: Tennessee         0.200      0.115   -0.025    0.424
State: Texas             0.299      0.112    0.079    0.519
State: Utah              0.267      0.161   -0.048    0.582
State: Vermont           2.966      0.208    2.558    3.374
State: Virginia          0.475      0.108    0.264    0.687
State: Washington        1.454      0.146    1.167    1.740
State: West Virginia     1.012      0.132    0.753    1.271
State: Wisconsin         1.021      0.126    0.775    1.267
State: Wyoming           0.868      0.173    0.529    1.208

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 green16_frac 2556 0.54    0.53  0.54

Etas from analysis of variance
 eta eta.part
 CA       0.082    0.119
 S        0.039    0.057
 Black    0.052    0.076
 Asian    0.077    0.112
 Hispanic 0.019    0.028
 State    0.591    0.655

 

Libertarians, 2016
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                     -0.0038      0.017  -0.0373   0.0296
S                       0.3505      0.018   0.3146   0.3865
Black                  -0.0317      0.017  -0.0648   0.0015
Asian                   0.0143      0.012  -0.0091   0.0377
Hispanic                0.0738      0.015   0.0449   0.1026
State: Alabama          0.0000         NA       NA       NA
State: Arizona          1.2045      0.163   0.8846   1.5244
State: Arkansas         0.2946      0.089   0.1192   0.4700
State: California       0.6799      0.106   0.4719   0.8880
State: Colorado         1.0910      0.099   0.8962   1.2858
State: Connecticut      0.3227      0.199  -0.0684   0.7138
State: Delaware         0.7064      0.310   0.0984   1.3144
State: Florida          0.0761      0.093  -0.1071   0.2593
State: Georgia          0.3307      0.077   0.1789   0.4826
State: Idaho            0.6224      0.106   0.4142   0.8307
State: Illinois         1.2047      0.087   1.0347   1.3748
State: Indiana          1.6818      0.089   1.5075   1.8561
State: Iowa             0.4954      0.088   0.3221   0.6687
State: Kansas           0.9395      0.088   0.7679   1.1111
State: Kentucky         0.4006      0.085   0.2331   0.5680
State: Louisiana       -0.0810      0.092  -0.2614   0.0995
State: Maine            1.9222      0.149   1.6309   2.2136
State: Maryland         0.4547      0.128   0.2039   0.7056
State: Massachusetts    0.8918      0.159   0.5809   1.2028
State: Michigan         1.0787      0.090   0.9024   1.2549
State: Minnesota        0.7014      0.091   0.5227   0.8801
State: Mississippi     -0.1593      0.088  -0.3309   0.0123
State: Missouri         0.6371      0.085   0.4711   0.8032
State: Montana          1.7722      0.101   1.5742   1.9703
State: Nebraska         0.9864      0.091   0.8076   1.1652
State: Nevada           0.8487      0.145   0.5635   1.1339
State: New Hampshire    0.9316      0.181   0.5773   1.2860
State: New Jersey      -0.4833      0.143  -0.7645  -0.2021
State: New Mexico       4.4179      0.124   4.1754   4.6604
State: New York         0.7390      0.097   0.5490   0.9291
State: North Carolina   0.3557      0.085   0.1894   0.5220
State: North Dakota     2.0401      0.103   1.8380   2.2422
State: Ohio             0.6618      0.090   0.4846   0.8391
State: Oklahoma         1.7475      0.091   1.5691   1.9259
State: Oregon           1.8205      0.113   1.5986   2.0424
State: Pennsylvania     0.0888      0.095  -0.0976   0.2753
State: Rhode Island     0.5527      0.245   0.0718   1.0336
State: South Carolina   0.1063      0.101  -0.0913   0.3040
State: South Dakota     1.6102      0.097   1.4197   1.8008
State: Tennessee        0.2270      0.086   0.0577   0.3964
State: Texas            0.1331      0.084  -0.0307   0.2970
State: Utah            -0.0389      0.121  -0.2762   0.1983
State: Vermont          0.6762      0.157   0.3676   0.9847
State: Virginia         0.3101      0.082   0.1500   0.4701
State: Washington       1.1375      0.110   0.9218   1.3532
State: West Virginia    0.7544      0.099   0.5600   0.9488
State: Wisconsin        0.5313      0.094   0.3471   0.7155
State: Wyoming          1.5085      0.131   1.2524   1.7645

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 libert16_frac 3062 0.73    0.73  0.72
Etas from analysis of variance
 eta eta.part
 CA       0.0021   0.0041
 S        0.1810   0.3291
 Black    0.0177   0.0341
 Asian    0.0114   0.0219
 Hispanic 0.0475   0.0910
 State    0.6146   0.7637

 

Democrats, 2012
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                      -0.136      0.018   -0.172   -0.099
S                       -0.026      0.020   -0.065    0.013
Black                    0.646      0.018    0.611    0.682
Asian                    0.210      0.013    0.185    0.236
Hispanic                 0.319      0.016    0.288    0.350
State: Alabama           0.000         NA       NA       NA
State: Arizona           0.959      0.177    0.612    1.306
State: Arkansas          0.376      0.097    0.186    0.566
State: California        0.845      0.115    0.620    1.071
State: Colorado          1.324      0.108    1.113    1.534
State: Connecticut       2.204      0.216    1.781    2.628
State: Delaware          1.401      0.336    0.742    2.059
State: Florida           0.604      0.101    0.406    0.803
State: Georgia          -0.057      0.084   -0.221    0.108
State: Idaho             0.488      0.115    0.262    0.714
State: Illinois          1.424      0.094    1.240    1.608
State: Indiana           1.322      0.096    1.134    1.511
State: Iowa              2.040      0.096    1.853    2.228
State: Kansas            0.448      0.095    0.263    0.634
State: Kentucky          0.844      0.093    0.662    1.025
State: Louisiana        -0.248      0.100   -0.444   -0.053
State: Maine             2.602      0.161    2.286    2.918
State: Maryland          1.135      0.139    0.863    1.407
State: Massachusetts     2.750      0.172    2.413    3.087
State: Michigan          1.806      0.097    1.615    1.997
State: Minnesota         2.026      0.099    1.833    2.220
State: Mississippi      -0.059      0.095   -0.244    0.127
State: Missouri          0.973      0.092    0.793    1.152
State: Montana           1.290      0.109    1.075    1.504
State: Nebraska          0.644      0.099    0.451    0.838
State: Nevada            0.517      0.158    0.208    0.826
State: New Hampshire     2.567      0.196    2.183    2.951
State: New Jersey        1.401      0.155    1.097    1.706
State: New Mexico        0.835      0.134    0.572    1.097
State: New York          1.946      0.105    1.740    2.152
State: North Carolina    0.790      0.092    0.610    0.970
State: North Dakota      1.439      0.112    1.220    1.658
State: Ohio              1.662      0.098    1.470    1.854
State: Oklahoma          0.369      0.099    0.175    0.562
State: Oregon            1.403      0.123    1.163    1.644
State: Pennsylvania      1.479      0.103    1.277    1.681
State: Rhode Island      2.731      0.266    2.210    3.252
State: South Carolina    0.320      0.109    0.106    0.534
State: South Dakota      1.538      0.105    1.332    1.743
State: Tennessee         0.603      0.094    0.420    0.787
State: Texas            -0.236      0.091   -0.413   -0.058
State: Utah              0.032      0.131   -0.225    0.289
State: Vermont           3.380      0.170    3.046    3.714
State: Virginia          0.967      0.088    0.794    1.141
State: Washington        1.511      0.119    1.278    1.745
State: West Virginia     0.928      0.107    0.718    1.139
State: Wisconsin         2.270      0.102    2.070    2.469
State: Wyoming           0.439      0.141    0.162    0.717

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 dem12_frac 3063 0.68    0.68  0.67

Etas from analysis of variance
 eta eta.part
 CA       0.075    0.132
 S        0.013    0.024
 Black    0.363    0.542
 Asian    0.167    0.285
 Hispanic 0.205    0.343
 State    0.619    0.740

 

Republicans 2012
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                       0.138      0.019    0.102    0.175
S                        0.026      0.020   -0.013    0.066
Black                   -0.624      0.019   -0.661   -0.588
Asian                   -0.211      0.013   -0.237   -0.185
Hispanic                -0.310      0.016   -0.341   -0.278
State: Alabama           0.000         NA       NA       NA
State: Arizona          -1.016      0.179   -1.367   -0.665
State: Arkansas         -0.481      0.098   -0.674   -0.288
State: California       -0.973      0.117   -1.201   -0.744
State: Colorado         -1.411      0.109   -1.625   -1.197
State: Connecticut      -2.210      0.219   -2.640   -1.781
State: Delaware         -1.425      0.341   -2.092   -0.757
State: Florida          -0.596      0.103   -0.797   -0.395
State: Georgia           0.047      0.085   -0.120    0.214
State: Idaho            -0.582      0.117   -0.810   -0.353
State: Illinois         -1.469      0.095   -1.656   -1.282
State: Indiana          -1.378      0.098   -1.569   -1.187
State: Iowa             -2.066      0.097   -2.256   -1.875
State: Kansas           -0.506      0.096   -0.695   -0.318
State: Kentucky         -0.859      0.094   -1.043   -0.676
State: Louisiana         0.208      0.101    0.010    0.406
State: Maine            -2.698      0.163   -3.018   -2.378
State: Maryland         -1.211      0.140   -1.486   -0.935
State: Massachusetts    -2.796      0.174   -3.137   -2.455
State: Michigan         -1.792      0.099   -1.986   -1.599
State: Minnesota        -2.093      0.100   -2.290   -1.897
State: Mississippi       0.047      0.096   -0.142    0.235
State: Missouri         -1.027      0.093   -1.210   -0.845
State: Montana          -1.390      0.111   -1.608   -1.173
State: Nebraska         -0.696      0.100   -0.893   -0.500
State: Nevada           -0.643      0.160   -0.957   -0.330
State: New Hampshire    -2.579      0.198   -2.968   -2.190
State: New Jersey       -1.419      0.157   -1.728   -1.111
State: New Mexico       -1.009      0.136   -1.275   -0.743
State: New York         -1.987      0.106   -2.196   -1.779
State: North Carolina   -0.804      0.093   -0.987   -0.622
State: North Dakota     -1.529      0.113   -1.751   -1.307
State: Ohio             -1.717      0.099   -1.912   -1.523
State: Oklahoma         -0.272      0.100   -0.468   -0.076
State: Oregon           -1.559      0.124   -1.803   -1.315
State: Pennsylvania     -1.482      0.104   -1.687   -1.277
State: Rhode Island     -2.780      0.269   -3.308   -2.252
State: South Carolina   -0.346      0.111   -0.563   -0.129
State: South Dakota     -1.584      0.106   -1.792   -1.376
State: Tennessee        -0.612      0.095   -0.798   -0.426
State: Texas             0.228      0.092    0.048    0.408
State: Utah             -0.084      0.133   -0.345    0.176
State: Vermont          -3.447      0.173   -3.786   -3.108
State: Virginia         -1.010      0.090   -1.185   -0.834
State: Washington       -1.601      0.121   -1.838   -1.364
State: West Virginia    -0.989      0.109   -1.202   -0.775
State: Wisconsin        -2.262      0.103   -2.464   -2.059
State: Wyoming          -0.581      0.143   -0.862   -0.300

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 rep12_frac 3063 0.67    0.67  0.66

Etas from analysis of variance
 eta eta.part
 CA       0.077    0.133
 S        0.014    0.024
 Black    0.350    0.523
 Asian    0.168    0.282
 Hispanic 0.200    0.330
 State    0.626    0.739

 

Democrats, 2008
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                      -0.118      0.020   -0.156  -0.0793
S                       -0.045      0.021   -0.086  -0.0038
Black                    0.609      0.019    0.571   0.6470
Asian                    0.215      0.014    0.188   0.2415
Hispanic                 0.280      0.017    0.247   0.3131
State: Alabama           0.000         NA       NA       NA
State: Arizona           1.005      0.187    0.639   1.3719
State: Arkansas          0.477      0.103    0.276   0.6776
State: California        1.054      0.122    0.815   1.2922
State: Colorado          1.512      0.114    1.289   1.7349
State: Connecticut       2.444      0.229    1.996   2.8920
State: Delaware          1.666      0.355    0.969   2.3626
State: Florida           0.700      0.107    0.491   0.9104
State: Georgia           0.014      0.089   -0.160   0.1883
State: Idaho             0.626      0.122    0.388   0.8650
State: Illinois          1.867      0.099    1.672   2.0617
State: Indiana           1.758      0.102    1.558   1.9573
State: Iowa              2.236      0.101    2.038   2.4347
State: Kansas            0.592      0.100    0.395   0.7887
State: Kentucky          1.068      0.098    0.876   1.2600
State: Louisiana        -0.253      0.105   -0.460  -0.0461
State: Maine             2.698      0.170    2.364   3.0317
State: Maryland          1.211      0.147    0.924   1.4988
State: Massachusetts     2.916      0.182    2.559   3.2718
State: Michigan          2.100      0.103    1.898   2.3017
State: Minnesota         2.170      0.104    1.966   2.3752
State: Mississippi      -0.057      0.100   -0.253   0.1401
State: Missouri          1.308      0.097    1.117   1.4978
State: Montana           1.603      0.116    1.376   1.8296
State: Nebraska          0.800      0.104    0.595   1.0050
State: Nevada            0.809      0.167    0.482   1.1356
State: New Hampshire     2.730      0.207    2.324   3.1360
State: New Jersey        1.424      0.164    1.102   1.7461
State: New Mexico        1.208      0.142    0.930   1.4857
State: New York          1.978      0.111    1.760   2.1954
State: North Carolina    0.923      0.097    0.732   1.1133
State: North Dakota      1.820      0.118    1.588   2.0512
State: Ohio              1.728      0.104    1.525   1.9308
State: Oklahoma          0.369      0.104    0.165   0.5737
State: Oregon            1.610      0.130    1.356   1.8644
State: Pennsylvania      1.727      0.109    1.513   1.9406
State: Rhode Island      2.849      0.281    2.298   3.3999
State: South Carolina    0.396      0.115    0.170   0.6227
State: South Dakota      1.819      0.111    1.602   2.0364
State: Tennessee         0.765      0.099    0.571   0.9589
State: Texas            -0.020      0.096   -0.208   0.1673
State: Utah              0.510      0.139    0.238   0.7816
State: Vermont           3.485      0.180    3.132   3.8387
State: Virginia          1.154      0.094    0.971   1.3373
State: Washington        1.662      0.126    1.415   1.9092
State: West Virginia     1.408      0.114    1.185   1.6309
State: Wisconsin         2.585      0.108    2.374   2.7964
State: Wyoming           0.669      0.150    0.375   0.9618

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 dem08_frac 3063 0.65    0.64  0.63

Etas from analysis of variance
 eta eta.part
 CA       0.065    0.109
 S        0.023    0.039
 Black    0.342    0.498
 Asian    0.171    0.276
 Hispanic 0.180    0.290
 State    0.650    0.738

 

Republicans, 2008
Model coefficients
Estimate Std. Error CI.lower CI.upper
CA                       0.118      0.020   0.0795    0.157
S                        0.055      0.021   0.0137    0.096
Black                   -0.586      0.019  -0.6237   -0.548
Asian                   -0.213      0.014  -0.2394   -0.186
Hispanic                -0.269      0.017  -0.3026   -0.236
State: Alabama           0.000         NA       NA       NA
State: Arizona          -1.026      0.188  -1.3945   -0.658
State: Arkansas         -0.612      0.103  -0.8139   -0.410
State: California       -1.160      0.122  -1.3994   -0.920
State: Colorado         -1.571      0.114  -1.7953   -1.347
State: Connecticut      -2.479      0.230  -2.9297   -2.029
State: Delaware         -1.684      0.357  -2.3848   -0.984
State: Florida          -0.698      0.108  -0.9085   -0.486
State: Georgia          -0.012      0.089  -0.1866    0.163
State: Idaho            -0.725      0.122  -0.9651   -0.485
State: Illinois         -1.905      0.100  -2.1011   -1.709
State: Indiana          -1.771      0.102  -1.9721   -1.571
State: Iowa             -2.277      0.102  -2.4770   -2.078
State: Kansas           -0.638      0.101  -0.8356   -0.440
State: Kentucky         -1.087      0.098  -1.2802   -0.894
State: Louisiana         0.201      0.106  -0.0064    0.409
State: Maine            -2.753      0.171  -3.0890   -2.418
State: Maryland         -1.276      0.147  -1.5644   -0.987
State: Massachusetts    -3.008      0.183  -3.3657   -2.649
State: Michigan         -2.146      0.104  -2.3493   -1.943
State: Minnesota        -2.269      0.105  -2.4747   -2.063
State: Mississippi       0.046      0.101  -0.1518    0.244
State: Missouri         -1.342      0.098  -1.5336   -1.151
State: Montana          -1.760      0.116  -1.9885   -1.532
State: Nebraska         -0.861      0.105  -1.0665   -0.655
State: Nevada           -0.984      0.168  -1.3127   -0.656
State: New Hampshire    -2.747      0.208  -3.1548   -2.339
State: New Jersey       -1.454      0.165  -1.7781   -1.130
State: New Mexico       -1.242      0.142  -1.5216   -0.963
State: New York         -2.012      0.112  -2.2308   -1.793
State: North Carolina   -0.927      0.098  -1.1188   -0.736
State: North Dakota     -1.899      0.119  -2.1321   -1.666
State: Ohio             -1.786      0.104  -1.9901   -1.582
State: Oklahoma         -0.273      0.105  -0.4785   -0.067
State: Oregon           -1.750      0.130  -2.0059   -1.495
State: Pennsylvania     -1.746      0.110  -1.9607   -1.531
State: Rhode Island     -2.922      0.283  -3.4759   -2.368
State: South Carolina   -0.429      0.116  -0.6565   -0.201
State: South Dakota     -1.893      0.111  -2.1112   -1.674
State: Tennessee        -0.788      0.099  -0.9826   -0.593
State: Texas             0.027      0.096  -0.1613    0.216
State: Utah             -0.652      0.139  -0.9248   -0.378
State: Vermont          -3.556      0.181  -3.9110   -3.200
State: Virginia         -1.176      0.094  -1.3603   -0.992
State: Washington       -1.738      0.127  -1.9868   -1.490
State: West Virginia    -1.450      0.114  -1.6740   -1.226
State: Wisconsin        -2.613      0.108  -2.8253   -2.401
State: Wyoming          -0.781      0.150  -1.0759   -0.486

Model meta-data
 outcome    N   R2 R2-adj. R2-cv
 1 rep08_frac 3063 0.64    0.64  0.63

Etas from analysis of variance
 eta eta.part
 CA       0.065    0.109
 S        0.028    0.047
 Black    0.329    0.482
 Asian    0.169    0.272
 Hispanic 0.174    0.279
 State    0.661    0.741

Summary & interpretation

In general, the models performed fairly well, the mean cross-validated R2 was 65% (54% to 72%). The best way to summarize the findings for the predictors would be to aggregate/meta-analyze the results. I’m too busy to do that now, so we will just look at the non-state predictors presented in less space:

     CA     S Black Asian Hispanic       group
1 -0.09  0.13  0.77  0.27     0.38   fit_dem16
2  0.10 -0.17 -0.75 -0.27    -0.39   fit_rep16
3 -0.15  0.08 -0.09  0.10    -0.03 fit_green16
4  0.00  0.35 -0.03  0.01     0.07 fit_liber16
5 -0.14 -0.03  0.65  0.21     0.32   fit_dem12
6  0.14  0.03 -0.62 -0.21    -0.31   fit_rep12
7 -0.12 -0.04  0.61  0.21     0.28   fit_dem08
8  0.12  0.06 -0.59 -0.21    -0.27   fit_rep08

So, for predicting democrat votes, we can see that the betas are all negative for CA: -.09, -.14 and -.12. All else equal, smarter counties voted less for democrats, whether it was Clinton or Obama. S is weird. The beta for 2016 was .13 but it was -.03 and -.04 for 2012 and 2008! A sign change and it’s not a chance finding because the use of a dataset with n≈3,000 gives us a lot of precision, and none of these did actually have CIs that even overlapped zero. So for 2016 this gives us the odd situation where the highly correlated CA and S variables (r = .71) have reverse signs for the outcome: -.09 and .13. Smarter counties voted less for democrats, but those higher in S voted more for democrats — all else equal. That wasn’t so in the Obama elections where CA and S had the same directions. As for demographics, the situation is not surprising: non-Whites like democrats, a lot. We knew this from simpler statistics showing that Blacks vote 93% for Obama. The curious finding here is that this was not just due to the lower CA and S for Blacks or Hispanics. The Black effect was even stronger for the 2016 election than the Obama ones, which is somewhat curious. The general idea seems to be that minorities like to vote for their own candidates, but it seems not to be the case for these data. Or there’s some annoying confound, like turnout %. Hispanics are voting increasingly for democrats (betas: .28 to .32 to .38) and Asians too, maybe (.21 to .21 to .27). The republican results are not so interesting because they are essentially the opposite of the democrat results (for non-2016, they are necessarily the opposite because NYT did away with the third party votes).

Results for the two smaller parties are somewhat interesting. Greens showed the same mismatch in directionality for CA and S, just with reversed beta strengths (-.15 and .08; CA stronger, reverse for democrats). Interestingly for libertarians, there was no effect of CA, but a large one of S (.35). Given the generally positive correlations between libertarian preferences and CA, this is somewhat surprising (see this and this). Perhaps more interestingly, demographics had little to no effect on preferences for libertarians. This was also true to a bit lesser extent for greens.

The relative importance of variables can be glanced from the etas. Most of the models’ validity is due to state-level effects (whatever these represent) and demographics, mostly % Blacks. The mean eta for State was .59 (range: .47 to .66), and for Black .29 (.02 to .43). The small values for Black are from the third parties which, as we saw, were not a thing that Blacks cared much about as a group once controlled for CA and S. CA and S themselves had mean etas of .06. As such, cognitive ability and social inequality were not particularly important for explaining the election outcomes at the county level.

Other notes:

  • Analyses were unweighted. I reasoned that we are here thinking of the counties as the units of interest, and so we should weigh them equally, not give more weight to the larger counties. We would do that if we were interested in modeling the national outcome itself or persons inside counties.
  • For the Green’s analysis, n≈2,500. Why is n only about 2,500 instead of 3,000? Because the Greens did not run in all states, and so these have missing data. Perhaps one should impute these values, maybe with 0%, maybe with estimated values.