SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
PERFORMANCE ANALYSIS NFL 2014
PERFORMANCE ANALYSIS NFL 2014
California State University, Los Angeles
Roshik Ganesan
Lakshmi Sundararajan
PERFORMANCE ANALYSIS NFL 2014
DATA SET URL
NFL 2014
http://www.scan-support.com/help/sample-data-sets
This dataset NFL 2014 comprises the details of each that had participated in NFL season 2014.
Comprising 89 columns and 533 rows this dataset consists details about every match that was
played in the season. The field include the details about the team names, the venue capacity, the
type of turf that is used for the match, along with this data it has lots of information which
allows us to do a an entire performance analysis. It details us on the winner of each match the
passing attempts made and the corresponding successful passing that they have made. It also tells
us the number of intercepts made by the team in each week and how successfully they have
managed to convert it for their team. This data details us more on the methods in which the
teams have achieved their points with this the preffered method in achieving points could be
found. It also contains data on the points that the teams have scored every week based on which
the teams performance over the week is analysed. This data provides us a lot of insight to be
analyzed which helps in doing a details performance analysis.
DATA CLEANING
1) Removal of NA values
Script
> nfl <- read.csv('sports.csv',sep='|')
> View(nfl)
> nfl<-na.omit(nfl)
> View (nfl)
PERFORMANCE ANALYSIS NFL 2014
2) No columns to split
PERFORMANCE ANALYSIS NFL 2014
3) Deleting Columns
SCRIPT
>nfl$Redzone.TD<-NULL
> nfl$Redzone.Visits<-NULL
> nfl$Redzone.Efficiency<-NULL
PERFORMANCE ANALYSIS NFL 2014
ANALYSIS AND VISUALIZATION
Question 1: Win and Loss Comparison
In this visualization, we have compared each team’s wins and losses of the season. We
can categorize the visualization based on Best, Average and Poor performers.Looking onto the
bar chart that we have depicted below it is clear that IND( Indiana )has the highest wins of 14
matches and lost only 5 ,falling under the category of best performer .The average performers of
the season based on this comparison are CAR(California), CLE and MIN(Minnepolis) where
both win and loss are equal to 8 matches.Also, it is seen that the teams TB (Tampa Bay) and
NYJ(New Jersey) has the least number of wins which is only 2 and 4 respectively. Hence these
two teams fall under Poor performers.
PERFORMANCE ANALYSIS NFL 2014
Parameters Learnt In Class:
We have installed two packages Dplyr, Data.table. Using plot_ly we have done side by side
bar. Colors' function is used.
Question 2: What are the Top 5 best intercepting teams ?
In this visualization, we have considered the top 5 interceptions. The term interceptions mean
tackling the opponents passes and gaining possession with the ball. As per the pie chart shown
below, we can see that the team PHI(Philandalphia) has made the greatest interceptions of 21.
Interesting point to note here is that the team TB(Tampa Bay) has the second highest interception
percentage of 17.2 ,but has poor performance in the overall season.This indicates that TB though
strong in interception couldn’t perform well because of the weak offense team. This states that
interception is not an important parameter in achieving success in a season.
Parameters Learnt In Class:
Using plot_ly we have made a pie chart. Colors' function is used.
PERFORMANCE ANALYSIS NFL 2014
Question 3: Which team has the best successful passing coversion ?
In this visualization, we have done an analysis on the successful passing conversion percentage
of the season.This is done by considering the total passing attempts out of which successful
passing completion is done. These values are passed into the function which gives the result of
success conversion percentage that is ordered in descending. It can be seen that the team
NO(New Orleans) has the highest passing conversion percentage. Even though the passing
percentage is high their overall performance is not significant. Whereas Dallas has a passing
percentage of 68.8% which bolsters their consistent performance in the season. The top 5 teams
in the list except for Dallas are average performers in the season which states that the passing
conversion parameter doesn’t have a big impact on the overall performance but still maintaining
a good percentage with a decent offence would stand good chances of outperforming the
opponents in the season.
PERFORMANCE ANALYSIS NFL 2014
Parameters Learnt In Class:
Color function, Standard Deviation and Plot_ly for bar chart is used. Then the legend
function is also used for displaying legends.
Question 4: Weekly Analysis of the performance of the teams
In this visualization, we do an analysis on the weekly performance of the teams. This analysis
provides the user with the privilege to enter the team name at runtime and view only that
particular team’s performance metrics. We have used a median function to represent the median
score of the preffered team. We found that the performance of the team ARI (User Preffered) in
the first half of the season is above the median scale whereas second half of the season is below
the median scale. With this analysis the overall performance of the team can be improved by
identifying the period where the team is outperformed, the underlying reason behind it and the
means to achieve better performance during this period.
Getting input from User Sample.
Result Of Input
PERFORMANCE ANALYSIS NFL 2014
Parameters Learnt In Class:
Median function and Plot_ly for Line Chart.
PERFORMANCE ANALYSIS NFL 2014
Question 5: Finding the statistics behind achieving first down by the teams
In this visualization, we have analyzed the statistics behind achieving first down by the teams.
The parameters taken into account are passing,rushing and penalty. Based on maximum total
first down count it is being ordered and plotted in 3D scatter plot.Indiana which is the top team
in the season have achieved the maximum first down by rushing and passing having least
penalties. We can also note that the team NE (New England Patriots) has even numbers of
rushing passing and penalty. Where as BAL has achieved maximum first downs still they
weren’t successful in the season because they have achieved maximum first downs by penalties.
So from this when compared to penalties the other two parameters such as rushing and passing
should the best channel to achieve the first down. This would help the teams in achieving a
competitive position in the season.
PERFORMANCE ANALYSIS NFL 2014
R CODE
Question 1 Script:
install.packages('dplyr')
library(dplyr)
install.packages('data.table')
library(data.table)data <- read.csv('NFL.csv')
df1 <- data %>% dplyr::group_by(Team,X) %>% summarise ( count = n());
df1 <- data.frame(df1);
teamlist <- list(split(df1,df1$X));
loss_df <- data.frame(sapply(teamlist,'[','L'));
win_df <- data.frame(sapply(teamlist,'[','W'));
PERFORMANCE ANALYSIS NFL 2014
merge_df <- merge(x = loss_df ,y = win_df, by.x = "L.Team",by.y = "W.Team",all = TRUE );
merge_df <- data.frame(merge_df);
rowname <- merge_df$L.Team
plot_df <- data.frame(merge_df$L.count,merge_df$W.count,merge_df$L.Team);
print(plot_df);
Teamname <- merge_df$L.Team;
p <- plot_ly(plot_df,x = ~Teamname, y = ~merge_df.L.count, type = 'bar', name = 'Lost') %>%
add_trace(y = ~merge_df.W.count, name = 'Wins') %>% layout(xaxis = list(title = '', tickangle =
-45), yaxis = list(title = 'Win/Loss'), barmode = 'group', title = 'Win and Loss Comparison')
print(p)
question1.R
Question 2 Scrpit:
data <- read.csv('NFL.csv')
df_1 <- data.frame(data);
df3<-group_by(df_1,Team) %>% summarise(total = sum(Interceptions));
total <- df3$total;
piechart <- df3[order(-total),];
df4 <- head(piechart);
PERFORMANCE ANALYSIS NFL 2014
total <- df4$total;
totals <- c('PHI','IND','TB','CHI','JAC','MIN')
pie_df <- data.frame(totals,total)
rownames(pie_df) <- pie_df$totals
piechart1 <- pie_df[,c('total','totals')]
p <- plot_ly(data, labels = ~totals, values = ~total, type = 'pie',
textposition = 'inside',
textinfo = 'label+percent',
insidetextfont = list(color = '#FFFFFF'),
hoverinfo = 'text',
text = ~paste('No of Intercepts =', total),
marker = list(colors = colors,
line = list(color = '#FFFFFF', width = 1)),
showlegend = FALSE) %>%
layout(title = 'Top 5 Best Intercepting Team',
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
print(p)
PERFORMANCE ANALYSIS NFL 2014
question2.R
Question 3 Script: (Standard Deviation)
data <- read.csv('NFL.csv')
df_1 <- data.frame(data);
passing<-group_by(df_1,Team) %>% summarise(total_passing = sum(Passing.Plays));
total_passing <- passing$total_passing;
teams <- passing$Team;
passing_success <- group_by(df_1,Team) %>% summarise(success_pass =
sum(Passing.Completions));
success_pass <- passing_success$success_pass;
sd_passing <- sd(success_pass)
print('The standard deviation of the Success Passing for the Season is')
print(sd_passing )
source('passing_function.R');
success <- passing_function(success_pass,total_passing);
linedf <- data.frame(teams, success);
PERFORMANCE ANALYSIS NFL 2014
ordered <- linedf[order(-success),];
top5 <- head(ordered);
newdf <- data.frame(top5);
nme <- newdf$teams;
lab <- newdf$success;
barplot(newdf$success,main = "Top 6 Passing Conversion Percentage",names = nme, col =
c("red","blue","green","yellow","gray","purple"),ylim = c(65,70), xlab = "Teams",ylab =
"Passing Percentage", xpd = FALSE);
legend("topright", legend = c("No - 69.12", "DAL - 68.82","PIT - 67.27", "WAS - 66.54","MIA
- 66.21", "SD - 66.20"), fill = c("red","blue","green","yellow","gray","purple"))
Function used – passing_function()
passing_function <- function(x,y)
{
success_pass <- x;
total_passing <- y;
success_percentage <- ((success_pass/total_passing)*100);
return(success_percentage);
}
PERFORMANCE ANALYSIS NFL 2014
question3.R
passing_function.R
Question 4 Script: ( Median)
team_vect <- data %>% group_by(Team,Week) %>% summarise(points_sum =
sum(Points.Scored));
team_df <- data.frame(team_vect);
teamlist <- list(split(team_df,team_df$Team));
print("Enter team Name");
teamnme <- scan("",what = "char");
team_df1 <- data.frame(sapply(teamlist, '[',teamnme));
print(team_df1);
print("Enter column to be plotted in line");
var <- scan("",what = "char");
forplot <- team_df1[,var];
PERFORMANCE ANALYSIS NFL 2014
Weeks <- c(1:16)
t <- list(family = "sans serif",size = 14,color = toRGB("grey50"))
plot_df <- data.frame(Weeks,forplot)
print('The median score of the Team is')
print(median(plot_df$forplot));
p <- plot_ly(plot_df, x = ~Weeks, y = ~forplot, type = 'scatter', mode = 'lines', text = ~forplot)
%>% layout(title = "Weekly Analysis", showlegend = FALSE) %>% add_markers() %>%
add_text(textfont = t, textposition = "top right")
print(p)
question4.R
Question 5 Script:
install.packages("scatterplot3d")
library(scatterplot3d)
df_1 <- data.frame(data);
df7<-group_by(df_1,Team) %>% summarise(total_passing =
sum(Passing.First.Downs),total_rushing = sum(Rushing.First.Downs),total_penality =
sum(Penalty.First.Downs),total = sum(Total.First.Downs));
first_down_df <- data.frame(df7);
PERFORMANCE ANALYSIS NFL 2014
count <- table(df7$total_passing,df7$total_rushing);
name1 <- df7$Team;
total <- first_down_df$total;
ordered_value <- first_down_df[order(-total),];
top_ordered <- data.frame(head(ordered_value));
nme <- top_ordered$Team;
dfnme <- data.frame(nme);
print(dfnme);
sp3 <-
scatterplot3d(top_ordered$total_passing,top_ordered$total_rushing,top_ordered$total_penality,c
olor = "blue",type = 'h',pch = 19, main = "First Down Comparison",xlab = "Total Passing",ylab =
"Total Penalty",zlab = "Total Rushing")
sp3.coords <-
sp3$xyz.convert(top_ordered$total_passing,top_ordered$total_rushing,top_ordered$total_penalit
y)
text(sp3.coords$x,sp3.coords$y,labels = dfnme$nme ,cex = .85,pos = 4)
question5.R

Weitere ähnliche Inhalte

Ähnlich wie Performance Analysis NFL 2014

m503 Project1 FINAL DRAFT
m503 Project1 FINAL DRAFTm503 Project1 FINAL DRAFT
m503 Project1 FINAL DRAFT
Brian Becker
 
Determinants of College Football Attendance
Determinants of College Football AttendanceDeterminants of College Football Attendance
Determinants of College Football Attendance
Connor Weaver
 
CLanctot_DSlavin_JMiron_Stats415_Project
CLanctot_DSlavin_JMiron_Stats415_ProjectCLanctot_DSlavin_JMiron_Stats415_Project
CLanctot_DSlavin_JMiron_Stats415_Project
Dimitry Slavin
 
Coaching Ability for Fantasy Football from Numbersense by Kaiser Fung
Coaching Ability for Fantasy Football from Numbersense by Kaiser FungCoaching Ability for Fantasy Football from Numbersense by Kaiser Fung
Coaching Ability for Fantasy Football from Numbersense by Kaiser Fung
McGraw-Hill Professional
 
A Time Series Analysis for Predicting Basketball Statistics
A Time Series Analysis for Predicting Basketball StatisticsA Time Series Analysis for Predicting Basketball Statistics
A Time Series Analysis for Predicting Basketball Statistics
Joseph DeLay
 
What Innings Determine Total Wins
What Innings Determine Total WinsWhat Innings Determine Total Wins
What Innings Determine Total Wins
Payton Soicher
 
1. After watching the attached video by Dan Pink on .docx
1. After watching the attached video by Dan Pink on .docx1. After watching the attached video by Dan Pink on .docx
1. After watching the attached video by Dan Pink on .docx
jeremylockett77
 
Cuiting Zhu-Poster
Cuiting Zhu-PosterCuiting Zhu-Poster
Cuiting Zhu-Poster
Cuiting Zhu
 
InstructionsCongratulations. You are a finalist in for a data a.docx
InstructionsCongratulations. You are a finalist in for a data a.docxInstructionsCongratulations. You are a finalist in for a data a.docx
InstructionsCongratulations. You are a finalist in for a data a.docx
normanibarber20063
 
IPL auction q1_q2.docx
IPL auction q1_q2.docxIPL auction q1_q2.docx
IPL auction q1_q2.docx
AlivaMishra4
 

Ähnlich wie Performance Analysis NFL 2014 (20)

Data warehouse Soccer Project
Data warehouse Soccer Project Data warehouse Soccer Project
Data warehouse Soccer Project
 
LAX IMPACT! White Paper
LAX IMPACT! White PaperLAX IMPACT! White Paper
LAX IMPACT! White Paper
 
m503 Project1 FINAL DRAFT
m503 Project1 FINAL DRAFTm503 Project1 FINAL DRAFT
m503 Project1 FINAL DRAFT
 
Determinants of College Football Attendance
Determinants of College Football AttendanceDeterminants of College Football Attendance
Determinants of College Football Attendance
 
CLanctot_DSlavin_JMiron_Stats415_Project
CLanctot_DSlavin_JMiron_Stats415_ProjectCLanctot_DSlavin_JMiron_Stats415_Project
CLanctot_DSlavin_JMiron_Stats415_Project
 
Coaching Ability for Fantasy Football from Numbersense by Kaiser Fung
Coaching Ability for Fantasy Football from Numbersense by Kaiser FungCoaching Ability for Fantasy Football from Numbersense by Kaiser Fung
Coaching Ability for Fantasy Football from Numbersense by Kaiser Fung
 
A Time Series Analysis for Predicting Basketball Statistics
A Time Series Analysis for Predicting Basketball StatisticsA Time Series Analysis for Predicting Basketball Statistics
A Time Series Analysis for Predicting Basketball Statistics
 
What Innings Determine Total Wins
What Innings Determine Total WinsWhat Innings Determine Total Wins
What Innings Determine Total Wins
 
Final Research Paper
Final Research PaperFinal Research Paper
Final Research Paper
 
Capstone
CapstoneCapstone
Capstone
 
1. After watching the attached video by Dan Pink on .docx
1. After watching the attached video by Dan Pink on .docx1. After watching the attached video by Dan Pink on .docx
1. After watching the attached video by Dan Pink on .docx
 
Cuiting Zhu-Poster
Cuiting Zhu-PosterCuiting Zhu-Poster
Cuiting Zhu-Poster
 
InstructionsCongratulations. You are a finalist in for a data a.docx
InstructionsCongratulations. You are a finalist in for a data a.docxInstructionsCongratulations. You are a finalist in for a data a.docx
InstructionsCongratulations. You are a finalist in for a data a.docx
 
Data presentation 2.pptx
Data presentation 2.pptxData presentation 2.pptx
Data presentation 2.pptx
 
A Hybrid Constraint Programming And Enumeration Approach For Solving NHL Play...
A Hybrid Constraint Programming And Enumeration Approach For Solving NHL Play...A Hybrid Constraint Programming And Enumeration Approach For Solving NHL Play...
A Hybrid Constraint Programming And Enumeration Approach For Solving NHL Play...
 
NFL 2022 STATS Report
NFL 2022 STATS ReportNFL 2022 STATS Report
NFL 2022 STATS Report
 
Unit 5
Unit 5 Unit 5
Unit 5
 
honors_paper
honors_paperhonors_paper
honors_paper
 
Lineup Efficiency
Lineup EfficiencyLineup Efficiency
Lineup Efficiency
 
IPL auction q1_q2.docx
IPL auction q1_q2.docxIPL auction q1_q2.docx
IPL auction q1_q2.docx
 

Mehr von Roshik Ganesan

Mehr von Roshik Ganesan (6)

Crime Analysis at Chicago
Crime Analysis at ChicagoCrime Analysis at Chicago
Crime Analysis at Chicago
 
Real Time Twitter sentiment analysis
Real Time Twitter sentiment analysis Real Time Twitter sentiment analysis
Real Time Twitter sentiment analysis
 
Death Cause Analysis
Death Cause AnalysisDeath Cause Analysis
Death Cause Analysis
 
Youth Tobacco Survey Analysis
Youth Tobacco Survey AnalysisYouth Tobacco Survey Analysis
Youth Tobacco Survey Analysis
 
Kick Start Startup Guide
Kick Start Startup GuideKick Start Startup Guide
Kick Start Startup Guide
 
Predictive analysis of Income
Predictive analysis of Income Predictive analysis of Income
Predictive analysis of Income
 

Kürzlich hochgeladen

如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
SayantanBiswas37
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
HyderabadDolls
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 

Kürzlich hochgeladen (20)

Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Computer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdfComputer science Sql cheat sheet.pdf.pdf
Computer science Sql cheat sheet.pdf.pdf
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
Jodhpur Park | Call Girls in Kolkata Phone No 8005736733 Elite Escort Service...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 

Performance Analysis NFL 2014

  • 1. PERFORMANCE ANALYSIS NFL 2014 PERFORMANCE ANALYSIS NFL 2014 California State University, Los Angeles Roshik Ganesan Lakshmi Sundararajan
  • 2. PERFORMANCE ANALYSIS NFL 2014 DATA SET URL NFL 2014 http://www.scan-support.com/help/sample-data-sets This dataset NFL 2014 comprises the details of each that had participated in NFL season 2014. Comprising 89 columns and 533 rows this dataset consists details about every match that was played in the season. The field include the details about the team names, the venue capacity, the type of turf that is used for the match, along with this data it has lots of information which allows us to do a an entire performance analysis. It details us on the winner of each match the passing attempts made and the corresponding successful passing that they have made. It also tells us the number of intercepts made by the team in each week and how successfully they have managed to convert it for their team. This data details us more on the methods in which the teams have achieved their points with this the preffered method in achieving points could be found. It also contains data on the points that the teams have scored every week based on which the teams performance over the week is analysed. This data provides us a lot of insight to be analyzed which helps in doing a details performance analysis. DATA CLEANING 1) Removal of NA values Script > nfl <- read.csv('sports.csv',sep='|') > View(nfl) > nfl<-na.omit(nfl) > View (nfl)
  • 3. PERFORMANCE ANALYSIS NFL 2014 2) No columns to split
  • 4. PERFORMANCE ANALYSIS NFL 2014 3) Deleting Columns SCRIPT >nfl$Redzone.TD<-NULL > nfl$Redzone.Visits<-NULL > nfl$Redzone.Efficiency<-NULL
  • 5. PERFORMANCE ANALYSIS NFL 2014 ANALYSIS AND VISUALIZATION Question 1: Win and Loss Comparison In this visualization, we have compared each team’s wins and losses of the season. We can categorize the visualization based on Best, Average and Poor performers.Looking onto the bar chart that we have depicted below it is clear that IND( Indiana )has the highest wins of 14 matches and lost only 5 ,falling under the category of best performer .The average performers of the season based on this comparison are CAR(California), CLE and MIN(Minnepolis) where both win and loss are equal to 8 matches.Also, it is seen that the teams TB (Tampa Bay) and NYJ(New Jersey) has the least number of wins which is only 2 and 4 respectively. Hence these two teams fall under Poor performers.
  • 6. PERFORMANCE ANALYSIS NFL 2014 Parameters Learnt In Class: We have installed two packages Dplyr, Data.table. Using plot_ly we have done side by side bar. Colors' function is used. Question 2: What are the Top 5 best intercepting teams ? In this visualization, we have considered the top 5 interceptions. The term interceptions mean tackling the opponents passes and gaining possession with the ball. As per the pie chart shown below, we can see that the team PHI(Philandalphia) has made the greatest interceptions of 21. Interesting point to note here is that the team TB(Tampa Bay) has the second highest interception percentage of 17.2 ,but has poor performance in the overall season.This indicates that TB though strong in interception couldn’t perform well because of the weak offense team. This states that interception is not an important parameter in achieving success in a season. Parameters Learnt In Class: Using plot_ly we have made a pie chart. Colors' function is used.
  • 7. PERFORMANCE ANALYSIS NFL 2014 Question 3: Which team has the best successful passing coversion ? In this visualization, we have done an analysis on the successful passing conversion percentage of the season.This is done by considering the total passing attempts out of which successful passing completion is done. These values are passed into the function which gives the result of success conversion percentage that is ordered in descending. It can be seen that the team NO(New Orleans) has the highest passing conversion percentage. Even though the passing percentage is high their overall performance is not significant. Whereas Dallas has a passing percentage of 68.8% which bolsters their consistent performance in the season. The top 5 teams in the list except for Dallas are average performers in the season which states that the passing conversion parameter doesn’t have a big impact on the overall performance but still maintaining a good percentage with a decent offence would stand good chances of outperforming the opponents in the season.
  • 8. PERFORMANCE ANALYSIS NFL 2014 Parameters Learnt In Class: Color function, Standard Deviation and Plot_ly for bar chart is used. Then the legend function is also used for displaying legends. Question 4: Weekly Analysis of the performance of the teams In this visualization, we do an analysis on the weekly performance of the teams. This analysis provides the user with the privilege to enter the team name at runtime and view only that particular team’s performance metrics. We have used a median function to represent the median score of the preffered team. We found that the performance of the team ARI (User Preffered) in the first half of the season is above the median scale whereas second half of the season is below the median scale. With this analysis the overall performance of the team can be improved by identifying the period where the team is outperformed, the underlying reason behind it and the means to achieve better performance during this period. Getting input from User Sample. Result Of Input
  • 9. PERFORMANCE ANALYSIS NFL 2014 Parameters Learnt In Class: Median function and Plot_ly for Line Chart.
  • 10. PERFORMANCE ANALYSIS NFL 2014 Question 5: Finding the statistics behind achieving first down by the teams In this visualization, we have analyzed the statistics behind achieving first down by the teams. The parameters taken into account are passing,rushing and penalty. Based on maximum total first down count it is being ordered and plotted in 3D scatter plot.Indiana which is the top team in the season have achieved the maximum first down by rushing and passing having least penalties. We can also note that the team NE (New England Patriots) has even numbers of rushing passing and penalty. Where as BAL has achieved maximum first downs still they weren’t successful in the season because they have achieved maximum first downs by penalties. So from this when compared to penalties the other two parameters such as rushing and passing should the best channel to achieve the first down. This would help the teams in achieving a competitive position in the season.
  • 11. PERFORMANCE ANALYSIS NFL 2014 R CODE Question 1 Script: install.packages('dplyr') library(dplyr) install.packages('data.table') library(data.table)data <- read.csv('NFL.csv') df1 <- data %>% dplyr::group_by(Team,X) %>% summarise ( count = n()); df1 <- data.frame(df1); teamlist <- list(split(df1,df1$X)); loss_df <- data.frame(sapply(teamlist,'[','L')); win_df <- data.frame(sapply(teamlist,'[','W'));
  • 12. PERFORMANCE ANALYSIS NFL 2014 merge_df <- merge(x = loss_df ,y = win_df, by.x = "L.Team",by.y = "W.Team",all = TRUE ); merge_df <- data.frame(merge_df); rowname <- merge_df$L.Team plot_df <- data.frame(merge_df$L.count,merge_df$W.count,merge_df$L.Team); print(plot_df); Teamname <- merge_df$L.Team; p <- plot_ly(plot_df,x = ~Teamname, y = ~merge_df.L.count, type = 'bar', name = 'Lost') %>% add_trace(y = ~merge_df.W.count, name = 'Wins') %>% layout(xaxis = list(title = '', tickangle = -45), yaxis = list(title = 'Win/Loss'), barmode = 'group', title = 'Win and Loss Comparison') print(p) question1.R Question 2 Scrpit: data <- read.csv('NFL.csv') df_1 <- data.frame(data); df3<-group_by(df_1,Team) %>% summarise(total = sum(Interceptions)); total <- df3$total; piechart <- df3[order(-total),]; df4 <- head(piechart);
  • 13. PERFORMANCE ANALYSIS NFL 2014 total <- df4$total; totals <- c('PHI','IND','TB','CHI','JAC','MIN') pie_df <- data.frame(totals,total) rownames(pie_df) <- pie_df$totals piechart1 <- pie_df[,c('total','totals')] p <- plot_ly(data, labels = ~totals, values = ~total, type = 'pie', textposition = 'inside', textinfo = 'label+percent', insidetextfont = list(color = '#FFFFFF'), hoverinfo = 'text', text = ~paste('No of Intercepts =', total), marker = list(colors = colors, line = list(color = '#FFFFFF', width = 1)), showlegend = FALSE) %>% layout(title = 'Top 5 Best Intercepting Team', xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE), yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE)) print(p)
  • 14. PERFORMANCE ANALYSIS NFL 2014 question2.R Question 3 Script: (Standard Deviation) data <- read.csv('NFL.csv') df_1 <- data.frame(data); passing<-group_by(df_1,Team) %>% summarise(total_passing = sum(Passing.Plays)); total_passing <- passing$total_passing; teams <- passing$Team; passing_success <- group_by(df_1,Team) %>% summarise(success_pass = sum(Passing.Completions)); success_pass <- passing_success$success_pass; sd_passing <- sd(success_pass) print('The standard deviation of the Success Passing for the Season is') print(sd_passing ) source('passing_function.R'); success <- passing_function(success_pass,total_passing); linedf <- data.frame(teams, success);
  • 15. PERFORMANCE ANALYSIS NFL 2014 ordered <- linedf[order(-success),]; top5 <- head(ordered); newdf <- data.frame(top5); nme <- newdf$teams; lab <- newdf$success; barplot(newdf$success,main = "Top 6 Passing Conversion Percentage",names = nme, col = c("red","blue","green","yellow","gray","purple"),ylim = c(65,70), xlab = "Teams",ylab = "Passing Percentage", xpd = FALSE); legend("topright", legend = c("No - 69.12", "DAL - 68.82","PIT - 67.27", "WAS - 66.54","MIA - 66.21", "SD - 66.20"), fill = c("red","blue","green","yellow","gray","purple")) Function used – passing_function() passing_function <- function(x,y) { success_pass <- x; total_passing <- y; success_percentage <- ((success_pass/total_passing)*100); return(success_percentage); }
  • 16. PERFORMANCE ANALYSIS NFL 2014 question3.R passing_function.R Question 4 Script: ( Median) team_vect <- data %>% group_by(Team,Week) %>% summarise(points_sum = sum(Points.Scored)); team_df <- data.frame(team_vect); teamlist <- list(split(team_df,team_df$Team)); print("Enter team Name"); teamnme <- scan("",what = "char"); team_df1 <- data.frame(sapply(teamlist, '[',teamnme)); print(team_df1); print("Enter column to be plotted in line"); var <- scan("",what = "char"); forplot <- team_df1[,var];
  • 17. PERFORMANCE ANALYSIS NFL 2014 Weeks <- c(1:16) t <- list(family = "sans serif",size = 14,color = toRGB("grey50")) plot_df <- data.frame(Weeks,forplot) print('The median score of the Team is') print(median(plot_df$forplot)); p <- plot_ly(plot_df, x = ~Weeks, y = ~forplot, type = 'scatter', mode = 'lines', text = ~forplot) %>% layout(title = "Weekly Analysis", showlegend = FALSE) %>% add_markers() %>% add_text(textfont = t, textposition = "top right") print(p) question4.R Question 5 Script: install.packages("scatterplot3d") library(scatterplot3d) df_1 <- data.frame(data); df7<-group_by(df_1,Team) %>% summarise(total_passing = sum(Passing.First.Downs),total_rushing = sum(Rushing.First.Downs),total_penality = sum(Penalty.First.Downs),total = sum(Total.First.Downs)); first_down_df <- data.frame(df7);
  • 18. PERFORMANCE ANALYSIS NFL 2014 count <- table(df7$total_passing,df7$total_rushing); name1 <- df7$Team; total <- first_down_df$total; ordered_value <- first_down_df[order(-total),]; top_ordered <- data.frame(head(ordered_value)); nme <- top_ordered$Team; dfnme <- data.frame(nme); print(dfnme); sp3 <- scatterplot3d(top_ordered$total_passing,top_ordered$total_rushing,top_ordered$total_penality,c olor = "blue",type = 'h',pch = 19, main = "First Down Comparison",xlab = "Total Passing",ylab = "Total Penalty",zlab = "Total Rushing") sp3.coords <- sp3$xyz.convert(top_ordered$total_passing,top_ordered$total_rushing,top_ordered$total_penalit y) text(sp3.coords$x,sp3.coords$y,labels = dfnme$nme ,cex = .85,pos = 4) question5.R