Bocconi Home


Teaching > Teaching materials

20630 Introduction to Sport Analytics

Introduction to Sport Analytics

This course provides the analytics requirements of a Sports Management program and it provides an opportunity for applied work for students in Business Analytics and Data Science. All applications in the course will be based on the statistical software R. The course is taught through a combination of lectures, class discussion, group presentations. Students are required to read assignments from the texts as well as additional sources provided by the instructor. Students must attend class prepared to engage in discussions; have, articulate and defend a point of view; and ask questions and provide comments based on their reading and on their own R applications.

Pre-Requisites: Students are expected to have attended a core course in statistics and to be familiar with basic calculus and linear algebra.
Teaching Assistant: Luca Minotti , office hours Tuesdays 1630-1830 Room 2-E2-FM03, mail 


Creating Web Applications with Rshiny 
Learning Shiny with NBA DATA  (by Julia Wrobel),
Programmes for NBA Shiny short version , Programmes for NBA shiny long version 

Accessing Application Programme Interfaces with R
Accessing APIs from R a tutorial , an R code for the tutorial, an illustrative code to access data from Genius Sport C gold 

Dynamic Documents with R Markdown
build a report with all results and comments
An introduction to R Markdown
an illustrative R Markdown code

The Shiny Project 

Instructions for those who have opted for the Shiny Project are available HERE
link to the recorded briefing session: 
LINK to the recorded Presentation of RSHINY PROJECT GROUP 1:
LINK to the recorded Presentation of RSHINY PROJECT GROUP 2:

The Basketball Analyzer  Project 

Instructions for those who have opted for the Basketball Analyzer  Project are available HERE 
link to basketball analyzeR:
P. Zuccolotto and M. Manisera (2020) Basketball Data Science – With Applications in RChapman and Hall/CRC.
LINK to the recorded Presentation of the Cluster Analysis project:
SLIDES and  Rmd codes  

Course Content Summary

Section 1: The Modelling Approach to Sport Analytics

Why models ? 
The checklist of model building
Graphical and Descriptive Analysis
Model Specification
Model Estimation
Model Simulation
Model Evaluation 
An Application: mapping boxscores statistics into Team Performance
Big Data and Spatial Tracking 
Shotcharts with R Shiny  

Winston W.L.(2009) Mathletics, Princeton University Press
Berri D.J.,M.B.Schmidt and S. Brook(2006), The Wages of Wins, Stanford University Press  
David J. Berri, Martin B. Schmidt (2010) Stumbling On Wins.Two Economists Expose the Pitfalls on the Road to Victory in Professional Sports-FT Press 
Goldsberry K.(2019) Sprawlball. A visual tour of the new era of NBA, Houghton Mifflin Harcourt
Shea S.(2014) Basketball analytics. Spatial Tracking
P. Zuccolotto and M. Manisera (2020) Basketball Data Science – With Applications in RChapman and Hall/CRC.

Section 2: An introduction to R
link to the recorded session:

Install R and R studio on your computer and learn how to run them
Learn what is a package and how to install it
Understand what is a view
define a default directory 
have some fun with R Shiny 
R Code
Torfs Brauer "A Very Short Intro to R" , SOLUTIONS FOR the Torfs-Brauer TO DO LIST 

Data-Objects in R
Data Objects in R (data types) and Data Structures In R (Vectors, Matrices, Arrays, Data Frames, Lists)

Data Handling in R
Importing and Exporting, transforming and selecting data 

Programming and Control Flow
if-else statements, using switch, loops, functions in R

all R codes used in Singh and Allen are downloaded at
R CODES (from Singh and Allen) : Data ObjectsData Handling, Programming, binomial model included

Singh AK and DE Allen(2017) R in Finance and Economics. A Beginners Guide, World Scientific Publishing, Ch 1,2,3,4
Heiss F. (2016)  Using R for introductory Econometrics, 
Yihui Xie, Dynamic Documents with R and Knitr,  Chapman and Hall 

EXERCISE 1 Write an R code that answers to all the ToDo points  in  Torfs P. and C. Bauer(2014) “A (very short) introduction to R” ,
EXERCISE 2 An introduction to Data Handling, SOLUTION

