Overview

The appendix is meant to serve as a place to include information that is not suitable for the blog, like large amounts of code output, technical details, and any other information. Each section will link to the corresponding blog post. Not every blog post will have information in the appendix.

3. Polls

During the blog post for polls, I built two linear models: a so called fundamentals model that is based on the economy, and the polls plus model that adds in the impact of vote shares. While the most important information was discussed in the blog post, there is some value in seeing the full regression output which is provided below. These are two sided models, meaning that there is a seperate model for candidates from the incumbent party, and from the challenging party.First, the updated fundamentals model for the incumbent:

## 
## Call:
## lm(formula = inc_pv ~ rdi_q2 + gdp + period + state, data = reg_df %>% 
##     filter(year < 2020, incumbent_party == TRUE))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.586  -5.876  -0.108   6.397  26.717 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                49.5461     3.3620  14.737  < 2e-16 ***
## rdi_q2                      0.2353     0.1206   1.951  0.05178 .  
## gdp                         3.1317     0.5414   5.784 1.44e-08 ***
## period1992-2000            -7.5346     1.5269  -4.935 1.16e-06 ***
## period2000-2012            -3.6555     1.3846  -2.640  0.00860 ** 
## period2016-2020            -5.5148     1.9175  -2.876  0.00423 ** 
## stateAlaska                -5.7579     4.9950  -1.153  0.24968    
## stateArizona               -0.7046     4.5788  -0.154  0.87777    
## stateArkansas              -3.0012     4.5750  -0.656  0.51218    
## stateCalifornia            -1.3591     4.1330  -0.329  0.74245    
## stateColorado              -4.1072     4.4326  -0.927  0.35468    
## stateConnecticut           -0.4350     4.1328  -0.105  0.91623    
## stateDelaware              -2.4641     4.4388  -0.555  0.57911    
## stateDistrict of Columbia  10.8615     6.3903   1.700  0.08994 .  
## stateFlorida                0.4663     4.3107   0.108  0.91390    
## stateGeorgia               -0.0800     4.5789  -0.017  0.98607    
## stateHawaii                 0.4232     4.4310   0.096  0.92395    
## stateIdaho                 -6.3870     4.9923  -1.279  0.20148    
## stateIllinois              -0.5636     4.1391  -0.136  0.89175    
## stateIndiana               -2.2652     4.4329  -0.511  0.60963    
## stateIowa                  -2.8968     4.3250  -0.670  0.50338    
## stateKansas                -1.3178     4.2203  -0.312  0.75501    
## stateKentucky              -2.2043     4.4322  -0.497  0.61921    
## stateLouisiana             -0.9510     4.5792  -0.208  0.83559    
## stateMaine                 -0.4962     4.7576  -0.104  0.91698    
## stateMaryland              -0.2925     4.3152  -0.068  0.94598    
## stateMassachusetts         -1.5174     4.3105  -0.352  0.72499    
## stateMichigan              -1.1842     4.2168  -0.281  0.77898    
## stateMinnesota             -3.6474     4.1440  -0.880  0.37928    
## stateMississippi            0.5242     4.7598   0.110  0.91236    
## stateMissouri              -1.7158     4.2160  -0.407  0.68424    
## stateMontana               -5.3714     4.5806  -1.173  0.24161    
## stateNebraska              -0.1835     4.3169  -0.043  0.96612    
## stateNevada                -2.8150     4.5780  -0.615  0.53897    
## stateNew Hampshire         -0.1694     4.5827  -0.037  0.97052    
## stateNew Jersey             1.1620     4.1345   0.281  0.77880    
## stateNew Mexico            -1.8630     4.5792  -0.407  0.68433    
## stateNew York              -2.9712     4.1402  -0.718  0.47337    
## stateNorth Carolina         0.8889     4.2163   0.211  0.83313    
## stateNorth Dakota          -5.5309     4.4452  -1.244  0.21411    
## stateOhio                  -1.4722     4.1345  -0.356  0.72196    
## stateOklahoma              -4.5502     4.7591  -0.956  0.33959    
## stateOregon                -2.9532     4.2192  -0.700  0.48435    
## statePennsylvania          -1.3644     4.4363  -0.308  0.75857    
## stateRhode Island          -0.3705     4.4328  -0.084  0.93343    
## stateSouth Carolina        -1.1537     4.4386  -0.260  0.79505    
## stateSouth Dakota          -3.9212     4.5825  -0.856  0.39266    
## stateTennessee             -1.2635     4.5787  -0.276  0.78273    
## stateTexas                 -1.2575     4.3118  -0.292  0.77070    
## stateUtah                  -1.5278     4.3168  -0.354  0.72358    
## stateVermont               -2.0960     4.5790  -0.458  0.64738    
## stateVirginia               0.2682     4.3105   0.062  0.95042    
## stateWashington            -2.5460     4.2138  -0.604  0.54604    
## stateWest Virginia         -3.7123     4.3106  -0.861  0.38962    
## stateWisconsin             -2.3188     4.3122  -0.538  0.59105    
## stateWyoming               -6.7698     4.9881  -1.357  0.17546    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.638 on 415 degrees of freedom
## Multiple R-squared:  0.175,  Adjusted R-squared:  0.06564 
## F-statistic:   1.6 on 55 and 415 DF,  p-value: 0.006087

Then, for the challenger:

