Nationals right-hander Tanner Roark allowed six runs and got only eight outs in Washington’s 8-7 loss to the Marlins. (Steve Mitchell/USA Today Sports)

The scientific explanation for the Washington Nationals8-7 loss to the Miami Marlins on Monday night could best be depicted in a pie chart, in which each contributing factor earns an appropriately sized piece. As is usually the case, despite common perception, that pie chart would have several different portions.

The largest would belong to Tanner Roark, who handed back a six-run lead in the shortest start of his career. Smaller parts would belong to Jacob Turner, who allowed Giancarlo Stanton to tie the game with a homer in the seventh, and to Enny Romero, who got ahead 0-2 on too many hitters to not retire one of them in the ninth.

A part would belong to the Marlins, too — after all, Marcell Ozuna did swing at the ball he lined to the gap for the game-winning single in the bottom of the ninth. Unfortunately for those who value simplicity, baseball rarely affords a straightforward explanation.

In the 162-game picture, the explanation hardly matters at all. The outcome is the same, the sum of the parts still a loss for the Nationals, who are 42-28 and still in firm control of the National League East. That so many things contributed to the Nationals’ downfall Monday yields one main conclusion: They did not play very well, so they lost.

Roark would probably give himself the full pie’s worth of responsibility after he did not last three innings . The Nationals gave him six early runs two work with, two on a first-inning home run by Bryce Harper, another on a second-inning shot by Anthony Rendon. By the end of the third, the game was tied 6-6, thanks in part to a grand slam by big Washington-area native Justin Bour. Roark had been ahead of Bour 0-2. Eventually, he hung a change-up that Bour hit out to right.

“You get a six-run lead and you give it up. That’s pathetic on my part,” Roark said. “That’s bad.”

The right-hander said he had been tinkering with his mechanics, trying to drive more to the plate and get better extension. Monday, he drove toward the plate but felt that his arm lagged behind. After two strong innings, the trouble caught up to him in the third, when he threw 44 pitches, walked two and allowed those six runs.

“My arm felt good,” said Roark, who has allowed 13 runs in his past two starts and 22 in his past four. “Just need to stop pitching like crap.”

Manager Dusty Baker pulled Roark after 2⅔ innings to keep the game where it was. The move worked, as Matt Grace and Oliver Perez combined to get the Nationals to the seventh inning with a lead with 3⅔ innings of scoreless relief.

That lead came courtesy of Stephen Drew, who replaced Rendon in the fifth inning. Rendon had felt what he later described as “a jolt” in his neck diving for a groundball in the third. After two more innings in the field, he felt he could not play through it. Initial indications from him and his manager are that he is day-to-day.

So Drew pinch-hit for Rendon and doubled home Ryan Zimmerman to give the Nationals a lead in the fifth. They held that lead in part because Michael A. Taylor threw out two runners trying to advance on the bases. Had the Nationals won, Taylor — who drove in two with a two-out single in the third — would probably have his name on a big piece of the winning pie chart.

But as it happened, his efforts went for naught. When Baker called on the right-handed Turner to face the right-handed Stanton, Stanton won, driving a ball out to right-center for his 18th home run of the year. Baker hardly had any right-handed options to match up with Stanton, as Koda Glover and Shawn Kelley are on the disabled list, Joe Blanton has struggled against the home run, and Matt Albers would be a natural pick to close if the Nationals got a lead. Perhaps injuries should have a piece of that pie chart, too.

After Stanton’s home run, Romero pitched a scoreless eighth, his 13th consecutive scoreless inning. He nearly had a 14th, as he recorded two outs before walking Dee Gordon. If the Nationals’ season had a pie chart documenting key factors in losses, late-inning walks would consume a large portion of it.

Gordon eventually scored, in part because Daniel Murphy could not handle a hot shot from Stanton that would have ended the game, in part because Romero walked Christian Yelich after that, in part because he then hung a pitch to Ozuna that ended it. He had been ahead of Ozuna 0-2 at the time.

“I wanted to locate fastballs up at chest level,” Romero said through team interpreter Octavio Martinez. “. . . Obviously, that pitch caught more of the plate than I wanted to.”

Any number of moments could have changed things for the Nationals — a few 0-2 pitches here, a groundball fielded there, a runner cashed in before, a runner not allowed after. In the end, responsibility does not change the outcome. Despite the loss, the Nationals are leading their division, well above .500, with the wins taking up more of their season pie chart than the losses, which seems to matter more in the end.