Saturday, June 8, 2013

When VirtualBox keeps re-setting your Windows 7 host-only networking IP address to the autoconfiguration address

I've had this problem intermittently over the life of my VirtualBox installation, and others have reported it too.

Basically, on every host reboot Windows 7 would re-set the IP address of my host-only network interface to the autoconfiguration address, which caused virtual hosts to be unable to see it (and unable to get their own host-only IP address, which, at least on FreeBSD guests, basically caused a very long pause during the boot process, perhaps because I was also mounting host directories on the guest machines).

Solutions people have proposed for this are all over the map, so my solution may not work for everyone.

For me, I came up with an easy fix that worked.

VBoxManage list hostonlyifs
to get the name of the host-only network interface.

VBoxManage hostonlyif delete <name>
to delete that interface

VBoxManage hostonlyif create
to create a new one

VBoxManage list hostonlyifs
to get the name of the new network interface

VBoxManage hostonlyif ipconfig <name> --ip <ip>
to set the IP address to the address I wanted.

Now it works. I hope it's this easy for you!

Thursday, January 10, 2013

A more rigorous redistricting analysis

W.D. McInturff, who apparently is a Republican pollster, today published an analysis that is so misleading, so simplistic, I can't believe people would take it seriously. Yet Chuck Todd, a smart person, tweeted about it approvingly. NBC News published an article about it. If Nate Silver got his hands on it, he'd eviscerate it. But he hasn't yet done that, so it falls to me.

McInturff's basic mistake is simple: he compares the share of votes a party got in an election to the percentage of seats it won to determine whether a party had an advantage in that election. But that's stupid. Ronald Reagan, while winning 59% of the vote in 1984, didn't win 59% of the states. He won 49/50, or 98%. Is that because the state lines were drawn unfairly in 1984? That Reagan gained a 39% advantage because of state lines? No. It's because when you aggregate votes, of course the leader will win a higher percentage of districts than votes. Comparing the percentage of votes to the percentage of seats is like comparing a sports team's winning percentage to the percentage of points it scores in its games. They're not comparable.

It's more insulting that he then takes such a snide tone -- titling his essay "There's No Crying in Redistricting" -- for such misleading analysis. Whether it's intentionally misleading or just slothful, I have no idea. McInturff's analysis basically argues that, sure, Republicans might have had an advantage in the recent House election due to redistricting, but it's nothing special. He mocks anyone who might be concerned that voters' will is being frustrated by poorly drawn district lines, portraying them as a bunch of whiners. He leaves out seven of the 21 elections during the period he analyzes (1972-2012).

But the truth is, a reasoned analysis shows that the 2012 advantage enjoyed by the Republicans is very unusual, and clearly the most significant frustration of voters' will in the last 40 years (the period McInturff analyzes). He's dead wrong. Let's go to the numbers.

First, let's look at the period preceding 2010. McInturff starts his analysis in 1972. Unlike him, I look at all elections since 1972 (he inexplicably leaves out seven of them). Here's the data:

Election GOP 2-Party Vote Share GOP 2-Party Seat Share

You can see the problem I pointed out above. Whichever party wins an election, in terms of votes, wins a bigger share of seats than votes. There are twenty elections above, and this is true in seventeen of them. Obviously these numbers are not directly comparable.

In fact, a basic statistical analysis notes that the best predictor, using data from 1972-2010, of the percentage of seats Republicans won is the following formula:

(Percent of Republican vote) X 1.9682 - 0.4943 = Percentage of Republican seats

Let's have a look at what this relationship looks like:

GOP Vote %GOP Seat %

You can see that if Republicans win more than half the vote, their seat share generally exceeds their vote share, and vice-versa.

You can also see something else: that in a 50-50 election, Republicans are only projected to win 49% of the seats! This does suggest that Republicans suffered from a slight disadvantage during the 40 years in question, on the average. This part McInturff has right, although he calls it a "huge structural advantage," and as we'll see, it's smaller than what Republicans have now. I have no doubt that the party in control of redistricting loads the dice in their favor. But there's reason to believe it's never been done as effectively or thoroughly as it was after the 2010 census. Let's see why.

