Introducing the Batter-Specific Run-Expectancy Tool

Today at FanGraphs, we’re introducing an interactive run-expectancy tool that incorporates the batter’s skill into the run-expectancy value. The tool, developed by the rather incredible Sean Dolinar, allows the user to input a few factors, including one to account for the batter, and in turn spits out a number estimating how many runs will be scored for the rest of the inning.

For an explanation on how to use the tool, scroll to the bottom of the post.

Run expectancy, or RE, is a crucial part of all baseball analytics. It’s our basis for linear weights and wOBA, it’s closely related to win probability, and it’s the foundation for one of our most important storytelling stats, RE24. But it often fails to capture the whole situation. The batter at the plate, obviously, has an effect on what will happen next. If you have the bases loaded with one out, the run expectancy is going to be very different with Mike Trout up than with Mike Zunino. With Trout up, you’re happy with your chances to score. With Zunino… not so much.

The run expectancy for a given situation is calculated by taking the average number of runs scored for the rest of the inning in similar situations. “Similar situations” means other plate appearances that start with the same base-out state (i.e., runner on second with one out) and the same run environment (which is important, because the AL in 2001 was very different from the NL in 2014). But in order to encapsulate the change that comes with different types of batters, more factors are necessary.

An easy additional factor to account for batter skill is the wOBA of the batter at the plate. The question is, though, what number to use for the batter’s wOBA? One could use all sorts of different samples: their career wOBA, their overall wOBA that season, or their wOBA that season to date.