Section 3: Graphical and Descriptive Analysis of Sport Statistics (NBA data)
link to the recorded session:

Graphical Analysis
Correlation Analysis
QQ plots and Histogram
Subsetting data and TS plots
Introduction to model building and Simulation

The NBA database: download and import in R. teamsoverall2020.csv, (new file shorter for download)  
R CODES :  code, please not that you need to create Teams_overall2020.csv ro run the code 
EXERCISE 3:  text, code
link to part 1 of the recorded exercise discussion
link to part 2 of the recorded exercise discussion

Section 4: The Linear Regression Model 
SLIDES 1 link to recorded lecture:
link to recorded lecture  part 1 :
link to recorded lecture part 2:
Models for Experimental and non-Experimental Data
Models as outcomes of reduction processes
Model Estimation: the OLS and its properties 
Interpreting Regression Results: Statistical Significance and Relevance 
The Effects of Model Misspecification 

EXERCISE 4:   The Four Factor Model,  NOTES , solution
LInk to the virtual class

Winston W.L.(2009) Mathletics, Princeton University Press, Chapter 28 

Section 5: Using Models to Weight NBA Statistics  
link to recorded lecture PART 1:
link to recorded lecture PART 2:
link to recorded lecture on players evaluation: 

Weighting Statistics to measure performance
Correlation analysis
The NBA Efficiency Measure
Using a Model based on Possession
Offensive Efficiency and   Defensive Efficiency
Modelling Wins
Evaluating Statistics by Simulation: Monte-Carlo and Bootstrap methods
Completing the Model
Evaluating Players' Efficiency: WINS, assists and WINS48    

R CODES: team_stat , players_statdata on players, NOTES
EXERCISE 6:    textnotes, SOLUTION 
link to the recorded lecture discussing exercise 5-6 :

Berri D.J.,M.B.Schmidt and S. Brook(2006), The Wages of Wins, Stanford University Press, Ch 6,7 

Section 6: Measuring Competitive Advantage and its effects   

Competitive Balance inthe Sport Industry
The Noll-Scully Measure
CR concentaration Measure 
Herfindal Index
Competitive Balance in European Football
Evidence from a Natural Experiment on English Soccer 

EXERCISE 7:    text, solution 


Berri D.J.,M.B.Schmidt and S. Brook(2006), The Wages of Wins, Stanford University Press, Ch 3,4
Brandes L. and E.Franck(2007) "Who made who? An Empirical Analysis of Competitive Balance in European Soccer Leagues" Eastern Economic Journal
Haddock D. and L.P.Cain(2006) "Measuring Parity:Tying into the Idealized Standard Deviation", Journal of Sport and Economics
Koning R.H.(2000) Balance in competition in Dutch soccer, The Statistician, 49, Part 3, pp.419-431
Szimansky S.(2001) "Income inequality, competitive balance and the attractivenessof team sports:some evidence and a natural experiment from English Soccer" the Economic Journal,111, F69-F84 

PRESENTATION by Mark Nervegna (Head of Research and Analytics, SportBusiness, 

Section 1
Introduction of  SportBusiness to give the students an idea for who the firms work with and how clients use our data and services. Within this first part Mark Nervegna  will run through his role as Head of Research and Analytics and how the team collects, validates, runs analysis and produces reports on the data which we collect each day, highlighting the challenges which we face searching for and validating hard to find information.

Focus on:

  • Sponsorship Analysis
  • Media Rights Analysis
  • Ad-hoc Consulting Projects
  • Fan Analysis
  • Soccer Product

Section 2
Follow up on the Soccer Product and showcase the in-depth analysis conducted on the Soccer Sponsorship Data. The presentation wil focus on  the sources of information and the Mixed Regression Model coded in R to predict the sponsorship values within the rights holders portfolio which are not made available to the market -with showcase examples through SB exclusive platform.

PRESENTATION  by Aldo Comi Nicolo Golinelli, Luca Minotti and Matteo Zago
- Soccer in numbers;
-Introduction to advanced soccer performance statistics
- Expected Goals;
- Performance analysis through wearable devices;
- match analysis;
-Stats and Scouting: the Moneyball methods in soccer;
- Using data to improve young players: the case of  AZ Alkmaar;


Last update 12/05/2020

In this section