For President Trump and the GOP, the 2018 midterms are shaping up to be a tale of two chambers. In the U.S. House, Republicans look like they’ll lose seats — and maybe even their majority. But the U.S. Senate is a different story. FiveThirtyEight’s Classic forecast shows essentially no change in seats as the most likely outcome, and gives the GOP about a 7 in 9 chance of maintaining control. In fact, we currently give Republicans almost a 50 percent shot of gaining at least one seat.

This is an unusual position for the presidential party in a midterm election. But it’s not unprecedented.

Looking back at the 18 midterms in the post-World War II period, the president’s party has accomplished this feat only three times — 1962, 1970, and 1982. I calculated how many seats the presidential party held in the Senate and House at the time of the midterms and then how many seats it won or lost in the election. In the table below, I have highlighted the three cycles where the Senate and House moved in opposite directions — incidentally, the president’s party gained Senate seats while losing ground in the House in all three.

The House and Senate typically move in the same direction The presidential party’s performance in midterm elections from 1946 to 2014 Net seat change YEAR PARTY HOUSE SENATE 2014 Democratic -13 – -9 – 2010 Democratic -63 – -6 – 2006 Republican -30 – -6 – 2002 Republican +7 – 2 – 1998 Democratic +4 – 0 1994 Democratic -52 – -8 – 1990 Republican -9 – -1 – 1986 Republican -4 – -8 – 1982 Republican -27 – 1 – 1978 Democratic -10 – -3 – 1974 Republican -43 – -4 – 1970 Republican -10 – 1 – 1966 Democratic -46 – -3 – 1962 Democratic -6 – 4 – 1958 Republican -49 – -13 – 1954 Republican -16 – -2 – 1950 Democratic -27 – -5 – 1946 Democratic -53 – -11 – Seat change calculated by how many seats the presidential party gained or lost based on the number of seats it held on Election Day. Seat vacancies were assigned to the previous party. Party switches after an election were not included in the calculations. Sources: Brookings, Greg Giroux, Michael Dubin, U.S. House of Representatives, U.S. Senate, UVA Center for Politics, Voteview.org

And what happened in these three midterm elections — more on that in a second — mirror to varying degrees what we see playing out now: The president’s party typically faces a midterm penalty, but in the Senate, which seats are up vary by class, and the number and location of the Senate seats the non-presidential party must defend can counteract that penalty. This year, Democrats face a particularly bad Senate map. In contrast, an unpopular president will almost certainly harm his party in the House, where all 435 seats are up for election.

Now to what happened and what it could mean for 2018. In 1962, when John F. Kennedy was president, Democrats lost six seats in the House, but gained four in the Senate. As the table above shows, this four-seat net gain in the Senate is the largest presidential party pickup there in a modern midterm election. Democrats were able to minimize their House losses and even gain seats in the Senate partly because Kennedy had such a high approval rating — around 60 percent — a month before Election Day. Generally, when presidents have high approval ratings, their parties don’t perform as poorly in the House, but the president’s standing affects the overall electoral environment, which can also matter in Senate elections.

Eight years later, in Richard Nixon’s first midterm, Republicans gained one seat in the Senate while losing 10 seats in the House. Just like his former rival Kennedy, Nixon had a strong approval rating — he was at 57 percent less than a month before Election Day — but unlike the Democrats in 1962, the GOP in 1970 was firmly in the minority in both congressional chambers. This diminished the GOP’s electoral exposure (i.e. the number of seats it had to defend), which reduced the number of seats Democrats could target for takeover. Democrats had to defend 25 of the 35 Senate seats up that cycle, including 13 in states that Nixon carried in the previous presidential election. This helped Republicans win four Democratic-held seats, though the GOP lost three seats that year too.

And in our last example, in 1982 Ronald Reagan’s GOP suffered a net loss of 27 seats in the House but still managed to add one seat in the Senate. The gap between House seats lost and Senate seats won was much larger in 1982 than in 1962 or 1970, and that might be because Reagan had a much lower approval rating – in the low 40s by Election Day. But once again, higher Democratic electoral exposure probably helped the GOP in the Senate — the Democrats held 19 of the 33 seats up in 1982.

It’s intuitive that there’d be some relationship between midterm outcomes in the Senate and House. For example, if the FiveThirtyEight forecast improves for the GOP in the House, we would expect it to improve in the Senate, and vice versa. We’ve even written about how they’re related in our forecast methodology. After all, congressional elections occur both at the same time and in the same electoral environment, but as FiveThirtyEight’s Classic forecasts suggest, there can be some disconnect. To show this, I plotted the relationship between losses or gains in the Senate and House for the presidential party, including the current modal outputs for the FiveThirtyEight forecast. I found a correlation of .57 between the chambers, suggesting a somewhat positive but by no means ironclad relationship between shifts in the Senate and House for the presidential party.

Based on our current 2018 midterm forecast, Reagan’s 1982 midterm might be most analogous to our present election cycle. At the very least, it’s more closely related to what we’re seeing in the House than either the 1962 or 1970 midterms.

In 1982, Reagan had an approval rating in the low 40s by Election Day, which is pretty similar to Trump’s current standing in the polls. And as we saw with Reagan, a president as unpopular as Trump could mean large losses for his party in the House. The modal outcome in our House forecast currently sits at about a 30-seat loss for Republicans, which is not much more than the 27 seats the GOP lost in 1982. However, Republicans are more exposed this year and could lose a larger number of seats: The GOP must defend 240 seats in 2018, compared to 193 seats in 1982.

But if we look at just the Senate map, the 1970 Nixon midterm might be more similar — Democrats then had to defend 25 seats; this November, they’re defending 26. The modal outcome in our Senate forecast currently shows no change in the number of Republican seats, but does give the GOP almost a 1 in 2 chance to gain one or more seats. And when these circumstances are combined — a negative political environment for Republicans but a favorable Senate map — as they are in 2018, Republicans have a pretty good shot at becoming the fourth presidential party to lose ground in the House but gain seats in the Senate in a midterm election.