Standard method for calculating contribution of individual variable to outcome I'm looking at the change in vote shares for an election between two periods. I'd like to say something about the contribution of one variable in particular towards the election swing I document. I'm wondering if there is a standard approach in the literature.
I'd like to be able to say something like X accounts for 5 points of the 20 point swing.
Is there a standard way to calculate a variable's contribution? Predict the outcome with X set equal to zero and compare the difference? Standardize the coefficients and take the value of the beta coefficient as the percent contribution?
 A: Given that you have panel data, the "standard approach" would be to use a fixed effects regression in order to eliminate time-invariant unobserved candidate and state characteristics. The earliest example I can provide you with is Levitt (1994). He wanted to know how campaign spending by incumbent candidates and challengers affects the election outcome. If you intend to do something similar, you have to ask yourself the question: "Is there something about my candidates and/or their states that I don't observe but which is correlated with my variable of interest and the election outcome?"
In the case of Levitt (1994), campaign spending is likely to depend on a candidate's quality. The guy who rallies the masses with his great speeches is likely to attract more funding, so he can spend more on his campaign. But then his great speeches are likely to affect the election outcome, too! The problem now is that we do not observe this guy's quality. What does this mean for your regression? If you regress
$$\text{Re-elect}_{it} = \alpha + \beta \text{spending}_{it} + X'_{it}\gamma + \epsilon_{it}$$
where the outcome is 1 if the incumbent gets re-elected and zero otherwise, spending denotes a candidates campaign spending and $X'_{it}$ includes some characteristics of the candidate and the state of the election. If quality is unobserved, this will be included in the error term resulting in a correlation with spending. Quality is positively correlated with both being elected and with campaign spending, so your estimated $\beta$ will be upward biased (see here for an explanation of this kind of omitted variable bias).
Under the assumption that quality is fix over the sample period, you can use a fixed effects regression (see the lecture here for a quick introduction) to eliminate such unobserved time-invariant effects. This approach is still taken in more recent studies like Leigh (2009) who studies the effect of changes in the world economy on electoral outcomes. Besides the fixed effects he uses a conditional logit model to better account for the binary nature of the outcome variable but in your case this is not feasible because you only have 2 time periods (and then conditional logit will not be consistent as this method requires many periods). The fixed effects estimator for a binary dependent variable is nonetheless a good approximation of the actual effect so you shouldn't worry about such technicalities too much.
Other elections that have received a lot of attention are those in the Weimar Republic before the Nazis seized power. The usual question here is whether the economic depression led to voter radicalization (see Stögbauer, 2001, or de Bromhead et al, 2012). If you have GIS/geographic information on your states you can use a spatial fixed effects regression model like Stögbauer (2001). If you have parties that receive a zero vote share for many elections you can use the fixed effects maximum likelihood Tobit estimator that de Bromhead et al. (2012) use. Probably this goes beyond of what you wanted but the main message is: fixed effects models are the main tool for estimating such vote share regressions back in 1990 and nowadays. The nature of the data may change the estimator a little as in the last two papers but the main point is still to eliminate the unobservables that are fixed over time.
A last thing to consider: if you are interested in a variable's effect on an electoral swing you need not worry about unobserved time-invariant variables. What you still need to worry about is unobserved time-varying variables that are correlated with your regression variables. In this case, fixed effects cannot save you anymore and you will require an instrument. Whether you have a problem like this requires a bit of thought, depends on your data at hand and your research question. Given that you didn't tell us what variable you are interested in, this is the last piece of (general) advice I can provide in this answer.
A: Looking over a fair amount of papers, it seems that a common way to do this is to: 


*

*Fit whatever specification you have chosen

*Set the variable of interest equal to a value motivated by theory. E.g. if you're looking at the effects of library growth on elections, then set growth equal to zero

*Predict vote share with new value.

*Contribution of variable = difference in predicted and actual result

