Spaniard Fernando Alonso sealed his place in the highest echelon of Formula One drivers with his back-to-back world championships in 2005 and 2006, ending Michael Schumacher’s five-year reign atop the sport. His subsequent accomplishments behind the wheel have only added to his legend. But a more recent glance at Alonso’s F1 results might suggest that his best days have passed him by. Alonso’s McLaren outfit sits in seventh place out of F1’s 10 teams, which is somehow an improvement over last season’s dreadful ninth-place finish. Alonso himself ranks a distant eighth in the driver standings, and he hasn’t finished a race on the podium since leaving Ferrari in 2014.

Perhaps that’s why the 36-year-old is openly considering retirement to pursue other motorsport ventures, such as endurance racing or an IndyCar seat. But despite appearances, Alonso isn’t done yet as an elite F1 driver. In fact, you could argue that he has done some of his best work this season, considering the circumstances. He’s driven circles around McLaren teammate Stoffel Vandoorne — and while that’s earned Vandoorne plenty of criticism, it’s also placed him in good company: Alonso has been dominating his teammates over his entire career.

Judging racers against their teammates is informative because Formula One is not just a competition of drivers (usually two per team per race, in the modern era) but also of car constructors and teams (engineers, pit crews, etc.). Any individual driver’s success is intrinsically connected to how good his car is — even the world’s best driver can only do so much. But by comparing teammates, we are controlling for this to some degree. Although drivers on the same team don’t always have equally strong cars, and sometimes the dreaded “team orders” can play havoc with how they finish relative to each other, teammates are much closer to operating on even footing than drivers across different teams are.

If we break each race result (or qualifying session, assigning those half-weight) into a head-to-head matchup between teammates — again, assuming that two drivers on the same team have roughly the same car to work with — and treat the result as a “win” for the driver who finished higher (or completed more laps, if neither finished the race), Alonso has the most net wins (aka “wins” minus “losses”) of any driver in F1’s modern era (since 1973):

Which F1 drivers dominate their teammates head-to-head? Formula One drivers with the most career net wins in head-to-head matchups against teammates, 1973-2018 Driver Matchups* Wins Losses Share won Net Wins Fernando Alonso 454.5 324.5 130.0 71.4% +194.5 Michael Schumacher 462.0 311.5 150.5 67.4 +161.0 Ayrton Senna 234.0 172.5 61.5 73.7 +111.0 Sebastian Vettel 315.0 212.0 103.0 67.3 +109.0 Nelson Piquet 294.0 194.0 100.0 66.0 +94.0 Alain Prost 298.5 187.5 111.0 62.8 +76.5 Mika Salo 166.5 115.5 51.0 69.4 +64.5 Lewis Hamilton 328.5 195.0 133.5 59.4 +61.5 Jean Alesi 301.5 180.5 121.0 59.9 +59.5 Mika Hakkinen 232.5 144.5 88.0 62.2 +56.5 * Races are given full weight, while qualifying sessions are give half-weight. Source: racing-Reference.info

Only once in Alonso’s career did he see a losing record against a teammate — when he had an 11-16 weighted record against fellow McLaren driver Jenson Button in 2015. Since then, all he’s done is compile +22 net wins against Vandoorne and Button, which ranks second only to Sebastian Vettel’s +27 net wins over his Ferrari teammate Kimi Raikkonen over that span.

Of course, it’s obviously much easier to rack up head-to-head wins against weaker teammates than stronger ones, so perhaps Alonso has just been padding his numbers against the Stoffel Vandoornes of the world. One way we can adjust for this, however, is to borrow a page from other sports’ head-to-head rankings and craft our own F1 driver ratings. The way this works is that our data is fed into a giant logistic regression, in which each teammate matchup’s result is predicted by ratings for the drivers involved. The most accurate ratings are the ones that best predict what actually happened in the races (or qualifying sessions). When we run the numbers across entire careers, this has the advantage of telling us how good each driver is relative to one another, by way of the connections that form when racers switch teams and compete against other drivers. (So indirectly, we can say Driver X is better than Driver Y because both were teammates of Driver Z, and Driver X performed better in those head-to-head matchups than Driver Y did.)

With our new ratings in hand, we can plug them into each driver’s matchup data to get an “expected” record — the head-to-head record we would expect for a perfectly average driver against the same set of teammates faced by an actual driver. So for instance, longtime Ferrari driver Felipe Massa had -98 net wins against his teammates in his career, which sounds really bad until you consider whom he was teammates with: a who’s-who of former world champs, including Alonso, Schumacher, Raikkonen and Jacques Villeneuve. Against those teammates, Massa’s -98 net wins actually becomes +11 wins relative to what we’d expect out of an average driver under the same set of circumstances.

Adjust everyone’s record that way, and you get a more definitive ranking of the most impressive drivers since 1973. And, according to our new measure, Alonso still ranks first:

