This story was produced in collaboration with ABC News and Ballotpedia.

On the afternoon of July 18, President Trump tweeted his “full and total endorsement” of Georgia Secretary of State Brian Kemp, a candidate in the state’s closely matched Republican gubernatorial primary runoff. Kemp’s opponent, Lt. Gov. Casey Cagle, had strong conservative chops — he enjoyed the endorsement of the National Rifle Association and the support of popular outgoing Republican Gov. Nathan Deal. But after the president’s tweet, the race began to look very different. Within days, Kemp surged in the polls and won in a landslide.

The Republican Party is a coalition of overlapping factions — pro-business types, libertarians, evangelicals, populists, single-issue advocates and more — but to whom does it really belong? To many, the answer is clear: Donald J. Trump. And the success of Trump-endorsed candidates in the Republican primaries this year seems to bear that out — but, according to our research, that’s only part of the story.

Between Feb. 27 and Sept. 13, 774 people appeared on the ballot this year in “open” Republican primaries — those with no Republican incumbent — for Senate, House and governor. Like we did with Democrats earlier this year, FiveThirtyEight, Ballotpedia and ABC News teamed up to look at every single one of those candidates and see which GOP-affiliated people and organizations supported which candidates. Using campaigns’ financial filings, endorsement information from various interest groups and, of course, Trump tweets, we attempted to quantify which wing of today’s Republican Party best reflects the preferences and mood of rank-and-file voters. Here are some of the biggest takeaways.

Almost all candidates Trump endorsed won their primaries How candidates endorsed by selected people and groups fared in open Republican primaries for Senate, House and governor in 2018 Candidates endorsed Total Winners Share that won Donald Trump 17 15 88% Koch network 21 18 86 Republican Main Street Partnership 17 11 65 Chamber of Commerce 8 5 63 Tea Party Express 16 10 63 Club for Growth 21 13 62 National Republican Congressional Cmte. 63 39 62 National Rifle Association 14 8 57 Susan B. Anthony List 23 12 52 House Freedom Fund 14 7 50 No Labels 2 1 50 Right to Life 74 33 45 Open races are those that do not feature a Republican incumbent. Sources: Ballotpedia, secretaries of state, Associated Press, candidate websites, listed organizations’ websites, Federal Election Commission, Twitter, news reports

The Trump card

Let’s start with the kingpin of the Republican Party, the president himself. Trump endorsed 17 candidates in open Republican primaries this election cycle, and 15 of them won. That 88 percent win rate is the highest of any person or group we looked at. In early August, Trump tweeted, “As long as I campaign and/or support Senate and House candidates (within reason), they will win!” It was a bit of an exaggeration, but his success rate has certainly been high so far.

But the evidence is mixed on how much credit Trump deserves for actually driving those primary wins. On the plus side for Trump, in the GOP primary for Florida governor, state Agriculture Commissioner Adam Putnam led in most polls before June 22 — but then Trump tweeted his full endorsement of then-U.S. Rep. Ron DeSantis (who resigned from the House this month). DeSantis surged into the lead, and he topped practically every poll the rest of the way. On the other hand, in California’s gubernatorial primary, Republican John Cox polled about equally well both before and after receiving Trump’s endorsement. Cox averaged 16.5 percent support among voters of all parties — in California primaries, candidates of all parties appear on the same ballot — in four polls taken the month before Trump’s May 18 endorsement. Cox averaged 17.7 percent in three polls taken after the president’s endorsement. But the role Trump played in the Georgia gubernatorial primary is less clear-cut: We have some evidence that some, but not all, of Kemp’s rise was due to Trump. An Opinion Savvy poll that happened to be in the field when the president gave his endorsement found that Kemp was already outperforming his previous polling even before Trump tweeted. But the same poll also found that Kemp polled even better after Trump’s endorsement.

Trump’s win rate may also be inflated by the type of candidate he endorses. For example, several of the candidates he endorsed didn’t face truly competitive primary opposition, including U.S. Senate candidates Florida Gov. Rick Scott and Mitt Romney, who is running in Utah. Other candidates he backed are less firebrands in Trump’s own image and more straitlaced establishment types with broad appeal. Trump has repeatedly cautioned Republican primary voters to “remember Alabama” — where a Republican Senate candidate lost to a Democrat in a deep-red state after the GOP nominee was embroiled in a sexual misconduct scandal involving minors — and vote for a candidate who can win a general election.

The old guard

But the Republican establishment isn’t leaving it all up to Trump. For example, the National Republican Congressional Committee’s “Young Guns” program steers donors toward the GOP’s strongest candidates in swing congressional districts by naming them to any level of their “Young Guns” program. The NRCC named 63 candidates to their Young Guns program; 39 advanced to the general election, for a 62 percent win rate. One caveat, multiple candidates running in the same district can be named to Young Guns. This lowers the NRCC’s win rate because only one GOP candidate per race appears on the general election ballot in most states. We couldn’t find any endorsements from the NRCC’s Senate counterpart.