You Aren't a FanGraphs Member
It looks like you aren't yet a FanGraphs Member (or aren't logged in). We aren't mad, just disappointed.
We get it. You want to read this article. But before we let you get back to it, we'd like to point out a few of the good reasons why you should become a Member.
1. Ad Free viewing! We won't bug you with this ad, or any other.
2. Unlimited articles! Non-Members only get to read 10 free articles a month. Members never get cut off.
3. Dark mode and Classic mode!
4. Custom player page dashboards! Choose the player cards you want, in the order you want them.
5. One-click data exports! Export our projections and leaderboards for your personal projects.
6. Remove the photos on the home page! (Honestly, this doesn't sound so great to us, but some people wanted it, and we like to give our Members what they want.)
7. Even more Steamer projections! We have handedness, percentile, and context neutral projections available for Members only.
8. Get FanGraphs Walk-Off, a customized year end review! Find out exactly how you used FanGraphs this year, and how that compares to other Members. Don't be a victim of FOMO.
9. A weekly mailbag column, exclusively for Members.
10. Help support FanGraphs and our entire staff! Our Members provide us with critical resources to improve the site and deliver new features!
We hope you'll consider a Membership today, for yourself or as a gift! And we realize this has been an awfully long sales pitch, so we've also removed all the other ads in this article. We didn't want to overdo it.

The one on which I settled using is the batter’s regressed wOBA from current season using the methodology that Sean and I wrote about last June. Each regressed wOBA was rounded to the nearest .010 (.327 would become .330, for example) to make the groupings less granular, with a bigger sample size in each grouping. (My data set was all plate appearances since 2009, since that’s the year to which our regression research dates back.)

Additionally, for this project, the run environment was calculated by taking the average team runs per game in that league in that month. Scoring varies a bit by month, so I chose to use months instead of years. I rounded each month’s scoring to the nearest 0.25. This yielded six categories: 3.75 runs per game per team up to 5, incrementing by 0.25. There have been 84 league-months since 2009 (March/April and September/October were both treated as one month). Run environments of 4.00, 4.25, and 4.50 have all occurred at least 20 times; the others are rarer, but they all have happened more than once.

But back to wOBA. As one might expect, batter wOBA turns out to have a tremendous effect on RE. As an example, look at the following situation: Bases loaded, one out, with a run environment of 4.5 runs per game.

woba vs re

However, while the overall correlation is very strong, there are some slight outliers. Run expectancy goes down in some situations when wOBA increases; look, for example, at the decrease from a wOBA of .360 to .370. The numbers need to be smoothed out.

So instead of just taking the original RE value of every grouping, I instead ran a simple linear regression within each grouping of base-out state and run environment. The independent variable was wOBA and the dependent variable was RE. For each combination of base-out state and run environment, there is a unique regression equation modeling run expectancy based on batter wOBA.

This comes with some problems, though. With 144 possible groupings (24 base-out states and six different run environments), some groupings just haven’t occurred all that often over the past seven years, and there’s great uncertainty with the regression equation. One such grouping is no outs and runners on the corners in a run environment of 5.0 runs per game, which has occurred only 136 times since 2009.

woba re negative

The slope is negative. This is certainly wrong. Run expectancy should not decrease when the batter at the plate is better. And this is only one of eight situations where the slope of the regression line is negative. Additionally, 43 out of the 144 regressions had a p-value over 0.1, meaning that there was at least a 10% chance that wOBA had no effect at all, which we can assume not to be true. For some situations (like the one shown in the first graph), this method works perfectly. But there are far too many where it fails.

To solve that problem and get larger sample sizes in the groupings, I stopped grouping by run environment and grouped solely by base-out state. Instead of run environment serving as its own category, it became a variable in the regression. There are now 24 different regression equations rather than 144.

There are several advantages that come with putting run environment inside the regression equation. For one, the regressions are much more meaningful: all the equations have a p-value under 0.05 (and all but one have a p-value under .001). It also makes the whole system much simpler by having six times fewer equations to deal with. And all of the coefficients for both wOBA and run environment are positive, which is somewhat of a validation of the equations; or, at least, they’re not invalidated by any negative coefficients. Furthermore, better fits aren’t achieved by factoring in any interactions between wOBA and run environment, nor by transforming either of those variables (squaring, logging, etc.).

Interestingly, the situations with the lowest run expectancies (across all run environments) had the best fits. The higher the run expectancy of a given base-out state, the less that run expectancy correlated with the batter wOBA and the run environment.

Goodness of Fit of Regression by Run Expectancy

This effect probably comes from the fact that high-scoring situations have a lot more variability in the outcomes. When there’s a lot of variability in those outcomes, the batter’s wOBA and the run environment can only do so much to predict the average. But when there’s little variability – say, bases empty with two outs, which almost always ends with no runs – the batter’s wOBA and the run environment don’t have that tough a task.

wOBA’s effect on the run expectancy is not the same across all base-out states. In addition to correlating with the goodness of fit of the regression, run expectancy also correlates with the magnitude of wOBA’s effect. This is kind of a confusing circle, because we’re talking about run expectancy’s effect on wOBA’s effect on run expectancy, which doesn’t make a whole lot of sense. But to put it simply, the coefficient by which batter wOBA is multiplied is correlated with the original run expectancy of the situation.

Only sometimes, though. Run expectancy’s correlation with wOBA’s coefficient depends heavily on how many outs there are. With no outs, there is almost no relationship between the two variables (the y-axis variable is the coefficient of wOBA in the regression):

Effect of wOBA based on run expectancy - no outs

With one out, the relationship is a bit stronger.

Effect of wOBA based on run expectancy - one out

And with two outs, the relationship is nearly a perfect correlation.

Effect of wOBA based on run expectancy - two outs

There are two questions here: why does a higher run expectancy mean that the batter has a larger effect on the situation, and why is this phenomenon only seen with one or two outs?

For the second question, I really don’t have a great reason. But to answer the first, it’s likely because with runners on, a good hitter has the potential to do a lot of damage, whereas in lower run-producing situations, the batter can only do so much. With the bases loaded, having a .320 hitter up is much, much better than having a .230 hitter up, since you have an extra chance to drive in runs. But with the bases empty, the only difference is just an increased likelihood in a runner being on for the next guy, barring home runs.

Here’s a more specific way to visualize how wOBA’s effect changes based on the base-out state. (Click here for a larger version of the image.)

No out

One out

Two out

But wOBA isn’t the only variable whose effect changes with the situation. We also have the run environment. (This gets a little confusing also, since run environment and run expectancy can both be abbreviated as RE. But RE will always mean run expectancy.) Run environment doesn’t care as much about how many outs there are. The magnitude of its coefficient just correlates with initial run expectancy no matter what.

Effect of run environment based on run expectancy

This means that situations in which more runs are likely to be scored benefit much more from a higher run environment than situations in which fewer runs are likely to be scored. This is, in essence, the same effect as seen with wOBA. When you’re about to score runs, it really helps to have a high run-scoring environment (or a good hitter at the plate). When you’re not about to score runs, that still helps, but not as much.

How to use the tool

The interactive run-expectancy tool is pretty self-explanatory. Most important are the two boxes for batter wOBA and run environment that can be adjusted to fit the situation you want.

There are also two sets of options: empirical vs. smoothed and table vs. graph. Empirical/smoothed toggles the kind of numbers that are displayed. If the empirical box is selected, you’ll see numbers from the exact situations that fit the wOBA/run environment combination you’ve selected from the dropdown menu. With that setting, extreme situations — for example, a .400 wOBA and 5 runs per game — are often not represented correctly because of sample-size issues. But with the smoothed setting on, you’ll see numbers derived from the regression equations previously discussed in this post. These are probably the better numbers to look at for any situation, not only the extreme ones.

Table vs. graph toggles how the data is shown. If the table setting is on, the run expectancy — empirical or smoothed — for the given situation is displayed. If the graph setting is on, you’ll see two bars: a gray one representing the run expectancy for that base-out state and run environment (traditional run expectancy), and a blue one representing the run expectancy for that combination of base-out state, run environment, and batter wOBA. The difference in length of the bars indicates how much higher or lower the run expectancy is with a batter of the specified wOBA at the plate than it generally is in that situation. And you can mouse over the bars to see the actual numbers.

Finally, clicking on the circles (outs) or on the bases diagram highlights that situation in the table.





Jonah is a baseball analyst and Red Sox fan. He would like it if you followed him on Twitter @japemstein, but can't really do anything about it if you don't.

13 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
The Ghost of Stephen Drews BatMember since 2026
10 years ago

wow

JimMember since 2016
10 years ago

Cowabunga Buffalo Bob. Very impressive. Then again, this IS Fangraphs.

Pwn Shop
10 years ago

Interesting but I see some issues with trying to run a completely empirical-based method. For example, situations with intentional walks will really skew your data. What is the run expectancy of a situation where runners are on 2nd and 3rd with a great batter up and two outs? It is probably controlled instead by the next batter, with a lower wOBA and the bases loaded, which is what happens after the intentional walk. Great concept though.

Mahoney
10 years ago
Reply to  Jonah Pemstein

The plus of a fully empirical-based method is that you capture the real-life results of all those interactions directly in the data used (as opposed to say a Markov-chain approach). The minus is that you end up having to regress the relationships, which introduces some level of error due to fitting.

Still, no matter how finely you model this component, you always have the estimation error from having to estimate the batter’s “true talent” level of wOBA. Within those caveats, I think you’ve hit the right trade-off on precision for this neat tool.

misterdirt
10 years ago

For the second question, I really don’t have a great reason.

Simple. Its basically the same answer as to your first question. With 0 outs the RE depends not only on the batter, but is also highly dependent on the batters that will follow the batter during the rest of the inning. With 2 outs 66% of the time there will be no additional hitters following the batter because the batter will make an out. On average of course. Players with higher wOBA will be more likely to have higher OBA as well and therefore less likely to make an out.

formerly matt wMember since 2025
10 years ago
Reply to  misterdirt

Yep. Another way to think of it is, with fewer outs, the batter at the plate will take a smaller proportion of the remaining PAs in the inning. So the effect of his skill is diluted.

Pwn Shop
10 years ago
Reply to  misterdirt

Hey now you’re talkin. I like it.

HawkeyethelastMember since 2017
10 years ago

The pattern I see in the 0 out condition is that the closer the runner is to scoring, the less impact the batter’s wOBA has on the situation. The three highest 0 out wOBA effect situations are the ones with runners on first base (not including the bases loaded situation). And I think this can be rationally understood if you consider ways that a runner can score from 1st rather than 2nd or 3rd. With a runner on 3rd, for instance, basically any ball in play scores a run and balls hit deep enough to the outfield also score a run. So with a wide variety of batter outcomes that result in a run being scored, the batters wOBA is less important. The run scores just as much on sac-fly from ryan flaherty as it does from a triple from jose altuve. But with a runner on first, the batter outcomes that score that runner are much fewer so the quality of the batter has a greater impact. flaherty’s sac fly doesn’t cut it anymore, but altuve’s triple does.

jlongrc
10 years ago

“The dependent variable was wOBA and the response variable was RE.” – surely you mean “independent” where you have “dependent.” This is what you get for mixing up your variable nomenclature (treatment vs. response, independent vs. dependent, predictor vs. outcome)! 😉

I do have a question though, even if overly simplistic. What is the goal of the tool? I assume it is to look at a given (real) game situation and get a feel for how many runs we should expect to score. To be clear, the thing I’m unsure about is whether you want to know about a particular base-out situation in general or want to produce tailored run expectancies for the game situations that pop up as we watch. If it’s the latter, then I wonder if there are a couple of other things we should consider: pitcher “true talent” (FIP? wOBA against?) and handedness of batter/pitcher. We certainly risk going down a rabbit hole of endless complexity, but these seem meaningful to me.

The way I see it, you’d want the true talent for both batter and pitcher in the particular righty-lefty matchup they find themselves in. And the nice thing is that given the regression-oriented approach you’re using, there are straightforward statistical tests to see if the more complex model is adding enough explanation for it to be worthwhile. I’d probably test three types of models: the kind you have here, mine with just the pitcher true talent, then mine with pitcher true talent and handedness added.

Sean DolinarFanGraphs Staff
10 years ago
Reply to  jlongrc

I’d say one of the goals was to present the information differently than before. There are run expectancy tables on this site and other sites but not a lot that illustrates the concept of what happens with different types of batters. Run expectancy is such a fundamental idea in modern baseball analyticals, it’s useful to have other ways to explain it.