Republicans are worried that Donald Trump, losing badly to Hillary Clinton, is dragging down the party’s candidates for Congress and state legislatures with him. Sens. Kelly Ayotte in New Hampshire, Richard Burr in North Carolina and Pat Toomey in Pennsylvania — once considered favorites for re-election — are now in tight races or losing. But presidential and Senate races are fought on the same terrain: state by state. Elections for the U.S. House of Representatives and state legislatures are more localized. So, how vulnerable are the GOP’s majorities in Washington and state capitols if Trump’s numbers stay where they are or worsen?

This question boils down to how closely tied presidential voting is with votes for Congress and state legislatures. There’s a pretty clear relationship — for each additional percent of the vote a presidential candidate receives, his or her party will gain several House seats and about two dozen state legislative seats, according to my analysis. But there’s quite a bit of leniency in that relationship. While having an unpopular candidate at the top of the ticket is certainly a challenge, it’s not necessarily a death sentence. Candidates can sometimes successfully distance themselves from their presidential candidate.

The table below gives us some indication of the relationship between presidential election results and party fortunes in Congress and state legislatures. For every presidential election since 1952, it shows the share of the two-party popular vote received by the incumbent party (the party in charge of the White House at the time of the election). It also shows the increase in the number of state legislative seats and the increase in U.S. House seats that party gained in that election:

CHANGE IN SEATS INCUMBENT PARTY CANDIDATE ELECTION TWO-PARTY PRESIDENTIAL VOTE STATE LEGISLATURE HOUSE Adlai Stevenson 1952 44.5% -275 -22 Dwight Eisenhower 1956 57.8 +50 0 Richard Nixon 1960 49.9 +284 +20 Lyndon Johnson 1964 61.3 +592 +35 Hubert Humphrey 1968 49.6 -40 -5 Richard Nixon 1972 61.8 +93 +12 Gerald Ford 1976 48.9 +9 -1 Jimmy Carter 1980 44.7 -224 -36 Ronald Reagan 1984 59.2 +333 +14 George H.W. Bush 1988 53.9 -5 -4 George H.W. Bush 1992 46.5 +50 +9 Bill Clinton 1996 54.7 +74 +1 Al Gore 2000 50.3 -47 +2 George W. Bush 2004 51.2 -32 +4 John McCain 2008 46.3 -75 -24 Barack Obama 2012 52.0 +167 +8 Winning at the top of the ticket usually trickles down Sources: U.S. House Clerk’s Office, National Conference of State Legislatures

There are a few things to notice here. For one, congressional and state legislative seat shares track each other closely — a finding reported in political scientist Steven Rogers’ research. This is consistent with the idea that voters don’t know much about their state legislative candidates and largely vote the party line — they make a decision about their congressional candidate and then tend to vote accordingly down the ballot.

Another trend we see is that presidential results do not map perfectly onto the shifts in state legislative seats. Yes, when a party wins a presidential race, it tends to win legislative seats. But the president’s coattails aren’t necessarily very long. Presidents Dwight Eisenhower (in 1956), Richard Nixon (1972) and Ronald Reagan (1984) won with substantial re-election margins but weren’t able to bring many congressional or state legislative seats with them. On the other hand, Lyndon Johnson’s 1964 presidential landslide came alongside many Democratic pickups, and the unpopular Jimmy Carter brought many legislators and House members down with him in 1980.

The scatterplot below shows the relationship between presidential vote shares and House seat gains.

The relationship is obviously strong but still has a good deal of noise. And interestingly, the trend line suggests that if Clinton beat Trump by 8 to 10 percentage points this year (as polling suggests), that would translate, on average, to just a handful of House seats changing hands, nowhere near the 30 seats Democrats would need to take over the House.

There are a number of other important factors at work in determining whether presidential races induce dramatic shifts in state legislatures. For one thing, there is the contents of the districts themselves. Both due to redistricting and the increasing geographic polarization of Americans, it’s harder to flip districts than it used to be. There just aren’t that many competitive ones. Relatedly, it depends on how exposed a party is — how many seats it currently controls. A party only becomes the majority by seizing competitive districts, and those are inherently hard to hold onto when the winds turn against that party.

In a 1986 paper, political scientist James Campbell sought to measure the coattail effect and found that each additional percentage point that the presidential candidate won was commensurate with a three seat gain in the House. It’s possible that this effect has waned somewhat in recent years with the rise in polarization and the number of safe seats. (The scatterplot above suggests the relationship is more like two seats for each percent of the vote today.) There are fewer massive seat shifts in the House during presidential elections than there used to be, but there are also fewer presidential blowouts.

So what might this year look like? Republicans, with 247 of the House’s 435 seats and 4,125 of the states’ 7,383 legislators, are certainly exposed. Trump’s polling numbers aren’t great, but there are so many factors that make him an unusual candidate, from his rejection of many core conservative principles to his lack of support from several prominent Republicans. We’ve really not seen a candidacy quite like his at the presidential level.

But we have seen it at the state level. Colorado provides us with a couple of useful recent examples. One is the state’s 2010 gubernatorial race, in which Dan Maes, widely seen as an unqualified and irresponsible candidate for governor, nonetheless won the Republican nomination. Instead of trying to coach him or prop him up, most party leaders quickly abandoned him and championed former Rep. Tom Tancredo, the nominee of the American Constitution Party, as the “real” Republican in the race. They also diverted campaign resources into state legislative races. The result: Republicans badly lost the gubernatorial race despite a strong national Republican tide. But the GOP actually picked up a net of one state Senate seat and five state House seats, seizing narrow control of the lower chamber.

In 2004, Colorado Democrats targeted key state legislative races and channeled millions of dollars their way. Despite President George W. Bush’s winning the state by nearly 5 percentage points, Democrats managed to seize seven state House seats and one state Senate seat, taking control of both chambers for the first time in four decades. The top of the ticket doesn’t have to dictate what happens below.

As we’re seeing in several races this year, it’s tricky for Republican candidates to simultaneously run with their party while running against their national ticket. But it’s not impossible. And it may not be that hard for voters to believe that Trump doesn’t really represent most Republicans. That, after all, was a key part of his appeal that made him the nominee in the first place.