## 
## Call:
## lm(formula = chl_pv ~ rdi_q2 + gdp + period + state, data = reg_df %>% 
##     filter(year < 2020, incumbent_party == FALSE))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -28.313  -5.150   0.126   5.509  51.661 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                47.784224   3.137324  15.231  < 2e-16 ***
## rdi_q2                     -0.156478   0.112588  -1.390 0.165325    
## gdp                        -1.688159   0.505247  -3.341 0.000910 ***
## period1992-2000            -0.534162   1.424854  -0.375 0.707934    
## period2000-2012             4.603864   1.292056   3.563 0.000409 ***
## period2016-2020             3.073764   1.789315   1.718 0.086571 .  
## stateAlaska                -3.850431   4.661216  -0.826 0.409246    
## stateArizona               -2.041250   4.272839  -0.478 0.633096    
## stateArkansas               1.100729   4.269297   0.258 0.796670    
## stateCalifornia            -1.705084   3.856770  -0.442 0.658646    
## stateColorado              -0.084933   4.136364  -0.021 0.983628    
## stateConnecticut           -2.385483   3.856625  -0.619 0.536558    
## stateDelaware               0.143886   4.142158   0.035 0.972306    
## stateDistrict of Columbia -11.500359   5.963309  -1.929 0.054472 .  
## stateFlorida               -1.685789   4.022656  -0.419 0.675379    
## stateGeorgia               -0.157727   4.272892  -0.037 0.970572    
## stateHawaii                -3.572543   4.134901  -0.864 0.388088    
## stateIdaho                 -1.569038   4.658646  -0.337 0.736437    
## stateIllinois              -0.788827   3.862513  -0.204 0.838277    
## stateIndiana                0.416822   4.136676   0.101 0.919788    
## stateIowa                   0.530261   4.036013   0.131 0.895537    
## stateKansas                -2.053620   3.938284  -0.521 0.602331    
## stateKentucky               1.265126   4.136018   0.306 0.759849    
## stateLouisiana              0.220302   4.273159   0.052 0.958908    
## stateMaine                 -2.987572   4.439688  -0.673 0.501370    
## stateMaryland              -0.508498   4.026798  -0.126 0.899573    
## stateMassachusetts         -2.879135   4.022424  -0.716 0.474535    
## stateMichigan              -0.653853   3.935034  -0.166 0.868110    
## stateMinnesota              0.013422   3.867030   0.003 0.997232    
## stateMississippi            0.067926   4.441734   0.015 0.987806    
## stateMissouri               0.113065   3.934250   0.029 0.977087    
## stateMontana                0.453681   4.274481   0.106 0.915525    
## stateNebraska              -2.532550   4.028412  -0.629 0.529910    
## stateNevada                 0.702459   4.272109   0.164 0.869473    
## stateNew Hampshire         -2.621784   4.276457  -0.613 0.540163    
## stateNew Jersey            -2.709793   3.858162  -0.702 0.482853    
## stateNew Mexico            -0.883489   4.273159  -0.207 0.836304    
## stateNew York              -4.235493   3.863532  -1.096 0.273594    
## stateNorth Carolina        -1.289240   3.934533  -0.328 0.743324    
## stateNorth Dakota           1.675393   4.148111   0.404 0.686499    
## stateOhio                  -0.742287   3.858258  -0.192 0.847531    
## stateOklahoma               1.330626   4.441124   0.300 0.764621    
## stateOregon                -0.750372   3.937278  -0.191 0.848947    
## statePennsylvania          -0.172776   4.139884  -0.042 0.966730    
## stateRhode Island          -3.964646   4.136613  -0.958 0.338405    
## stateSouth Carolina         1.421124   4.141994   0.343 0.731696    
## stateSouth Dakota           1.505309   4.276283   0.352 0.725007    
## stateTennessee              1.369699   4.272752   0.321 0.748701    
## stateTexas                 -0.002649   4.023637  -0.001 0.999475    
## stateUtah                  -5.025799   4.028320  -1.248 0.212875    
## stateVermont               -3.244297   4.272986  -0.759 0.448130    
## stateVirginia              -1.311202   4.022422  -0.326 0.744609    
## stateWashington            -1.544308   3.932234  -0.393 0.694720    
## stateWest Virginia          2.383035   4.022588   0.592 0.553896    
## stateWisconsin             -0.354337   4.024024  -0.088 0.929875    
## stateWyoming                1.880744   4.654795   0.404 0.686388    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.994 on 415 degrees of freedom
## Multiple R-squared:  0.1633, Adjusted R-squared:  0.05241 
## F-statistic: 1.473 on 55 and 415 DF,  p-value: 0.02009

I also built the polls plus model, that uses the fundamentals and a polling average as predictors in a linear model. For the incumbent, the regression results are as follows:

## 
## Call:
## lm(formula = inc_pv ~ rdi_q2 + gdp + period + state + avg_poll, 
##     data = reg_df %>% filter(year < 2020, incumbent_party == 
##         TRUE))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.1444  -2.7123  -0.3084   2.4622  14.2650 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                7.77473    1.93997   4.008 7.27e-05 ***
## rdi_q2                    -0.03763    0.05769  -0.652   0.5145    
## gdp                       -0.51858    0.27438  -1.890   0.0595 .  
## period1992-2000           -1.67410    0.74070  -2.260   0.0243 *  
## period2000-2012           -2.68327    0.65731  -4.082 5.35e-05 ***
## period2016-2020           -3.82300    0.91068  -4.198 3.30e-05 ***
## stateAlaska               -0.74105    2.37320  -0.312   0.7550    
## stateArizona               0.66868    2.17236   0.308   0.7584    
## stateArkansas             -0.38088    2.17137  -0.175   0.8608    
## stateCalifornia            0.79189    1.96138   0.404   0.6866    
## stateColorado             -0.83474    2.10446  -0.397   0.6918    
## stateConnecticut           0.72714    1.96072   0.371   0.7109    
## stateDelaware              2.48921    2.10970   1.180   0.2387    
## stateDistrict of Columbia -2.02249    3.05048  -0.663   0.5077    
## stateFlorida              -1.79313    2.04576  -0.877   0.3813    
## stateGeorgia              -0.61747    2.17213  -0.284   0.7763    
## stateHawaii                1.66983    2.10220   0.794   0.4275    
## stateIdaho                -1.14665    2.37223  -0.483   0.6291    
## stateIllinois             -1.54123    1.96365  -0.785   0.4330    
## stateIndiana              -0.75112    2.10322  -0.357   0.7212    
## stateIowa                 -1.00141    2.05228  -0.488   0.6258    
## stateKansas               -0.15063    2.00223  -0.075   0.9401    
## stateKentucky             -1.36758    2.10263  -0.650   0.5158    
## stateLouisiana             0.83238    2.17274   0.383   0.7018    
## stateMaine                -0.27646    2.25689  -0.122   0.9026    
## stateMaryland             -0.13975    2.04699  -0.068   0.9456    
## stateMassachusetts        -0.30791    2.04502  -0.151   0.8804    
## stateMichigan              0.67992    2.00095   0.340   0.7342    
## stateMinnesota            -2.53006    1.96599  -1.287   0.1988    
## stateMississippi          -1.20856    2.25838  -0.535   0.5928    
## stateMissouri             -1.22681    1.99998  -0.613   0.5399    
## stateMontana              -1.52635    2.17527  -0.702   0.4833    
## stateNebraska              0.20992    2.04784   0.103   0.9184    
## stateNevada               -0.59997    2.17248  -0.276   0.7826    
## stateNew Hampshire        -1.91781    2.17439  -0.882   0.3783    
## stateNew Jersey            1.38345    1.96127   0.705   0.4810    
## stateNew Mexico           -1.11282    2.17231  -0.512   0.6087    
## stateNew York             -3.13277    1.96400  -1.595   0.1115    
## stateNorth Carolina       -1.15674    2.00082  -0.578   0.5635    
## stateNorth Dakota         -1.31717    2.11160  -0.624   0.5331    
## stateOhio                 -1.04430    1.96135  -0.532   0.5947    
## stateOklahoma             -2.16182    2.25849  -0.957   0.3390    
## stateOregon               -0.47301    2.00256  -0.236   0.8134    
## statePennsylvania         -1.14702    2.10448  -0.545   0.5860    
## stateRhode Island          3.61890    2.10546   1.719   0.0864 .  
## stateSouth Carolina        0.74893    2.10615   0.356   0.7223    
## stateSouth Dakota         -0.20961    2.17603  -0.096   0.9233    
## stateTennessee            -0.22018    2.17219  -0.101   0.9193    
## stateTexas                 1.08057    2.04632   0.528   0.5977    
## stateUtah                 -1.81312    2.04778  -0.885   0.3764    
## stateVermont              -1.16334    2.17228  -0.536   0.5926    
## stateVirginia             -0.81492    2.04496  -0.398   0.6905    
## stateWashington            2.04750    2.00260   1.022   0.3072    
## stateWest Virginia        -1.52990    2.04566  -0.748   0.4550    
## stateWisconsin            -0.55627    2.04611  -0.272   0.7859    
## stateWyoming              -0.40271    2.37221  -0.170   0.8653    
## avg_poll                   1.00100    0.02647  37.818  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.572 on 414 degrees of freedom
## Multiple R-squared:  0.8148, Adjusted R-squared:  0.7897 
## F-statistic: 32.52 on 56 and 414 DF,  p-value: < 2.2e-16

