Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
58 changes: 58 additions & 0 deletions BigProjectReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Dickinson Men's Basketball Project - Data400


Dickinson Men's Basketball: Season and play-by-play analysis <br>
![Dickinson Athletics logo](dickinsonathleticsimage.jpeg) <br>

## Introduction/Research Questions
We were given access to the Dickinson College Men’s Basketball account with Synergy Sports. Synergy Sports is where all season and play-by-play data is stored in their own API for most NCAA basketball games.​<br>
With this, we were able to access *event level*, *game level*, and *season level* data. <br>

Areas of interest:
- How do offensive and defensive basketball statistics influence the accuracy of predicting the Points per Possession (PPP) rating and ratio?
- Are game-level statistics (fouls, points, etc.) significantly related offensive/defensive success?
- Does the winning percentage significantly change when considering event-level characteristics?


## Data Retrieval
The process to get the data out of the website varied based on the type of data. The **season level** data for individual players and as a team was easily downloaded as a PDF and then converted to a CSV in Excel which could be read into Python. The **event level** data was more difficult to access. We had to inspect the elements of the page and find the login token as well as the link to the data. Then in Python, we were able to just switch game IDs to use that link and token to have requests collect the data and then we specified what elements to pull out of the mass list and into the data frames we would create.


| Data File Name | Data.Files | Link to File |
| -- | -- | -- |
| “Seasondata” | seasondata.csv | <a href="seasondata copy.csv">Download Season Data CSV File</a> |
| “All games” | all_games.csv | <a href="all_games copy.csv">Download All Games CSV File</a> |



## Processing the Data
Season-level data:​
- Years 2015 through 2023, excluding 2020 (minimal data available)​ <br>
- Created merged_offense and merged_defense dataframes to analyze separately, year column added​ <br>
- Seasondata combines both merged datasets and creates an ID to identify offense or defense <br>

Play-by-play (event) data:​
- 27 games from the 2023-24 season​ <br>
- Includes away/home teams, score, event level description, date, offensive/defensive players on the court during each event <br>
Once the event level data was into Python in a workable state, we created dummy variables indicating what type of event occurred in each row. The variables included timeout, shot, assist, block, rebound, steal, and foul.

## Preliminary Analysis
![PPP Rating EDA](PPPRatingbyYear.jpeg)

## Model Specification

Season-level data:​ <br>
We aim to analyze the significance of certain season metrics to predict their impact on the PPP value.​ <br>
To do this, we conducted a variety of regression analyses: OLS regression with variety of control variables, separating regressions by offense and defense, and using interaction terms to determine the relationship between variables changing with one another. <br>
<br>
Game-level data: <br>
Our goal is to analyze the games of the 2023-24 season and estimate which factors are most impactful for a win.​ <br>
> Number of fouls/rebounds for Dickinson and opponent, home/away game

- We aim to predict the PPP ratios for certain seasons while accounting for Attribute (Transition, Zone defense, last 4 sec on shot clock, etc.) and other offensive/defensive variables​

- Regression analysis using in-game statistics value to predict PPP ratios.




Binary file added Data400MiniProject - Derek Chibbaro.pptx
Binary file not shown.
Binary file added Derek-Maggie_FinalPresentation.pptx
Binary file not shown.
Binary file added Derek-Maggie_Progress Presentation.pptx
Binary file not shown.
30 changes: 30 additions & 0 deletions Idea2-Data400.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Idea 2
###### Derek Chibbaro
#
#

## Idea:
My second idea for a potential project would be to expand my research that I conducted while taking Advanced Econometrics (ECON 398) this past spring. My intention is to expand on my analysis of winning percentages when the Knicks play an away game. I would like to numerically evaluate a team's effort in winning certain games based on who they play and if there are playoff implications. I can use the ranking statistics to determine which team in which season can be categorized as "playoff-bound".
### Research Question:
How does the knowledge of opponent strength and playoff implications affect a team’s performance in regular season games? Do the point differentials or other game level statistics vary across teams and years?

### Data
I created a merged data set of game level data for the New York Knicks in the last 10 seasons and added numerous ranking statistics for the opponents of each game. This data is from Basketball Reference and was downloaded via Excel spreadsheets. My cleaned data set is in Stata format, but can be uploaded into Python.

### Useful variables from the dataset
|variable | description
| :--- | :--- |
rank | provides a numerical value of rank for each team based on one season
pointdiff | point differential of each game
LateGame | =1 if game was played after 5:00pm; =0 otherwise
Away | =1 if game was played away; =0 if home game


## Model
I can create a cutoff point for all seasons, maybe the 60th game of the season (out of 82) and compare the winning percentages and other statisitcs before and after the cutoff. I learned the Regression Discontinuity model in ECON 398, which looks at how significant a specified cutoff point is. Is there a significant "jump" at the cutoff, indicating that latter portion of the season is played differently than the earlier parts of the season?

