From autumn 2015 to spring 2016, the Republican was beating the Democrat in the generic ballot question. In January 2016, for example, the spread was seven points — 39 percent for the Democrat and 46 percent for the Republican. As it became clear that Mr. Trump would be the nominee, the pattern changed and the Democratic candidate went ahead. By the end of July, the Democrat had 44 percent and the Republican 36 percent.

One way to view this reversal is as the price for nominating Mr. Trump.

Similar trends do not appear to be at work on the generic ballot for the House of Representatives, suggesting two things. First, Mr. Trump’s unpopularity has not affected down-ballot races to the same degree that it has his own race. Second, the trend among the presidential race is not a general anti-Republican sentiment. It is actually something specific about his campaign and most likely about him.

It’s also possible, but less likely, that the change in the generic vote question is less about Mr. Trump and more about Mrs. Clinton, or more specifically, her primary opponent, Bernie Sanders. Perhaps during the Democratic primaries some independent voters thought Mr. Sanders might be the nominee, leading them to hold back from supporting the Democratic candidate until they were sure it would be Mrs. Clinton. If this were the case, however, the switch in the generic vote matchup would probably have happened later in the year when the Democratic contest was winding down.