Then, we can also look at the results for the challengers:

## 
## Call:
## lm(formula = chl_pv ~ rdi_q2 + gdp + period + state + avg_poll, 
##     data = reg_df %>% filter(year < 2020, incumbent_party == 
##         FALSE))
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -12.9326  -2.6972   0.0469   2.6656  14.7944 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                7.48086    1.91740   3.902 0.000112 ***
## rdi_q2                     0.02889    0.05594   0.517 0.605753    
## gdp                       -1.02471    0.25064  -4.088 5.22e-05 ***
## period1992-2000           -3.11507    0.70858  -4.396 1.40e-05 ***
## period2000-2012           -2.97370    0.67334  -4.416 1.28e-05 ***
## period2016-2020           -0.08646    0.88960  -0.097 0.922627    
## stateAlaska                1.66500    2.31114   0.720 0.471669    
## stateArizona               1.75145    2.11651   0.828 0.408419    
## stateArkansas              0.29568    2.11222   0.140 0.888741    
## stateCalifornia           -1.17007    1.90808  -0.613 0.540069    
## stateColorado             -0.92576    2.04648  -0.452 0.651241    
## stateConnecticut           0.79882    1.91002   0.418 0.676000    
## stateDelaware              1.47825    2.04955   0.721 0.471159    
## stateDistrict of Columbia  1.77797    2.97339   0.598 0.550193    
## stateFlorida               0.20216    1.99079   0.102 0.919164    
## stateGeorgia               1.92473    2.11468   0.910 0.363260    
## stateHawaii                1.57522    2.05066   0.768 0.442834    
## stateIdaho                 0.41230    2.30539   0.179 0.858151    
## stateIllinois              2.60025    1.91321   1.359 0.174852    
## stateIndiana              -0.06539    2.04654  -0.032 0.974527    
## stateIowa                  1.91127    1.99707   0.957 0.339107    
## stateKansas               -0.35123    1.94893  -0.180 0.857069    
## stateKentucky              2.06769    2.04629   1.010 0.312867    
## stateLouisiana             4.65975    2.11765   2.200 0.028328 *  
## stateMaine                 0.16729    2.19817   0.076 0.939372    
## stateMaryland              2.42684    1.99382   1.217 0.224230    
## stateMassachusetts         2.15319    1.99493   1.079 0.281070    
## stateMichigan              2.81558    1.94915   1.445 0.149350    
## stateMinnesota             1.44710    1.91352   0.756 0.449928    
## stateMississippi           1.34196    2.19770   0.611 0.541786    
## stateMissouri              3.26215    1.94834   1.674 0.094822 .  
## stateMontana               2.43593    2.11539   1.152 0.250182    
## stateNebraska              1.12342    1.99555   0.563 0.573766    
## stateNevada                1.53002    2.11362   0.724 0.469544    
## stateNew Hampshire        -0.13635    2.11679  -0.064 0.948671    
## stateNew Jersey            1.69264    1.91267   0.885 0.376691    
## stateNew Mexico            1.94377    2.11549   0.919 0.358722    
## stateNew York             -1.01971    1.91348  -0.533 0.594383    
## stateNorth Carolina        0.82661    1.94739   0.424 0.671443    
## stateNorth Dakota          2.62152    2.05232   1.277 0.202197    
## stateOhio                 -0.54834    1.90876  -0.287 0.774044    
## stateOklahoma              0.26077    2.19731   0.119 0.905589    
## stateOregon                0.74573    1.94830   0.383 0.702094    
## statePennsylvania          2.84321    2.04981   1.387 0.166170    
## stateRhode Island          0.75044    2.05070   0.366 0.714593    
## stateSouth Carolina        1.16096    2.04914   0.567 0.571321    
## stateSouth Dakota          2.53145    2.11576   1.196 0.232196    
## stateTennessee             3.64393    2.11477   1.723 0.085620 .  
## stateTexas                -0.16904    1.99058  -0.085 0.932367    
## stateUtah                 -0.40807    1.99706  -0.204 0.838190    
## stateVermont               1.71906    2.11847   0.811 0.417567    
## stateVirginia              1.36836    1.99138   0.687 0.492376    
## stateWashington            1.17385    1.94683   0.603 0.546871    
## stateWest Virginia         3.39416    1.99025   1.705 0.088872 .  
## stateWisconsin             1.12825    1.99119   0.567 0.571279    
## stateWyoming               3.56052    2.30330   1.546 0.122908    
## avg_poll                   0.98324    0.02746  35.800  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.45 on 414 degrees of freedom
## Multiple R-squared:  0.7957, Adjusted R-squared:  0.7681 
## F-statistic:  28.8 on 56 and 414 DF,  p-value: < 2.2e-16

5. Probabilistic Models

In this post, I further explored probabilistic models, focusing on a logistic regression with binomial output. I built a two sided model, looking at both incumbent and challenger outcomes, predicting the number of votes for a candidate given the size of the voter eligible population at the state level.

The logistic regression is of the following form:

\[ (Votes | VEP)= f(\beta_0 + \beta_1 RDI + \beta_2 GDP + \beta_3 Poll + \beta_4 Period +\beta_5 State)\] Where \(f(x)=\frac{exp(x)}{1+exp(x)}\). In addition, VEP is the eligible voting popluation, RDI is the second quarter RDI in a particular state, GDP is the national second quarter GDP, poll is the average vote share up to 4 weeks before the election, period is an indicator for 1980-1992 or 1996 onward, and state is a set of dummy variables for states. We can exmaine the output for both the incumbent party:

## 
## Call:
## glm(formula = cbind(inc_pv, VEP - inc_pv) ~ rdi_q2 + gdp + state + 
##     avg_poll + period, family = binomial, data = reg_df %>% filter(year < 
##     2020, incumbent_party == TRUE))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -485.70   -66.43     0.77    64.98   371.32  
## 
## Coefficients:
##                             Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)               -2.313e+00  5.145e-04 -4496.62   <2e-16 ***
## rdi_q2                    -1.697e-03  1.423e-05  -119.25   <2e-16 ***
## gdp                       -4.013e-02  5.977e-05  -671.46   <2e-16 ***
## stateAlaska                2.136e-01  1.343e-03   159.05   <2e-16 ***
## stateArizona              -5.928e-02  5.934e-04   -99.90   <2e-16 ***
## stateArkansas             -7.747e-02  6.980e-04  -110.98   <2e-16 ***
## stateCalifornia            5.503e-02  4.348e-04   126.57   <2e-16 ***
## stateColorado              2.120e-01  5.869e-04   361.17   <2e-16 ***
## stateConnecticut           2.589e-01  6.009e-04   430.83   <2e-16 ***
## stateDelaware              1.754e-01  1.140e-03   153.83   <2e-16 ***
## stateDistrict of Columbia -4.110e-01  2.142e-03  -191.85   <2e-16 ***
## stateFlorida               6.545e-02  4.570e-04   143.20   <2e-16 ***
## stateGeorgia              -9.021e-02  5.193e-04  -173.71   <2e-16 ***
## stateHawaii               -2.114e-01  9.621e-04  -219.72   <2e-16 ***
## stateIdaho                 1.034e-01  9.868e-04   104.74   <2e-16 ***
## stateIllinois              1.085e-01  4.721e-04   229.76   <2e-16 ***
## stateIndiana              -3.713e-02  5.590e-04   -66.42   <2e-16 ***
## stateIowa                  2.488e-01  6.237e-04   398.81   <2e-16 ***
## stateKansas                1.147e-01  6.826e-04   168.09   <2e-16 ***
## stateKentucky             -4.301e-02  6.018e-04   -71.47   <2e-16 ***
## stateLouisiana             1.297e-01  5.842e-04   221.98   <2e-16 ***
## stateMaine                 3.185e-01  9.026e-04   352.83   <2e-16 ***
## stateMaryland              8.458e-02  5.575e-04   151.73   <2e-16 ***
## stateMassachusetts         1.858e-01  5.210e-04   356.69   <2e-16 ***
## stateMichigan              2.253e-01  4.915e-04   458.27   <2e-16 ***
## stateMinnesota             3.825e-01  5.444e-04   702.61   <2e-16 ***
## stateMississippi          -4.434e-02  7.020e-04   -63.16   <2e-16 ***
## stateMissouri              1.364e-01  5.356e-04   254.67   <2e-16 ***
## stateMontana               1.639e-01  1.041e-03   157.44   <2e-16 ***
## stateNebraska              1.539e-01  7.820e-04   196.75   <2e-16 ***
## stateNevada               -9.501e-02  8.160e-04  -116.43   <2e-16 ***
## stateNew Hampshire         2.171e-01  8.899e-04   243.91   <2e-16 ***
## stateNew Jersey            2.019e-01  4.986e-04   404.94   <2e-16 ***
## stateNew Mexico           -4.883e-02  7.986e-04   -61.14   <2e-16 ***
## stateNew York             -6.577e-02  4.545e-04  -144.70   <2e-16 ***
## stateNorth Carolina       -6.300e-03  5.032e-04   -12.52   <2e-16 ***
## stateNorth Dakota          1.306e-01  1.162e-03   112.35   <2e-16 ***
## stateOhio                  1.320e-01  4.722e-04   279.46   <2e-16 ***
## stateOklahoma             -7.627e-02  6.606e-04  -115.46   <2e-16 ***
## stateOregon                2.218e-01  6.048e-04   366.76   <2e-16 ***
## statePennsylvania          3.315e-02  4.757e-04    69.68   <2e-16 ***
## stateRhode Island          1.687e-01  9.226e-04   182.86   <2e-16 ***
## stateSouth Carolina       -1.358e-01  6.360e-04  -213.50   <2e-16 ***
## stateSouth Dakota          2.016e-01  1.093e-03   184.42   <2e-16 ***
## stateTennessee            -1.222e-01  5.563e-04  -219.59   <2e-16 ***
## stateTexas                -5.868e-02  4.535e-04  -129.41   <2e-16 ***
## stateUtah                 -2.979e-02  7.593e-04   -39.23   <2e-16 ***
## stateVermont               1.716e-01  1.219e-03   140.70   <2e-16 ***
## stateVirginia              7.415e-02  5.122e-04   144.75   <2e-16 ***
## stateWashington            2.280e-01  5.349e-04   426.28   <2e-16 ***
## stateWest Virginia        -1.432e-01  7.575e-04  -188.99   <2e-16 ***
## stateWisconsin             3.112e-01  5.343e-04   582.55   <2e-16 ***
## stateWyoming               9.967e-02  1.637e-03    60.90   <2e-16 ***
## avg_poll                   2.961e-02  7.352e-06  4027.07   <2e-16 ***
## period1996-2020            3.797e-02  1.202e-04   316.00   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 28807479  on 453  degrees of freedom
## Residual deviance:  5718638  on 399  degrees of freedom
## AIC: 5725537
## 
## Number of Fisher Scoring iterations: 3

And also the challenger party.

