Tax reform, President Trump’s popularity, and lawmaker retirements will help determine whether House and Senate Republicans can prevail in the 2018 midterm elections or are swept away by a Democratic wave.

Election analysts issued gloomy predictions for Republicans following a string of GOP retirements and the success of Democratic challengers to unseat Republicans in a few state races on Nov. 7.

“If it wasn't already clear, last Tuesday's election results confirmed a political atmosphere that would seriously endanger the House GOP's majority in 2018,” Dave Wasserman, editor of House races for the influential and nonpartisan Cook Political Report, wrote.

Democrats are excited about the prospects of retaking the House majority that they lost in 2010. Democrats would have to win at least two dozen GOP-held seats to take the gavel back from Republicans.

“The door is certainly open for us,” House Minority Leader Nancy Pelosi, D-Calif., said this month.

Pelosi led House Democrats to the majority in 2006, at a time when Republican President George W. Bush’s popularity had sunk to 38 percent.

She pointed out Trump’s own approval ratings hover in that range, and can harm anyone who is willing to run for Congress as a Republican in 2018.

“That means we get the fresh recruits, and they get the retirements,” Pelosi said. “We get the A-team and the candidate is very important in the election.”

More than two dozen GOP lawmakers have announced they will not run for re-election in 2018. Some are in safe districts that don’t pose much of a risk for a takeover by a Democrat, such as the ones held by Reps. Jeb Hensarling, R-Texas, and Bob Goodlatte, R-Va., who recently announced they will not run again.

But many other newly open seats are less certain for Republicans. Reps. Ileana Ros-Lehtinen, R-Fla., Dave Reichert, R-Wash., and Frank LoBiondo, R-N.J., are retiring from seats that Democrats believe they have a chance to win next November.

“The biggest question is what kind of districts these members leave behind,” said Nathan Gonzales, editor and publisher of Inside Elections. “Are they marginal or safe districts? The ones who have retired so far are across the spectrum.”

Rep. Steve Stivers, R-Ohio, who heads the House GOP’s political arm, the National Republican Congressional Committee, told the Washington Examiner that House GOP retirements are below average for the numbers typically seen ahead of a midterm election when the party of the president usually experiences significant losses.

“There have been five Republican-competitive seat retirements and four Democrat-competitive seat retirements,” Stivers said. “So right now, retirements are about a wash.”

Republican lawmakers believe their fate in 2018 will hinge on whether they are able to pass a major tax reform overhaul in the coming weeks.

But Democrats say they’ll use the legislation to hammer the GOP.

Democrats have been criticizing the plan as one that favors big corporations while throwing small tax cuts to the working class that will eventually expire.

“What’s most important is how voters feel about tax reform,” Gonzales said. “Republicans feel confident they are delivering on a campaign promise and voters will reward them, but Democrats are anxious to take certain aspects of the tax bill and put it in an ad that tells voters why it is bad policy that is going to harm them.”

For now, race analysts including Cook Political Report National Editor Amy Walter are taking a hard look at generic poll numbers that show Democrats shifting into a double-digit advantage.

A Nov. 14 Quinnipiac University Poll, for example showed voters would like to see Democrats win control of both the House and the Senate in 2018 by a 13-point margin.

“These are political wave numbers,” Walter wrote.