Walking the walk: Part I, Offense

February 4th, 2009 by Prof. Nerdtron 3000

No one has ever mistaken fantasy baseball for real-life baseball.  Except for me.  When I’m trouncing the nincompoops in my league, I want to feel like the victory has some greater meaning in life.  My fellow nincompoops feel much the same way, which is why we set up a Sportsline league that allows us to set the stat values to whatever we so desire.  This way, we don’t have to deal with the absurdness of a Yahoo! League where a SB is the same as a HR.

It also turns out that I’ve been tasked with learning R, an open source statistical package, for work.  Namely, I need to figure out how to do a multiple regression.  This is a statistical technique that allows you to model an outcome based on multiple inputs.  So, to learn how to use the software, I decided to model offense in baseball, and finally figure out how good our league’s scoring system really is (for offense, at least).

Here’s a warning.  It gets really nerdy from here on out, so if you’re just interested in the answer, here it is.  Our method is pretty good.  We overvalue walks.  If you’re for some reason interested in R vs. SPSS, R is an adequate replacement.

So what is this scoring system?  It’s point based for various baseball events.  We’re only talking about the offense, so here we go:

Event Points
1B 1
2B 2
3B 3
HR (dong) 4
BB 1
R 1
RBI 1
SB 1
CS -1
GDP -1

To figure out how our weights stack up, I looked at the 2008 run scoring for each of the teams as a measure of offense (i.e., the outcome variable).  The planned inputs were everything shown above, plus strikeouts.  However, some of the measures ended up being dropped.  Strikeouts didn’t make the final analysis because it’s bimodal (what’s going on there?), and regression demands normal distribution.    Triples are positively skewed, but I kept them in anyway without a transform.  RBI and GDP I dropped because they’re context dependent.  Obviously, RBI and R are closely correlated.  There is nothing Earth shattering by saying that the trick to scoring runs is driving them in. GDP is equally misleading.  A team with a high GDP has a lot of runners on base, which is actually a good thing.  SB and CS didn’t end up being a significant predictor of runs in 2008, so they’re not in the final analysis.  A league that treats steals as anything more than a footnote is interested in Fantasy baseball, not fantasy Baseball.  If your real-life MLB team is built around steals, take a moment and go weep.

I’m sorry I’ve offended the member of the Willy Tavares fan club.  The output of the modeling is in the table below.

offensemodel

What does this mean?  This is a linear model, of the form y=mx + b.  Y, in this case, is predicted runs.  B is the intercept, and listed under each model.  Don’t read into the negative intercepts, it’s mostly a statement that real baseball teams don’t have zero offense.  The rest of those numbers are the coefficients for each event.  In model number five, where all five events are used, we predict that a homerun will produce 1.5 runs, and a double will produce 0.94 runs.  Triples are also productive, but we have to take that 1.46 with a grain of salt because the original data was skewed.  Finally, a walk is not as good as a single, but getting on base at all is still very valuable. (Don’t worry about something being more significant than something else.  Significance is a yes/no proposition.  If something is reported as more significant, that speaks to the confidence in the coefficient, not the magnitude of the coefficient itself).

None of this is actually new, and all it really does is confirm that we’re on the right track with our league weights.  We could stand to knock BB down a bit, I guess.  It’s also pretty amazing that these 5 stats describe 90% of the variance in run production.  Finally, the Twins scored 60 more runs than the model predicts.  They were the only over-productive outlier.   I would expect fewer runs out of them this year.   San Diego and St. Louis under-produced by about 40 runs.  The SD result shows that not including park factors could be a real problem if this were anything more than just fooling around.  STL will probably just score more runs this year.

Now how often can I get nerdly baseball pursuits to count as work?

Tags: , , , , , ,

9 Responses to “Walking the walk: Part I, Offense”

  1. Dr. Nerd says:

    Nerdtron, I’ve always been interested in a single OPS-like statistic that could the most precise measure of a player’s offensive capabilities. OPS is nice, but I’ve always felt that it’s flawed because it counts hits more than once: once in SLG and once in OBP. Do you think that (Total Bases (TB) + BB)/Plate apperances might be a better stat than OPS?

  2. Doc– I actually think OPS has it right in this regard. I’m basing this on column 5, which tells me last year a single created more runs than walks. But anyway, let’s look at this empirically. The correlation between OPS and run scoring on a team level is 0.94. With DOC (your stat) and run scoring it’s 0.90. So DOC is a pretty good stat, but OPS is better. If DOC has some ontological value, go ahead and use it.

    Edit– The linear model in 5 has a correlation of 0.95 to run scoring, making it the very slight and likely non statistically significant winner.

  3. Vorpy McNerd says:

    I do feel bad for those nincompoops in your fantasy league. What a bunch of tools.

    Also, you have failed to account for ‘heart’, ‘hustle’, and ‘blue collar work ethic’ in your analysis. Your findings are useless without these clearly observable attributes.

  4. Look, the model only explains 90% of the variance. The remaining 10% is clearly grit and determination.

  5. Claudio LePont says:

    Yeah, SPSS is BAD, R is an ok replacement except for two things: It falls down if dealling with very, very large data files, and it’s no good for people who know SPSS and don’t want to learn a new package. In these situations, you need PSPP. PSPP is a 100% legit free replacement of SPSS, and can work on really BIG amounts of data. Get it at http://gnu.org/software/pspp

  6. Dr. Nerd says:

    Prof., could you include in your regression a statistic for defensive errors by the other team. While they are few are far between, they inevitably do lead to runs and I’d be curious to know how much a defensive error is worth to the offense. SB as well, even though the relative value would be tiny.

  7. I can’t get any permutation of SB, CS, the ratio of SB/CS, or any various transformations to show up statistically significant. The transformations are particularly nasty too. In order to normalize SB/CS, you need to take the log, which is completely fails the parsibility test (how do you spell parsibility?). SB/CS were not a large enough factor in run scoring last year to show up in this analysis. That’s a really careful way of saying things. More bluntly, SBs just don’t meaningfully contribute to team offense.

  8. Nerdstradamus says:

    Prof – did you do a best subsets to test the significance of the SBs and CS or just a simple regression?

  9. I didn’t do best subsets formally, since I didn’t know how to do that in R. I did play with with the order things went into the model (yes, I know, bad), and still couldn’t find a way to get SB/CS to count. I’m guessing that the proper interpretation of this model is not that speed is useless, it’s just that the value of speed is detectable through triples, not SB/CS. This model loves Jose Reyes, and it doesn’t even count his SB.

    In the pitching and defense model that should come out this week, I might do best subsets, since I know how to do that. The bigger problem is I’m rusty on hierarchical modeling, but HLM is needed for pitching and defense.

    P.S. Make yourself an account so I don’t have to approve your comments

Leave a Reply