Which F1 drivers excelled vs. the toughest competition? Most career head-to-head wins vs. teammates above expected (adjusted for quality of competition) for Formula One drivers, 1973-2018 head-to-head wins Driver Expected* Actual Vs. Expected Fernando Alonso 196.4 324.5 +128.1 Michael Schumacher 184.6 311.5 +126.9 Lewis Hamilton 98.5 195.0 +96.5 Nico Rosberg 104.1 176.5 +72.4 Sebastian Vettel 140.4 212.0 +71.6 Ayrton Senna 103.4 172.5 +69.1 Jenson Button 187.3 240.5 +53.2 Jarno Trulli 151.8 203.5 +51.7 Rubens Barrichello 191.5 236.5 +45.0 Alain Prost 142.5 187.5 +45.0 * Generated using opponent ratings from a logistic regression that adjusts for strength of competition over a racer’s entire career. Source: Racing-Reference.info

On a per-race basis, Alonso runs behind the late Ayrton Senna (for our money, the greatest driver in F1 history) and current reigning world champ Lewis Hamilton. But nobody has had a more impressive total record against his own teammates than Alonso has enjoyed over the years.

In that light, it might also be time to reassess just how poorly Vandoorne has done this season. Alonso himself has said that Vandoorne isn’t being treated fairly by the racing press: “He will always be a little bit behind,” Alonso joked, because “it’s difficult to beat me!” But then he got serious: “If you see previous teammates, they were a lot further [behind] than Stoffel. … In 2014 it was six or seven tenths [of a second] to Kimi every race. It’s less than that now.”

“He arrived [in F1] in a difficult car with some difficulties last year and this year as well. But he’s OK, and he will be very close in performance as soon as the car is delivering normal performance.”

The numbers bear that out: Even at a slight aerodynamic disadvantage relative to Alonso this year, Vandoorne’s qualifying lap times have been closer to Alonso’s than Raikkonen’s were at Ferrari in 2014. And his head-to-head record of 4.5 wins and 12 losses against Alonso is 0.8 wins better than the mark we’d expect from an average driver. Meanwhile, Alonso himself has the most net wins (+7.5) and wins above expected (+6.1) of any F1 driver this season.

2018′s best head-to-head drivers Most head-to-head wins vs. teammates above expected for Formula One drivers, 2018 season Driver Matchups* Wins Losses Net Wins Vs. Expected† Fernando Alonso 16.5 12.0 4.5 +7.5 +6.1 Max Verstappen 16.5 11.0 5.5 +5.5 +5.5 Lewis Hamilton 16.5 11.0 5.5 +5.5 +4.8 Sebastian Vettel 16.5 10.5 6.0 +4.5 +3.6 Nico Hulkenberg 16.5 10.0 6.5 +3.5 +3.3 Esteban Ocon 16.5 10.0 6.5 +3.5 +3.0 Kevin Magnussen 16.5 11.0 5.5 +5.5 +2.5 Kimi Raikkonen 16.5 6.0 10.5 -4.5 +2.1 Valtteri Bottas 16.5 5.5 11.0 -5.5 +1.8 Stoffel Vandoorne 16.5 4.5 12.0 -7.5 +0.8 Daniel Ricciardo 16.5 5.5 11.0 -5.5 +0.2 Marcus Ericsson 16.5 6.0 10.5 -4.5 +0.2 Brendon Hartley 16.5 7.0 9.5 -2.5 +0.0 Carlos Sainz Jr. 16.5 6.5 10.0 -3.5 +0.0 Sergio Perez 16.5 6.5 10.0 -3.5 -1.2 Lance Stroll 16.5 9.5 7.0 +2.5 -2.0 Sergey Sirotkin 16.5 7.0 9.5 -2.5 -4.1 Charles Leclerc 16.5 10.5 6.0 +4.5 -5.7 Pierre Gasly 16.5 9.5 7.0 +2.5 -6.7 Romain Grosjean 16.5 5.5 11.0 -5.5 -10.7 * Races are given full weight, while qualifying sessions are give half-weight. † Expected wins are generated using opponent ratings from a logistic regression that adjusts for strength of competition over a racer’s entire career. Source: racing-Reference.info

It’s a little bit circular, of course, since Vandoorne’s rating informs Alonso’s record and vice versa. But the beauty of our regression-based ratings is that they also account for how much a driver usually dominates his teammates over a sample of many seasons. So because Alonso is legendary in that department, Vandoorne is actually holding his own this year — and Alonso is simply up to his old tricks.

The raw driver standings will probably end up showing this as just another in a string of mediocre late-career campaigns for Alonso. And if he does leave the sport after this season, it won’t be on a championship note. But the job he has done in recent years with his underpowered McLaren has been nearly as impressive as the one he did en route to those world titles during his prime. Alonso won’t have many points to show for it, but he appears to be as sharp behind the wheel as he ever was.