A handful of groups that explicitly endorse more moderate or pragmatic Republicans have also had some success this cycle. The pro-business U.S. Chamber of Commerce and its state-level affiliates endorsed eight candidates in open Republican primaries; five of them won, for a win rate of 63 percent. The moderate Republican Main Street Partnership, which styles itself as the “governing wing of the Republican Party,” had a 65 percent win rate (11 wins out of 17 endorsements). And the bipartisan centrist group No Labels had a better record in Republican primaries than it did in Democratic ones: The two Democrats the group endorsed both lost, but of the two Republicans No Labels explicitly supported, one prevailed.

The conservative diehards

But the establishment wing’s endorsements were frequently at odds with those of an old nemesis: tea party-style conservatives. Starting in 2010, hard-right Republicans won primaries under the banner of the tea party movement, and a number went on to win their general elections as well; today, many of those successful tea partiers wield significant influence as members of the House Freedom Caucus, and together they have successfully shifted legislation to the right in recent years. But despite this faction’s success in Congress, its popularity with the public is dwindling: Support for the movement peaked at 32 percent in 2010 but had fallen to 17 percent by 2015. Perhaps as a result, the Tea Party Express — one of the original and most influential organizing groups of the tea party movement — today issues fewer endorsements than it has in the past. But according to our data, the relatively small group of candidates backed by the Tea Party Express didn’t do too badly. They won 10 out of 16, or 63 percent, of open Republican primaries they ran in this year. The House Freedom Fund — the unofficial electoral counterpart of the House Freedom Caucus — did a bit worse, endorsing 14 candidates, seven of whom ended up winning (50 percent). In a trend that may indicate Americans are losing interest in the tea party, the House Freedom Fund lost six of the eight primaries in which it went head-to-head with the Republican Main Street Partnership.

Although the tea party appears to have largely gone out of style, we’d be remiss if we didn’t look at the endorsements of the individual power brokers most closely associated with the movement: the Koch brothers. Charles Koch (his brother David has retired) and groups affiliated with the Koch family, like Americans for Prosperity, continue to spend money and political capital on candidates who support their limited-government priorities. And it looks like they still have plenty left in the tank: This year, the Koch political network backed 21 candidates, 86 percent of whom won their races. That’s especially interesting given the Kochs’ opposition to Trump’s trade policies and Trump’s public feud with the brothers. In fact, Trump has bragged on Twitter that the Kochs’ “network is highly overrated, I have beaten them at every turn.” But at least in the open primaries we looked at, the two have not supported opposing candidates this year. By contrast, they’ve actually supported the same candidates in eight open races.

The issue scorecard

Since its founding in 1999, the Club for Growth hasn’t been shy about spending money to elect fervently anti-tax Republicans. (The group says it is “focused on conservative economic policy, and does not take positions on social issues or on the immigration/borders debate.”) We identified 21 candidates endorsed by the Club for Growth; 62 percent of them won their races. That makes the club roughly as successful as the Tea Party Express, whose goals and endorsements often overlap with the Club for Growth’s.

The NRA is currently more popular among Republicans than it has been at any point since Gallup began asking Americans about it in 1989; 88 percent of Republicans have a positive view of the group. Puzzlingly, however, candidates who won the NRA’s endorsement in this year’s primaries are finding only middling success. The NRA endorsed 14 candidates in open Republican races, but only eight — or 57 percent — won.

If Republicans have an equivalent of Emily’s List, which strives to elect pro-choice Democratic women, it’s the Susan B. Anthony List. Its mission is to elect pro-life politicians, especially women. But if Republican primary voters are driven by the issue of abortion, it’s not showing up in the Susan B. Anthony List’s track record. The group has a win rate of just 52 percent (12 wins out of 23 candidates). The batting average of National Right to Life, another anti-abortion advocacy organization, is even worse — 45 percent, or 33 out of 74 — despite endorsing more than three times as many candidates.

So what have we learned? Generally, it doesn’t look like Republicans are single-issue voters or care much about identity politics; the Susan B. Anthony List, National Right to Life and the NRA had some of the lowest win rates of any group we analyzed. The conservative purists endorsed by the likes of the Tea Party Express and Club for Growth have fared about as well as the pragmatists backed by the likes of the Republican Main Street Partnership and the NRCC, although the House Freedom Fund is performing notably worse than other purists and the Koch network is performing notably better. (Perhaps access to money explains why the Koch network has outperformed the House Freedom Fund.) But the candidates with the best chance of success are currently those who have attracted the support of the president — so, in whichever direction the causation may run, an endorsement from Trump himself remains the most valuable prize in a Republican primary.

CORRECTION (Sept. 24, 2018, 2:56 p.m.): A previous version of the table in this article incorrectly listed the number of candidates who were endorsed by the National Republican Congressional Committee, as well as the number of those candidates who won. The NRCC endorsed 63 candidates, not 42. And 39 of them won their primaries, not 29.