## 
## Call:
## glm(formula = cbind(chl_pv, VEP - chl_pv) ~ rdi_q2 + gdp + state + 
##     avg_poll + period, family = binomial, data = reg_df %>% filter(year < 
##     2020, incumbent_party == FALSE))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -481.92   -74.83    -4.13    62.62   578.63  
## 
## Coefficients:
##                             Estimate Std. Error   z value Pr(>|z|)    
## (Intercept)               -2.416e+00  5.569e-04 -4338.506  < 2e-16 ***
## rdi_q2                     7.301e-04  1.413e-05    51.656  < 2e-16 ***
## gdp                       -7.680e-02  5.639e-05 -1362.143  < 2e-16 ***
## stateAlaska                2.719e-01  1.354e-03   200.884  < 2e-16 ***
## stateArizona               1.155e-02  6.031e-04    19.146  < 2e-16 ***
## stateArkansas             -6.317e-02  6.943e-04   -90.981  < 2e-16 ***
## stateCalifornia            9.248e-02  4.415e-04   209.492  < 2e-16 ***
## stateColorado              2.235e-01  5.867e-04   380.992  < 2e-16 ***
## stateConnecticut           2.543e-01  6.132e-04   414.657  < 2e-16 ***
## stateDelaware              1.636e-01  1.148e-03   142.554  < 2e-16 ***
## stateDistrict of Columbia -2.061e-01  2.514e-03   -81.981  < 2e-16 ***
## stateFlorida               1.479e-01  4.644e-04   318.451  < 2e-16 ***
## stateGeorgia               3.362e-03  5.265e-04     6.385 1.72e-10 ***
## stateHawaii               -1.650e-01  9.965e-04  -165.532  < 2e-16 ***
## stateIdaho                 1.488e-01  9.536e-04   156.032  < 2e-16 ***
## stateIllinois              2.222e-01  4.783e-04   464.633  < 2e-16 ***
## stateIndiana               5.769e-02  5.611e-04   102.825  < 2e-16 ***
## stateIowa                  3.521e-01  6.230e-04   565.164  < 2e-16 ***
## stateKansas                1.372e-01  6.883e-04   199.333  < 2e-16 ***
## stateKentucky              9.969e-02  6.024e-04   165.505  < 2e-16 ***
## stateLouisiana             2.026e-01  5.891e-04   343.886  < 2e-16 ***
## stateMaine                 3.649e-01  9.203e-04   396.552  < 2e-16 ***
## stateMaryland              2.076e-01  5.692e-04   364.721  < 2e-16 ***
## stateMassachusetts         2.958e-01  5.315e-04   556.574  < 2e-16 ***
## stateMichigan              3.142e-01  4.960e-04   633.377  < 2e-16 ***
## stateMinnesota             4.784e-01  5.482e-04   872.813  < 2e-16 ***
## stateMississippi          -1.804e-02  7.144e-04   -25.253  < 2e-16 ***
## stateMissouri              2.549e-01  5.372e-04   474.471  < 2e-16 ***
## stateMontana               3.088e-01  1.016e-03   303.935  < 2e-16 ***
## stateNebraska              2.014e-01  7.969e-04   252.728  < 2e-16 ***
## stateNevada               -3.198e-02  8.151e-04   -39.239  < 2e-16 ***
## stateNew Hampshire         3.154e-01  9.021e-04   349.676  < 2e-16 ***
## stateNew Jersey            2.286e-01  5.107e-04   447.614  < 2e-16 ***
## stateNew Mexico            7.312e-02  8.125e-04    89.992  < 2e-16 ***
## stateNew York             -1.096e-04  4.619e-04    -0.237    0.812    
## stateNorth Carolina        7.645e-02  5.094e-04   150.059  < 2e-16 ***
## stateNorth Dakota          2.558e-01  1.112e-03   229.986  < 2e-16 ***
## stateOhio                  2.103e-01  4.776e-04   440.291  < 2e-16 ***
## stateOklahoma             -3.386e-02  6.597e-04   -51.329  < 2e-16 ***
## stateOregon                3.098e-01  6.086e-04   509.096  < 2e-16 ***
## statePennsylvania          1.731e-01  4.796e-04   360.806  < 2e-16 ***
## stateRhode Island          1.663e-01  9.429e-04   176.400  < 2e-16 ***
## stateSouth Carolina       -6.664e-02  6.435e-04  -103.557  < 2e-16 ***
## stateSouth Dakota          3.279e-01  1.055e-03   310.704  < 2e-16 ***
## stateTennessee             3.568e-02  5.574e-04    64.002  < 2e-16 ***
## stateTexas                -8.582e-02  4.586e-04  -187.115  < 2e-16 ***
## stateUtah                  5.984e-02  7.757e-04    77.146  < 2e-16 ***
## stateVermont               2.931e-01  1.245e-03   235.447  < 2e-16 ***
## stateVirginia              1.587e-01  5.218e-04   304.220  < 2e-16 ***
## stateWashington            2.442e-01  5.416e-04   450.831  < 2e-16 ***
## stateWest Virginia        -5.349e-03  7.471e-04    -7.159 8.13e-13 ***
## stateWisconsin             3.991e-01  5.374e-04   742.762  < 2e-16 ***
## stateWyoming               2.484e-01  1.564e-03   158.838  < 2e-16 ***
## avg_poll                   3.064e-02  8.030e-06  3816.233  < 2e-16 ***
## period1996-2020            6.670e-02  1.234e-04   540.434  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 31429230  on 453  degrees of freedom
## Residual deviance:  7778657  on 399  degrees of freedom
## AIC: 7785549
## 
## Number of Fisher Scoring iterations: 4

The deviances (one way of measuring the fit of a logistic regression) are extremely high, suggesting a poor fit. In addition to the problems with a lack of variance, it would seem that this model may not be particularly helpful.

7. Parties and Uncertainty

In the post on parties and uncertainty, I used a number of logistic models based on two different types of two sided model: one based on incumbency status, and one based on parties. The results of those regressions are as follows.

First look at the model for the incumbent party.