If we're looking for what would happen with "fair" district lines, and other considerations, we should adjust the formula a little bit to make it fair to Republicans. Let's change the intercept -- the 0.4943 above -- to what it would need to be to make a 50-50 election even in terms of seats, or 0.4841. This yields the following table:

Party Vote %"Fair" Party Seat %

So now we see how this might work, if everything were fair. A party winning 60% of the vote should control 70% of the seats; 55% of the votes is about 60% of the seats, and so forth.

So now let's look at the recent elections in context. Did any party have an "advantage" -- in which they won more seats than expected -- in any election? And what does it show about 2012?

We'll look at the two-party vote share over the period in question, and look at both the expected percentage of seats won and the actual percentage of seats won, and express the difference as a number of seats (just to make it easier to understand).

Year GOP Vote % Expected GOP Seat % Actual GOP Seat % Difference (seats)

So now we can see how dramatic the advantage to the Republicans was in the last election. This was only the second election in the period -- 1996 was the other -- in which the party which won fewer votes controlled the House. (McInturff erroneously concedes to NBC that this has never happened before, because 1996 was apparently one of the elections he was too lazy to include in his study, or because it undercut his thesis that Republicans do not have an advantage.)

Was it the largest deviation recorded, using this model? Not in number of seats. The Democrats had a slightly larger advantage in 1978. But in that election, Democrats were winning a major victory over Republicans, and the deviation caused them to win by a larger margin. The model predicted they'd have something like a 255-180 majority, and instead, they had a 277-158 majority. Even using the absolute measure, it's the second-largest in the past 21 elections, so it's obviously not normal, as McInturff would have you believe. (And 1978 is one of the elections he chose not to include, for whatever reason.) But 2012 is clearly the larger deviation from voters' will.

And there are good reasons to believe the 2012 election advantage is even more extreme and durable, by historical standards, than this simple model shows.

First, by most accounts, the polarization of districts has been increasing. If that's true, the slope coefficient should be decreasing, and the number of votes necessary to swing a seat should be increasing. The Republican structural advantage of 21 seats will be harder to overcome than in the past -- it will take more votes. There is a bit of support in the data for this -- from 2002-2010, the winning party underperformed the model in four of the five elections. Only in 2004 did the winner overperform -- and it should be noted that this followed the unusual mid-cycle redistricting in Texas, leading to GOP seat gains in the 2004 election. Other than that the GOP overperformed in 2006 and 2008, when they lost, and underperformed in 2002 and 2010, when they won.

Second, the model above may omit a factor -- something having to do with incumbency, or new incumbency. After the two biggest wave elections -- the Watergate election in 1974, and the Gingrich takeover in 1994 -- the next election sees the beneficiaries appear to improve their performance relative to their vote share, and that advantage appears to persist for several elections. Because I don't yet have a conceptual mechanism to explain this, I'm not building it into the model -- but there may well be something I'm missing.

Third, redistricting just occurred, and was thoroughly controlled by Republicans. We might expect that Republicans would show an advantage with the new district lines. Let's look at the average difference by redistricting cycle:

DecadeAverage GOP advantage

No pattern? Nothing going on here, eh, Mr. McInturff? The data are moving in one direction. And there is every reason to believe that we've achieved historic levels of partisan advantage. There's no obvious reason to disbelieve what the model finds for 2012 and beyond. A completely different methodological approach undertaken by Nate Silver shows a marked decline in the number of swing districts, just since 1992 -- from 103 in that year to 35 in 2012 -- and further shows that the tipping point district -- the district that would determine control of the House if partisan voting followed presidential patterns -- is now a district that is 5-10 points more Republican than the nation as a whole.

So, nice try. Perhaps a cursory glance at the data let you believe that nothing special was happening. Or perhaps you were just trying to justify an unjustifiable perversion of voters' will in your partisan direction. But a deeper look shows you're wrong -- we've reached a highly unusual level of partisan advantage in House elections. And it's bad for the country, making it harder for voters to exercise their will on matters of public policy.