Asking Questions with the Math Engine

Everyone who whined to their high school teachers that they’d never use math again in their entire life never foresaw something like StatMuse.

We know that StatMuse lets you ask questions about basic stats, advanced stats and shot charts using simple, natural language, but it is also able to execute complex equations using its math engine.

So, with help from our head statistician Justin Kubatko (a must-follow for every StatMuse user), we’re going to demonstrate some of the numerous possibilities when you ask questions using the StatMuse math engine.

(Stats included are accurate as of the date of publication. Results may have since changed.)

Simple Arithmetic

Any stat that’s able to be asked about in StatMuse can be added, subtracted, multiplied and divided in simple equations. For example, you can get a sense of the biggest overall statistical contributors simply by adding stats together:

What was the most PPG + RPG + APG by a player last season?

You can use symbols (+ — * /) or even spell out the function:

What was the most PPG plus RPG plus APG by a player in a season?

You can get a sense of how different stats affect a player’s overall contributions, like seeing who scores the most without turning it over:

What was the highest (PTS / TOV) by a player in a season, minimum 50 GP and 25 PPG?

Likewise, multiply similar queries by 100 to get a nice percentage:

Which team had the highest 100* (AST / FGM) last season?

Comparative Equations

The math engine also lets you run comparative equations to see how a player’s or team’s stats stack up to those of an opponent. Everyone knows the Warriors hit threes at a ridiculous rate in 2015–16, but their emphasis on stopping the three on the defensive end didn’t get as much publicity. With a simple equation, it’s easy to see how many more threes the Warriors hit than they allowed:

Which team had the highest (3PM — opponent 3PM) in a season?

The 76ers have also received a lot of publicity last season, but not exactly for the same reason. So how does one team get to embody the very essence of a dumpster fire? Well, turning the ball over at an incredible rate while simultaneously not forcing any defensively will do the trick. One would assume they’d have the worst turnover differential in the league.

Which team had the highest 100 * (TOV — opponent TOV) / POSS last season?

Surprisingly, the Oklahoma City Thunder took the top spot, turning the ball over 3 times more than their opponents per 100 possessions. Philadelphia was actually in top 10 for opponent turnovers last season, so using this equation shows that the 76ers actually aren’t the worst in the league at turnover differential and that the process is working!

Just kidding, they’re still a dumpster fire.

Advanced Equations

This is where it gets nuts.

Some stats just don’t paint a full picture by themselves, so you have to factor in another category. Even then, that might not be enough. You need a third or fourth stat, resulting in a need to generate a figure based upon a multitude of factors.

A simple question of “Who’s the best three-point shooter of all-time” could be answered by asking Who has the most career 3PM?” or Who has the highest career 3P% with at least 1,000 3PM? but you could dig even deeper by factoring in volume and efficiency like so:

Who has the highest career 3PM * (3PM / 3PA) + (3PM — (3PA / 3))?

Likewise, provide some meat to the claim “all that guy does is shoot threes” by factoring in what percentage of a player’s actions with the ball ended in a three-point attempt.

Which player has the highest career (100 * 3PA / (FGA + 0.4 * FTA + TOV)) with 400+ career GP?

How about settling the debate once and for all about who’s the biggest ball hog in recent history? In order to do that you’d have to consider how many field goals, free throws and turnovers are attributed to a player and compare that to his assist total. Say no more:

Who has the highest career ((FGA + 0.4 * FTA + TOV) / AST) since 1978, minimum 400 career GP?

And so it is that two-time Shaqtin’ A Fool MVP JaVale McGee is now proven to be the biggest ball hog in recent history.

Try It Yourself

Now that you’ve seen some of the basic NBA questions you can ask using the StatMuse math engine, it’s time to put your knowledge into practice. Log in to StatMuse and ask some of these questions yourself.

If you’re still not quite ready to ask your own questions, you can see some of the best ones shared recently on the homepage. If you need any help, click on the live chat icon in the bottom right-hand corner or send us a message on Twitter and we’ll answer any questions you may have.

In our next post, we’ll jump in a DeLorean and go back in time to navigate the ins-and-outs of asking questions about historical stats.

Full NBA Tutorial Series

  1. Asking About Basic Stats
  2. Asking About Advanced Stats
  3. Creating Shot Charts
  4. Asking Questions with the Math Engine
  5. Asking About Historical Stats
  6. Asking About Playoff Stats