MLB Median Runs Scored per season

342 views
Skip to first unread message

BaseWinner

unread,
Jan 6, 2017, 11:58:41 AM1/6/17
to SportsDataBase
Hi Guys - I used this search to get the Average runs scored per game by season, is there a quick (or long) way to get the Median of the same data.

A(runs) + A(o:runs)  @season

Thank You,

Mark

Joe Meyer

unread,
Jan 6, 2017, 4:22:12 PM1/6/17
to SportsDataBase
Mark,

a Median summative might be a good addition to Average and Sum.

This SDQL describes the median runs over the past several seasons:
S(1),S(runs>2),S(runs<=2),S(runs>3),S(runs<=3),S(runs>4),S(runs<=4),S(runs>5),S(runs<=5)@season


In other news, John Currey -- Graduate of the 2016 SDQL Master's Classes in Las Vegas, Nevada, has passed the SDQL Masters Exam and is now listed at 


Exams are graded at $100 per attempt. 
If you are ready to try it just write us at: 
Mas...@SDQL.com

Best wishes,

Joe Meyer

Paul Sampugnaro

unread,
Jan 6, 2017, 5:07:28 PM1/6/17
to sportsd...@googlegroups.com
Congrats to John who I had the pleasure to meet. 

Paul


--
You received this message because you are subscribed to the Google Groups "SportsDataBase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sportsdatabas...@googlegroups.com.
To post to this group, send email to sportsd...@googlegroups.com.
Visit this group at https://groups.google.com/group/sportsdatabase.
For more options, visit https://groups.google.com/d/optout.


Edwin Meyer

unread,
Jan 6, 2017, 5:22:43 PM1/6/17
to SportsDataBase
Congratulations to John Currey, the newest SDQL Master!

Ed

John Currey

unread,
Jan 7, 2017, 11:16:21 AM1/7/17
to SportsDataBase
Thanks guys!

To anyone considering taking the Master's Exam, it is challenging as expected. I found that taking the exam is a fantastic learning experience. In working out the answers and then verifying that they were correct using SQDL, I definitely gained a much deeper understanding of the power of SDQL. 

There are practice exams with answers in the MLB Bible (http://killersports.com/Download/MLB/MLB_Bible_2016.pdf) and other sports bibles that will help you prepare. 

Good luck,

John Currey 

Gambrinus

unread,
Jan 15, 2017, 10:54:07 AM1/15/17
to SportsDataBase
BaseWinner,

I am also interested in the median runs per game. I agree with Joe that adding a median function as a tool to SDQL could be useful for handicapping. 

Figuring out the median (the long way) is pretty easy using SDQL with a little help from Excel and some patience. I was able to figure out the median runs for just the Yankees since 2004 in less that 5 minutes. Here's what I did:

I used this query to get the runs scored by the Yankees since 2004

  • team=Yankees and date and runs and o:runs and REG
The first thing I noticed was there are only 2104 game results. Multiplying 13 seasons by 162 games, I thought there should be 2106 game results, so it appeared the database is missing 2 Yankee games since 2004. To narrow down the season the games are missing in, I parsed the SDQL results in Excel, made a quick Pivot Table and found that 2007 had 163 regular season games (I can't remember, but there was probably a tie-breaking game played to get into the playoffs). Also, 2004, 2010, and 2011 have only 161 games. So it seems 3 games are missing in the database. See the table below.

Row Labels Count of Date
2004 161
2005 162
2006 162
2007 163
2008 162
2009 162
2010 161
2011 161
2012 162
2013 162
2014 162
2015 162
2016 162
Grand Total 2104

From there, with the SDQL data parsed into Excel columns, I used Excel's Median function to see that the median number of runs, or the number of runs where exactly half the runs score are above the median and half the runs scored are below the median. The median runs scored for the Yankees is 5. The median runs for the Yankees opponents is 4 runs. The median runs for game in which the Yankees participate is and 9 runs. Comparatively, the average runs the Yankees score is  5.05608365, the average runs per game the Yankees allow is 4.45152091, and the average runs of Yankee games is 9.507604563.



On Friday, January 6, 2017 at 11:58:41 AM UTC-5, BaseWinner wrote:
Reply all
Reply to author
Forward
0 new messages