## 
## Call:
## glm(formula = cbind(inc_votes, VEP - inc_votes) ~ rdi_q2 + gdp + 
##     state + avg_poll + inc_party, family = binomial, data = reg_df %>% 
##     filter(year < 2020, incumbent_party == TRUE))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -369.04   -52.43    -0.22    48.95   312.11  
## 
## Coefficients:
##                             Estimate Std. Error   z value Pr(>|z|)    
## (Intercept)               -2.392e+00  5.685e-04 -4208.439   <2e-16 ***
## rdi_q2                    -4.422e-03  1.560e-05  -283.551   <2e-16 ***
## gdp                       -4.568e-02  6.087e-05  -750.468   <2e-16 ***
## stateAlaska                1.817e-01  1.592e-03   114.153   <2e-16 ***
## stateArizona              -4.761e-02  6.213e-04   -76.634   <2e-16 ***
## stateArkansas             -5.901e-02  7.519e-04   -78.479   <2e-16 ***
## stateCalifornia            6.092e-02  4.805e-04   126.795   <2e-16 ***
## stateColorado              2.501e-01  6.360e-04   393.229   <2e-16 ***
## stateConnecticut           2.436e-01  6.727e-04   362.098   <2e-16 ***
## stateDelaware              1.645e-01  1.296e-03   126.903   <2e-16 ***
## stateDistrict of Columbia -5.125e-02  2.093e-03   -24.484   <2e-16 ***
## stateFlorida               8.956e-02  5.005e-04   178.945   <2e-16 ***
## stateGeorgia              -5.291e-02  5.578e-04   -94.853   <2e-16 ***
## stateHawaii               -1.805e-01  1.064e-03  -169.675   <2e-16 ***
## stateIdaho                 1.088e-01  1.070e-03   101.640   <2e-16 ***
## stateIllinois              1.296e-01  5.147e-04   251.855   <2e-16 ***
## stateIndiana               9.431e-04  6.150e-04     1.533    0.125    
## stateIowa                  2.604e-01  6.963e-04   373.987   <2e-16 ***
## stateKansas                7.583e-02  8.162e-04    92.902   <2e-16 ***
## stateKentucky              6.807e-03  6.754e-04    10.079   <2e-16 ***
## stateLouisiana             1.701e-01  6.191e-04   274.755   <2e-16 ***
## stateMaine                 3.463e-01  8.990e-04   385.154   <2e-16 ***
## stateMaryland              1.129e-01  6.101e-04   184.994   <2e-16 ***
## stateMassachusetts         2.352e-01  5.666e-04   415.022   <2e-16 ***
## stateMichigan              2.412e-01  5.329e-04   452.584   <2e-16 ***
## stateMinnesota             4.177e-01  5.911e-04   706.596   <2e-16 ***
## stateMississippi           2.015e-02  7.710e-04    26.134   <2e-16 ***
## stateMissouri              1.590e-01  5.835e-04   272.489   <2e-16 ***
## stateMontana               1.805e-01  1.062e-03   169.926   <2e-16 ***
## stateNebraska              9.429e-02  9.284e-04   101.560   <2e-16 ***
## stateNevada               -3.081e-02  8.557e-04   -36.000   <2e-16 ***
## stateNew Hampshire         2.660e-01  9.301e-04   286.023   <2e-16 ***
## stateNew Jersey            2.120e-01  5.391e-04   393.272   <2e-16 ***
## stateNew Mexico           -1.558e-02  8.536e-04   -18.252   <2e-16 ***
## stateNew York             -3.981e-02  4.984e-04   -79.882   <2e-16 ***
## stateNorth Carolina        8.231e-03  5.428e-04    15.164   <2e-16 ***
## stateNorth Dakota          1.654e-01  1.224e-03   135.135   <2e-16 ***
## stateOhio                  1.523e-01  5.148e-04   295.923   <2e-16 ***
## stateOklahoma             -8.237e-02  6.748e-04  -122.077   <2e-16 ***
## stateOregon                2.543e-01  6.385e-04   398.254   <2e-16 ***
## statePennsylvania          5.285e-02  5.121e-04   103.196   <2e-16 ***
## stateRhode Island          1.791e-01  1.060e-03   169.013   <2e-16 ***
## stateSouth Carolina       -1.377e-01  6.681e-04  -206.171   <2e-16 ***
## stateSouth Dakota          1.893e-01  1.173e-03   161.414   <2e-16 ***
## stateTennessee            -1.152e-01  5.927e-04  -194.379   <2e-16 ***
## stateTexas                -7.280e-02  5.019e-04  -145.049   <2e-16 ***
## stateUtah                 -1.814e-02  8.183e-04   -22.172   <2e-16 ***
## stateVermont               2.036e-01  1.542e-03   132.010   <2e-16 ***
## stateVirginia              1.255e-01  5.604e-04   223.991   <2e-16 ***
## stateWashington            1.976e-01  5.725e-04   345.254   <2e-16 ***
## stateWest Virginia        -7.691e-02  8.403e-04   -91.533   <2e-16 ***
## stateWisconsin             3.203e-01  5.719e-04   560.079   <2e-16 ***
## stateWyoming               9.533e-02  1.767e-03    53.944   <2e-16 ***
## avg_poll                   3.089e-02  7.391e-06  4179.078   <2e-16 ***
## inc_partyrepublican        5.601e-02  1.242e-04   451.048   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 27672541  on 413  degrees of freedom
## Residual deviance:  3800967  on 359  degrees of freedom
## AIC: 3807296
## 
## Number of Fisher Scoring iterations: 3

Then the challenger party.

## 
## Call:
## glm(formula = cbind(chl_votes, VEP - chl_votes) ~ rdi_q2 + gdp + 
##     state + avg_poll + inc_party, family = binomial, data = reg_df %>% 
##     filter(year < 2020, incumbent_party == FALSE))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -330.57   -46.35    -0.51    53.51   349.15  
## 
## Coefficients:
##                             Estimate Std. Error   z value Pr(>|z|)    
## (Intercept)               -2.463e+00  6.020e-04 -4091.495  < 2e-16 ***
## rdi_q2                    -3.275e-03  1.594e-05  -205.421  < 2e-16 ***
## gdp                       -7.400e-02  5.643e-05 -1311.230  < 2e-16 ***
## stateAlaska                1.764e-01  1.623e-03   108.704  < 2e-16 ***
## stateArizona               2.237e-03  6.264e-04     3.571 0.000356 ***
## stateArkansas             -8.230e-02  7.487e-04  -109.925  < 2e-16 ***
## stateCalifornia            6.101e-02  4.885e-04   124.895  < 2e-16 ***
## stateColorado              2.463e-01  6.359e-04   387.288  < 2e-16 ***
## stateConnecticut           2.649e-01  6.894e-04   384.238  < 2e-16 ***
## stateDelaware              2.062e-01  1.319e-03   156.302  < 2e-16 ***
## stateDistrict of Columbia -1.044e+00  5.538e-03  -188.483  < 2e-16 ***
## stateFlorida               1.304e-01  5.089e-04   256.323  < 2e-16 ***
## stateGeorgia              -1.398e-02  5.659e-04   -24.708  < 2e-16 ***
## stateHawaii               -2.001e-01  1.178e-03  -169.882  < 2e-16 ***
## stateIdaho                 2.308e-01  9.733e-04   237.108  < 2e-16 ***
## stateIllinois              1.919e-01  5.225e-04   367.276  < 2e-16 ***
## stateIndiana               7.046e-02  6.122e-04   115.095  < 2e-16 ***
## stateIowa                  3.217e-01  6.953e-04   462.725  < 2e-16 ***
## stateKansas                1.518e-01  8.095e-04   187.548  < 2e-16 ***
## stateKentucky              7.618e-02  6.838e-04   111.406  < 2e-16 ***
## stateLouisiana             1.697e-01  6.243e-04   271.849  < 2e-16 ***
## stateMaine                 4.065e-01  9.053e-04   448.966  < 2e-16 ***
## stateMaryland              1.509e-01  6.327e-04   238.529  < 2e-16 ***
## stateMassachusetts         2.444e-01  5.820e-04   419.955  < 2e-16 ***
## stateMichigan              2.495e-01  5.380e-04   463.814  < 2e-16 ***
## stateMinnesota             4.672e-01  5.985e-04   780.591  < 2e-16 ***
## stateMississippi          -2.084e-02  7.756e-04   -26.874  < 2e-16 ***
## stateMissouri              2.075e-01  5.869e-04   353.545  < 2e-16 ***
## stateMontana               3.089e-01  1.037e-03   297.999  < 2e-16 ***
## stateNebraska              1.586e-01  8.798e-04   180.208  < 2e-16 ***
## stateNevada                5.883e-03  8.618e-04     6.826 8.73e-12 ***
## stateNew Hampshire         3.351e-01  9.244e-04   362.486  < 2e-16 ***
## stateNew Jersey            2.099e-01  5.523e-04   379.990  < 2e-16 ***
## stateNew Mexico            6.466e-02  8.677e-04    74.524  < 2e-16 ***
## stateNew York             -3.376e-02  5.084e-04   -66.410  < 2e-16 ***
## stateNorth Carolina        6.019e-02  5.504e-04   109.361  < 2e-16 ***
## stateNorth Dakota          2.537e-01  1.195e-03   212.188  < 2e-16 ***
## stateOhio                  1.801e-01  5.213e-04   345.433  < 2e-16 ***
## stateOklahoma             -2.898e-02  6.710e-04   -43.197  < 2e-16 ***
## stateOregon                2.690e-01  6.437e-04   417.858  < 2e-16 ***
## statePennsylvania          1.361e-01  5.180e-04   262.733  < 2e-16 ***
## stateRhode Island          1.619e-01  1.157e-03   139.971  < 2e-16 ***
## stateSouth Carolina       -6.435e-02  6.758e-04   -95.232  < 2e-16 ***
## stateSouth Dakota          2.863e-01  1.122e-03   255.202  < 2e-16 ***
## stateTennessee             1.649e-02  5.950e-04    27.722  < 2e-16 ***
## stateTexas                -8.607e-02  5.072e-04  -169.690  < 2e-16 ***
## stateUtah                  7.281e-02  8.247e-04    88.293  < 2e-16 ***
## stateVermont               3.074e-01  1.565e-03   196.445  < 2e-16 ***
## stateVirginia              1.289e-01  5.679e-04   227.012  < 2e-16 ***
## stateWashington            2.261e-01  5.808e-04   389.341  < 2e-16 ***
## stateWest Virginia        -3.935e-02  8.409e-04   -46.795  < 2e-16 ***
## stateWisconsin             3.999e-01  5.770e-04   692.936  < 2e-16 ***
## stateWyoming               2.124e-01  1.754e-03   121.068  < 2e-16 ***
## avg_poll                   3.249e-02  8.137e-06  3993.281  < 2e-16 ***
## inc_partyrepublican        5.443e-02  1.297e-04   419.628  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 29524520  on 413  degrees of freedom
## Residual deviance:  4203355  on 359  degrees of freedom
## AIC: 4209677
## 
## Number of Fisher Scoring iterations: 3

