One big warning for Republicans in the midterm elections: Democrats got more votes for their money in every competitive special election since President Trump took office, as this comparison of Federal Election Commission filings and election returns shows.

Why it matters: Republicans still won most of the races, but Democrats narrowed the partisan gap in each race by an average of 16 points compared to each district's GOP leanings. Money matters, and Republicans have a lot of it. But the gap in return on investment is another factor in the uphill battle Republicans are facing in races around the country.

One reason Republican groups have invested so much in these races is because Democratic candidates have out-raised their Republican challengers. (Note: Candidates’ own spending is not included in the numbers above.)

Big picture: Democrats and Republicans are going toe-to-toe in the 2018 fundraising wars, and the breakdown in spending by party committees and outside groups shows where Democrats can invest less and make significant gains — even in deep-red Republican districts.

In most of the races, Democrats got more votes for their money even in elections they didn't win.

Yes, but: Democrats spent close to Republicans’ amount in Alabama, where Trump won by 28 points. Alabama's Senate race was unique for many reasons, but stakes were especially high for Democrats because they were preventing an alleged pedophile from joining Congress and because the state hadn't elected a Democratic senator since 1992.

And even spending less money per vote is no guarantee of victory, as Democrats found with Jon Ossoff in the Georgia special election.

What to watch: There are 119 GOP-held districts less competitive than PA-18 alone. Averaging a 16-point margin over Republicans could be a telling sign for Democrats come November, when Sabato's Crystal Ball argues it would take Democrats winning the popular vote by just three to four points to gain control.

Bottom line: Republicans should be worried about Democrats' performance, but Democrats need to start winning more of these elections if they want the House back.

Methodology: Data was collected from the Republican National Committee, the National Republican Senatorial Committee, the National Republican Congressional Committee, the Democratic National Committee, the Democratic Senatorial Campaign Committee, the Democratic Congressional Campaign Committee, the Conservative Leadership Fund, and House Majority PAC.

It also includes any outside groups that invested at least $250,000 in the races, either directly to the candidates or through state party transfers from the start of the relevant year through the election date.