### Implications for stakeholders
The results from my project can be used by casual basketball fans to identify any trends related to teams that are contending for playoffs or not. NBA executives could also look at the performance of teams that are out of playoff contention and determine if there should be any penalty for "purposefully" losing. This would be difficult to determine since you can't be 100% sure that a team is doing something on purpose.

### Ethical/Legal/Societal Implications
This data is available for free to anyone who wants to use it for their own research and there are no intentions of selling these results. Teams who don't perform to their best ability could drop in the standings, which would impact their chances of receiving higher draft picks in the future season. This can create an unfair advantage and a worse viewer experience if the team is only focusing on future seasons. Owners and managers wouldn't want teams to underperform because this could impact attendance ratings and hurt their financial sucess.
33 changes: 33 additions & 0 deletions Idea3-Data400.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Idea 3
###### Derek Chibbaro
#
#

## Idea:
My third idea for a potential project would be to analyze Pokemon Go statistics for individual pokemon. I can look at the attack, defense, and stamina metrics as well as the type of pokemon to see if there are correlations between these statistics.
### Research Question:
Is there a correlation between the attack, defense, or stamina and the combat power associated with each Pokemon? How does the type of pokemon (ex: normal, grass, electric, dark and ghost, etc.) impact the accuracy of the CP prediction? Do certain types provide more of an advantage than others?

### Data
I found a Pokemon Go stats data set in the form of CSV which includes 721 Pokemon, including their name, first and secondary type, and basic stats: hitpoints (HP), Attack, Defense, Stamina and Total Stats. The data was scraped from a Pokemon Go game info website and was minimally edited.

### Useful variables from the dataset
|variable | description
| :--- | :--- |
Max CP | Max Combat Points of Pokemon
Type 1 | primary type of Pokemon
Type 2 | secondary type of Pokemon (if applicable)
Is Legendary | True or False
Stamina | stamina stat of Pokemon
Attack | attack stat of Pokemon
Defense | defense stat of Pokemon


## Model
I can use a regression analysis to predict a Pokemon's combat power by using other statistics like stamina, attack, and defense. It would be interesting to see how the model changes if the type of pokemon is known and if one type is generally predicted to have a lower combat power than another.

### Implications for stakeholders
The results from my project can be used by the developers of Pokemon Go to see how balanced certain aspects of the game are in comparison to the overall strenght of pokemon. This can allow them to adjust max combat powers if there is one type that is too strong over another. A Pokemon Go player can use these results to identify strategies in their gameplay.

### Ethical/Legal/Societal Implications
This data is available for free to anyone who wants to use it for their own research and there are no intentions of selling these results. Pokemon Go players can use this information to predict their own pokemon's effectiveness against others. They can also use this knowledge when trading with others in the game. Developers of the game can create new items for purchase that could impact the Pokemon's stats and balance the game more effectively.
32 changes: 32 additions & 0 deletions Mini_Project_Idea1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Mini Project - Idea 1
###### Derek Chibbaro
#
#

## Idea:
For my mini project, I'm interested in analyzing the effects of the infield shift rule that was implemented at the start of the 2023-2024 season. I'd like to see where balls were put into play and identify any trends with where the ball was hit in the field and how locations of ballparks could influence the outcomes as well. I'm thinking of creating an interactive heat map that represents where a ball was put into play. The viewer can use a drop down menu to change the field location and they can use a slider to change the year.
### Background on the rule change:
According to the MLB, "defensive teams will be required to have a minimum of four players on the infield, with at least two infielders completely on either side of second base. These restrictions are intended to increase the batting average on balls in play, to allow infielders to better showcase their athleticism and to restore more traditional outcomes on batted balls."
My intention is to analyze the difference between batted ball outcomes before and after the new shift rule was added as well as identify any correlations between the outcomes and what stadium a team was playing in.
### Research Question:
Is there a correlation between where a ball is put into play and the change of the MLB shift rule? Does the location of an MLB stadium impact a hitter's decision on where they try to hit the baseball?

### Data
The data I plan on using is from pybaseball, which pulls from Baseball Savant's website. It contains numerous game level statistics (94), and is a package that can be imported into Python.

### Useful variables from the dataset
|variable | description
| :--- | :--- |
hit_location | Indicated by which number position
home_team | home team for a given game
events | explains what happened after each pitch
launch_speed | speed of batted ball
des | description of outcome

Note that for the years, I can select the time frame when importing the data. Other variables could be considered as well.

### Implications for stakeholders
The results from my project can be used by casual baseball fans to identify any trends related to the new shift rule. This rule can still impact the game in the future in ways we haven't experienced yet, which can make this project even more interesting in years to come.

### Ethical/Legal/Societal Implications
This data is available for free to anyone who wants to use it for their own research and there are no intentions of selling these results. Baseball fans can better understand aspects of the game that are less obvious to a casual viewer, which can help the game's fanbase as well.
Binary file added Recap for Data180.pptx
Binary file not shown.
Loading