We can then switch over to the party based model. First look at the Democrat side.

## 
## Call:
## glm(formula = cbind(D, VEP - D) ~ rdi_q2 + gdp + state + avg_poll + 
##     incumbent_party, family = binomial, data = reg_df %>% filter(year < 
##     2020, party == "democrat"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -359.88   -50.52     2.92    49.17   307.24  
## 
## Coefficients:
##                             Estimate Std. Error   z value Pr(>|z|)    
## (Intercept)               -2.393e+00  6.358e-04 -3763.660  < 2e-16 ***
## rdi_q2                    -3.325e-03  1.600e-05  -207.877  < 2e-16 ***
## gdp                       -4.903e-02  5.976e-05  -820.449  < 2e-16 ***
## stateAlaska                2.545e-02  1.720e-03    14.798  < 2e-16 ***
## stateArizona              -4.309e-02  6.534e-04   -65.953  < 2e-16 ***
## stateArkansas             -1.215e-01  7.843e-04  -154.956  < 2e-16 ***
## stateCalifornia            7.202e-02  5.208e-04   138.291  < 2e-16 ***
## stateColorado              2.672e-01  6.579e-04   406.217  < 2e-16 ***
## stateConnecticut           2.450e-01  6.976e-04   351.276  < 2e-16 ***
## stateDelaware              2.210e-01  1.282e-03   172.362  < 2e-16 ***
## stateDistrict of Columbia -9.515e-02  2.135e-03   -44.568  < 2e-16 ***
## stateFlorida               9.547e-02  5.341e-04   178.741  < 2e-16 ***
## stateGeorgia              -4.536e-02  5.905e-04   -76.816  < 2e-16 ***
## stateHawaii               -1.827e-01  1.066e-03  -171.439  < 2e-16 ***
## stateIdaho                 1.078e-01  1.130e-03    95.398  < 2e-16 ***
## stateIllinois              1.504e-01  5.491e-04   273.815  < 2e-16 ***
## stateIndiana               2.855e-02  6.445e-04    44.305  < 2e-16 ***
## stateIowa                  2.769e-01  7.148e-04   387.350  < 2e-16 ***
## stateKansas                5.687e-02  8.666e-04    65.628  < 2e-16 ***
## stateKentucky             -1.075e-02  7.206e-04   -14.920  < 2e-16 ***
## stateLouisiana             1.767e-01  6.493e-04   272.184  < 2e-16 ***
## stateMaine                 4.012e-01  9.022e-04   444.713  < 2e-16 ***
## stateMaryland              1.334e-01  6.409e-04   208.147  < 2e-16 ***
## stateMassachusetts         2.585e-01  6.023e-04   429.151  < 2e-16 ***
## stateMichigan              2.446e-01  5.609e-04   436.002  < 2e-16 ***
## stateMinnesota             4.268e-01  6.192e-04   689.201  < 2e-16 ***
## stateMississippi           5.689e-03  8.115e-04     7.011 2.36e-12 ***
## stateMissouri              1.379e-01  6.123e-04   225.304  < 2e-16 ***
## stateMontana               2.369e-01  1.092e-03   217.004  < 2e-16 ***
## stateNebraska              5.294e-02  9.887e-04    53.550  < 2e-16 ***
## stateNevada                3.108e-02  8.720e-04    35.640  < 2e-16 ***
## stateNew Hampshire         2.693e-01  9.412e-04   286.155  < 2e-16 ***
## stateNew Jersey            2.076e-01  5.711e-04   363.502  < 2e-16 ***
## stateNew Mexico            2.325e-02  8.690e-04    26.761  < 2e-16 ***
## stateNew York             -1.924e-02  5.404e-04   -35.598  < 2e-16 ***
## stateNorth Carolina       -8.300e-03  5.768e-04   -14.391  < 2e-16 ***
## stateNorth Dakota          1.129e-01  1.295e-03    87.209  < 2e-16 ***
## stateOhio                  1.364e-01  5.463e-04   249.632  < 2e-16 ***
## stateOklahoma             -9.826e-02  7.273e-04  -135.100  < 2e-16 ***
## stateOregon                2.675e-01  6.603e-04   405.191  < 2e-16 ***
## statePennsylvania          8.368e-02  5.431e-04   154.087  < 2e-16 ***
## stateRhode Island          2.087e-01  1.069e-03   195.245  < 2e-16 ***
## stateSouth Carolina       -1.176e-01  7.075e-04  -166.273  < 2e-16 ***
## stateSouth Dakota          1.702e-01  1.215e-03   140.064  < 2e-16 ***
## stateTennessee            -1.306e-01  6.268e-04  -208.329  < 2e-16 ***
## stateTexas                -6.568e-02  5.335e-04  -123.124  < 2e-16 ***
## stateUtah                 -2.862e-02  9.307e-04   -30.756  < 2e-16 ***
## stateVermont               3.018e-01  1.474e-03   204.803  < 2e-16 ***
## stateVirginia              1.268e-01  5.906e-04   214.636  < 2e-16 ***
## stateWashington            2.121e-01  6.007e-04   353.020  < 2e-16 ***
## stateWest Virginia        -1.283e-01  8.710e-04  -147.319  < 2e-16 ***
## stateWisconsin             3.492e-01  5.988e-04   583.233  < 2e-16 ***
## stateWyoming               9.333e-02  1.943e-03    48.040  < 2e-16 ***
## avg_poll                   3.214e-02  9.978e-06  3220.834  < 2e-16 ***
## incumbent_partyTRUE       -6.783e-02  1.235e-04  -549.199  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 31804157  on 413  degrees of freedom
## Residual deviance:  4091837  on 359  degrees of freedom
## AIC: 4098155
## 
## Number of Fisher Scoring iterations: 3

