Beyond the Box Score: An SB Nation Community

Navigation: Jump to content areas:


Sports blogs for fans, by fans.
New Blog: RSL Soapbox for Real Salt Lake Fans!

I finally got a shockey monkey to get my brother going and he has the 2007 to 2009 Pitch F/X data ready for download. He has included the scripts which he used to speed up the download process.

Once the retrosheet data is out for 2009, we will make the entire dataset available. Due to its large size, we will hopefully be making a smaller version of just 2000 to 2009 data available this year as some people have requested. It all depends on how well the shockie monkey works out.

26 days ago 770insig_tiny Jeff Zimmerman (TucsonRoyal) 9 comments 2 recs  | 

Story-email Email Printer Print

Comments

Display:

Fantastic

This is great. I don’t need it because I already have it…. but the hassle I had to deal with to get it makes this great for those who didn’t want to deal with all of the hassle but want the data.

by dougdirt on Oct 26, 2009 2:33 PM EDT reply actions   0 recs

Beginner question...

Formerly known as "Andersklasen."
Check out the best Twins' blog on the web: TwinsTarget.com.

by TwinsTarget on Oct 27, 2009 12:27 AM EDT reply actions   0 recs

Didn't mean to post that yet...

Beginner question: Is there anything like a “table definition” so I can know how to write queries and draw certain information?

Formerly known as "Andersklasen."
Check out the best Twins' blog on the web: TwinsTarget.com.

by TwinsTarget on Oct 27, 2009 12:28 AM EDT up reply actions   0 recs

Here is one for the Pitches table:

http://fastballs.wordpress.com/2007/08/02/glossary-of-the-gameday-pitch-fields/

If you have any question on what exactly you are looking to do in particular, ask away.

Jeff Zimmerman - Protecting the world from RBI's and Wins from my mom's guest house.

by Jeff Zimmerman (TucsonRoyal) on Oct 27, 2009 12:40 AM EDT up reply actions   0 recs

Thanks, will do!

I’m looking forward to diving into this stuff. I’ve touched the surface with season-by-season data, but pitch fx looks to be an entirely different beast.

Formerly known as "Andersklasen."
Check out the best Twins' blog on the web: TwinsTarget.com.

by TwinsTarget on Oct 27, 2009 12:46 AM EDT up reply actions   0 recs

Here's a question:

I have the data, and am having a blast sorting by description, speed, break, and all that fun stuff, but what would I add in the “WHERE” clause that would give me results from a particular pitcher/team/year? Is this even possible?

Formerly known as "Andersklasen."
Check out the best Twins' blog on the web: TwinsTarget.com.

by TwinsTarget on Oct 27, 2009 1:10 AM EDT reply actions   0 recs

Basically, what do I match up in the JOIN clause?

FROM pitches p JOIN players a ON p.id = a.lahmanid

What is lahmanid, and where are the names/id given in the pitches table?

Formerly known as "Andersklasen."
Check out the best Twins' blog on the web: TwinsTarget.com.

by TwinsTarget on Oct 27, 2009 1:15 AM EDT up reply actions   0 recs

To get the Pitcher/Team/Batter/ Year

The following query is the one I used, with the date add per your request, is the one I used in the Vlad Strike zone Judgment article. You can see that you need to join almost all the tables using the game date information for year and the players table to get name.

select p.des,p.px,p.pz from
atbats a
join pitches p on a.ab_id = p.ab_id
join games g on a.game_id = g.game_id
join players pl on a.batter = pl.eliasid
where
g.date like ‘2009%’and
((px > 1.2 and px < 2 and pz <4.5 and pz >.5)
or (px < -1.2 and px > -2 and pz <4.5 and pz >.5)
or (px >= -1.2 and px <= 1.2 and pz > 3.5 and pz <4.5)
or (px >= -1.2 and px <= 1.2 and pz > .5 and pz <1.5))
and pl.last = ‘Mauer’
order by p.des

Jeff Zimmerman - Protecting the world from RBI's and Wins from my mom's guest house.

by Jeff Zimmerman (TucsonRoyal) on Oct 27, 2009 1:59 AM EDT up reply actions   0 recs

Jeff, or Harry, or anyone

I’ve been thinking it’s a good idea to extract player stats using PItch f/x data. That way it updates throughout the season, and you can get exactly what you want. I figured out a pretty easy way to do so by using a bunch of SUM(IF( commands in the SELECT clause, so I’m good with that; the only problem is that I can’t figure out a way to count R and ER totals by pitcher.

In the “des” field in the “atbats” table, it provides a description of the play, and what happened. For example:

Carlos Delgado doubles (1) on a fly ball to left fielder So Taguchi. Paul Lo Duca scores. Carlos Beltran scores.

That gives me the information of who scored in the play. Is their anyone to get a count of each time the word “scores” is mentioned within a field?

by vivaelpujols on Oct 27, 2009 8:13 PM EDT reply actions   0 recs


User Tools

We use numbers and stuff.
Community Guidelines
Why be a member?
Start posting on Beyond the Box Score »

Join SB Nation and dive into communities focused on all your favorite teams.

FanPosts

Community blog posts and discussion.

Recommended FanPosts

Small
PZR-based Win Values 2001-2006

Recent FanPosts

Leopold_butter_scotch_southpark_small
Using the TVC
Small
Determining Batted Ball Rates using Pitch Type and Location
Small
a new xBABIP calculator
Img587561916661595
Top 15 high school MLB draft prospects
Small
The "30 parks on a budget" challenge
Sunflower_small
World Series Simulation, Game #6
Small
JT20 Dynasty League
E52205a2_small
New Look
Sth70021_small
Exploring Hit f/x, Albeit Badly

+ New FanPost All FanPosts >

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

Primer on BaseRuns
Cool Baseball Infographics
ESPN's Jerry Crasnick on defensive metrics
I’m also a follower, since Brian Bannister’s on our team, of sabermetric st...
Top Ten Baseball-Reference.com's Sponsorships
Primer on Linear Weights
JC Bradbury on "Hot Stove Myths"
Everyone Should Learn to Throw a Cutter
Criminals of WAR
Ten statisticians you should know about

+ New FanShot All FanShots >

BtB on Twitter

Main Feed: @BtBScore

Tommy B: @tommy_bennett
Sky: @BtB_Sky
Dan: @dturkenk
Harry: @harrypav
Jinaz: @jinazreds
Jack: @jh_moore
Erik: @Erik_Manning
Tommy R: @trancel
Justin: @justinbopp

Subscribe to BtB via Email

Enter your email address:

Delivered by FeedBurner

Most Commented

BtB Goes Social


Managers

Nando_small R.J. Anderson

Limes_125_small Sky Kalkman

E52205a2_small Tommy Bennett

Editors

Face_small Harry Pavlidis

Rawlings_baseball_bigger_small Dan Turkenkopf

770insig_small Jeff Zimmerman (TucsonRoyal)

Aviles_small Justin Bopp

Authors

Banny_small erik

Raysring1_small Tommy Rancel

Jinaz-reds-avatar_small JinAZ

Jmlogo_small Jack Moore

1753738656_110919ebe9_o_small vivaelpujols

1_small Graham

Baseball_small Mike Rogers

Redcap_small SFiercex4

Small Patrick Clark

Walter_album_small Walter Fulbright