Then, finally, we can look at the Republcan side.

## 
## Call:
## glm(formula = cbind(R, VEP - R) ~ rdi_q2 + gdp + state + avg_poll + 
##     incumbent_party, family = binomial, data = reg_df %>% filter(year < 
##     2020, party == "republican"))
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -334.18   -43.61    -2.20    46.05   340.31  
## 
## Coefficients:
##                             Estimate Std. Error   z value Pr(>|z|)    
## (Intercept)               -2.228e+00  6.429e-04 -3464.880  < 2e-16 ***
## rdi_q2                    -4.348e-03  1.532e-05  -283.859  < 2e-16 ***
## gdp                       -7.009e-02  5.685e-05 -1232.845  < 2e-16 ***
## stateAlaska                2.815e-01  1.527e-03   184.356  < 2e-16 ***
## stateArizona              -2.579e-02  6.003e-04   -42.964  < 2e-16 ***
## stateArkansas             -3.967e-02  7.224e-04   -54.911  < 2e-16 ***
## stateCalifornia           -3.646e-03  4.781e-04    -7.626 2.42e-14 ***
## stateColorado              2.015e-01  6.226e-04   323.670  < 2e-16 ***
## stateConnecticut           2.120e-01  6.807e-04   311.394  < 2e-16 ***
## stateDelaware              8.979e-02  1.352e-03    66.421  < 2e-16 ***
## stateDistrict of Columbia -1.247e+00  5.542e-03  -224.990  < 2e-16 ***
## stateFlorida               1.009e-01  4.844e-04   208.230  < 2e-16 ***
## stateGeorgia              -4.167e-02  5.402e-04   -77.142  < 2e-16 ***
## stateHawaii               -2.826e-01  1.208e-03  -233.864  < 2e-16 ***
## stateIdaho                 2.419e-01  9.352e-04   258.692  < 2e-16 ***
## stateIllinois              1.167e-01  5.158e-04   226.263  < 2e-16 ***
## stateIndiana               3.184e-02  5.868e-04    54.266  < 2e-16 ***
## stateIowa                  2.692e-01  6.874e-04   391.567  < 2e-16 ***
## stateKansas                1.513e-01  7.698e-04   196.484  < 2e-16 ***
## stateKentucky              7.480e-02  6.458e-04   115.825  < 2e-16 ***
## stateLouisiana             1.481e-01  5.980e-04   247.660  < 2e-16 ***
## stateMaine                 2.906e-01  9.204e-04   315.732  < 2e-16 ***
## stateMaryland              5.890e-02  6.346e-04    92.819  < 2e-16 ***
## stateMassachusetts         1.428e-01  5.911e-04   241.498  < 2e-16 ***
## stateMichigan              2.004e-01  5.284e-04   379.282  < 2e-16 ***
## stateMinnesota             4.103e-01  5.902e-04   695.243  < 2e-16 ***
## stateMississippi          -1.164e-02  7.396e-04   -15.735  < 2e-16 ***
## stateMissouri              2.025e-01  5.665e-04   357.409  < 2e-16 ***
## stateMontana               2.410e-01  1.010e-03   238.570  < 2e-16 ***
## stateNebraska              1.967e-01  8.400e-04   234.177  < 2e-16 ***
## stateNevada               -8.440e-02  8.530e-04   -98.940  < 2e-16 ***
## stateNew Hampshire         2.940e-01  9.220e-04   318.841  < 2e-16 ***
## stateNew Jersey            1.680e-01  5.378e-04   312.366  < 2e-16 ***
## stateNew Mexico           -1.686e-02  8.640e-04   -19.519  < 2e-16 ***
## stateNew York             -1.291e-01  5.113e-04  -252.452  < 2e-16 ***
## stateNorth Carolina        5.291e-02  5.254e-04   100.691  < 2e-16 ***
## stateNorth Dakota          2.813e-01  1.146e-03   245.523  < 2e-16 ***
## stateOhio                  1.661e-01  5.005e-04   331.901  < 2e-16 ***
## stateOklahoma             -1.063e-02  6.304e-04   -16.867  < 2e-16 ***
## stateOregon                2.104e-01  6.386e-04   329.522  < 2e-16 ***
## statePennsylvania          6.531e-02  5.031e-04   129.814  < 2e-16 ***
## stateRhode Island          4.824e-02  1.172e-03    41.173  < 2e-16 ***
## stateSouth Carolina       -1.004e-01  6.423e-04  -156.295  < 2e-16 ***
## stateSouth Dakota          2.863e-01  1.092e-03   262.243  < 2e-16 ***
## stateTennessee             3.202e-03  5.690e-04     5.627 1.83e-08 ***
## stateTexas                -9.383e-02  4.791e-04  -195.841  < 2e-16 ***
## stateUtah                  9.163e-02  7.532e-04   121.658  < 2e-16 ***
## stateVermont               1.079e-01  1.689e-03    63.899  < 2e-16 ***
## stateVirginia              1.019e-01  5.465e-04   186.393  < 2e-16 ***
## stateWashington            1.606e-01  5.750e-04   279.304  < 2e-16 ***
## stateWest Virginia        -2.055e-02  8.174e-04   -25.141  < 2e-16 ***
## stateWisconsin             3.286e-01  5.656e-04   581.007  < 2e-16 ***
## stateWyoming               1.982e-01  1.630e-03   121.556  < 2e-16 ***
## avg_poll                   2.800e-02  9.301e-06  3010.531  < 2e-16 ***
## incumbent_partyTRUE        5.812e-02  1.293e-04   449.523  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 25631135  on 413  degrees of freedom
## Residual deviance:  3569384  on 359  degrees of freedom
## AIC: 3575717
## 
## Number of Fisher Scoring iterations: 3