{"cells":[{"metadata":{"_kg_hide-input":true,"trusted":true,"_kg_hide-output":true},"cell_type":"code","source":"%%HTML\n<style type=\"text/css\">\n\ndiv.h2 {\n    background-color: darkolivegreen; \n    color: white; \n    padding: 8px; \n    padding-right: 300px; \n    font-size: 20px; \n    max-width: 1500px; \n    margin: auto; \n    margin-top: 50px;\n}\n\n</style>","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true,"_kg_hide-output":true},"cell_type":"code","source":"'''Ignore deprecation and future, and user warnings.'''\nimport warnings as wrn\nwrn.filterwarnings('ignore', category = DeprecationWarning) \nwrn.filterwarnings('ignore', category = FutureWarning) \nwrn.filterwarnings('ignore', category = UserWarning) \n\n'''Import basic modules.'''\nimport pandas as pd\nimport numpy as np\nimport scipy.stats as ss\nimport itertools\nimport statsmodels.api as sm\n\n'''Customize visualization\nSeaborn and matplotlib visualization.'''\nimport matplotlib.pyplot as plt\nimport seaborn as sns \n%matplotlib inline\n\n\n'''Plotly visualization .'''\nimport plotly.offline as py\nfrom plotly.offline import iplot, init_notebook_mode\nimport plotly.graph_objs as go\npy.init_notebook_mode(connected = True) # Required to use plotly offline in jupyter notebook\n\nimport cufflinks as cf #importing plotly and cufflinks in offline mode  \nimport plotly.offline  \ncf.go_offline()  \ncf.set_config_file(offline=False, world_readable=True)\n\n'''Display markdown formatted output like bold, italic bold etc.'''\nfrom IPython.display import Markdown\ndef bold(string):\n    display(Markdown(string))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## <font face=\"Impact\">Is There a Relationship Between The Playing Surface and The Injury And Performance of NFL Athletes: A Statistical Analysis</font>\n#### *VIKAS SINGH* (Master of Science in Economics)\n                                                                        \n![](http://www.kabu-load.net/data/out/103/IMG_1116842.jpg)"},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">  Introduction</div>\nThe National Football League is America's most popular sports league, comprised of 32 franchises that compete each year to win the Super Bowl, the world's biggest annual sporting event. Founded in 1920, the NFL developed the model for the successful modern sports league, including national and international distribution, extensive revenue sharing, competitive excellence, and strong franchises across the country (https://www.kaggle.com/c/nfl-playing-surface-analytics). \n\nFor the past three decades, the sports and medical communities have examined the danger of injury related to the sport of football. One constant issue of focus has been the comparison of injury rates related to playing on grass surfaces with injury rates related to playing on artificial surfaces. The NFL is making changes on and off the field to protect the health and safety of every player in the NFL. The NFL is championing new developments in engineering, biomechanics and material science designed to better protect against injuries in sports and recreation, as well as for the military. The NFL is investing in and supporting preeminent experts and institutions to advance progress in the prevention, diagnosis, and treatment of head injuries (https://www.playsmartplaysafe.com/). \n\n\n*Image Source: Insurance Quotes*\n\n<img src=\"https://www.quotemaster.org/images/10/10ef72afb09aed3e035f49f7b6079b0f.png\" align=\"left\" width=\"400\">"},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\"> Data Information</div>\nThe data provided for analysis are 250 complete player in-game histories from two subsequent NFL regular seasons. Three different files in .csv format are provided, documenting injuries, player-plays, and player movement during plays. This manual describes the specifics of each variable contained within the datasets as well as guidelines on the best approach to processing the information.\n\nThere are three files provided in the dataset, as described below:\n* **Injury Record:** The injury record file in .csv format contains information on 105 lower-limb injuries that occurred during regular season games over the two seasons. Injuries can be linked to specific records in a player history using the PlayerKey, GameID, and PlayKey fields.\n\n* **Play List:** The play list file contains the details for the 267,005 player-plays that make up the dataset. Each play is indexed by PlayerKey, GameID, and PlayKey fields. Details about the game and play include the player’s assigned roster position, stadium type, field type, weather, play type, position for the play, and position group.\n\n* **Player Track Data:** Player level data that describes the location, orientation, speed, and direction of each player during a play recorded at 10 Hz (i.e. 10 observations recorded per second).\n\n(https://www.kaggle.com/c/nfl-playing-surface-analytics/data)"},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Background</div>\nThe past studies has shown that use of artificial turf in American football continues to grow in popularity. Incidence of lower body injury rate is higher on synthetic turf than on natural turf among National Football League (NFL) games (Mack et al., 2018; Loughran et al., 2019).\n\nThe studies also shown that weather is associated with lower\nknee and ankle injury risk in outdoor stadiums (both natural grass and AstroTurf), probably because of reduced shoe-surface traction (Orchard and Powell, 2003)."},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Hypothesis</div>\n**Null Hypothesis:** There is no statistically significant relationship between injuries and playing surface, Temperature, Weather, PlayType, StadiumType, Position.\n\n**Alternative Hypothesis:**There is a statistically significant relationship between injuries and playing surface,Temperature, Weather, PlayType, StadiumType, Position."},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Methodology</div>\nA total 96081 player-plays dataset inclusive were studied to determine associations between body parts injuries, playing surface, weather conditions, Temperature, PlayType, Position, and StadiumType.This study aimed to establish the influence of weather and game conditions on the frequency and nature of the injuries. First, we used exploratory data analysis to explore the data with visualization and graph plots. Second, we calculated the Cramer's V correlation and Pearson correlation to show the relationship between the selected variable, then We used a logistic regression model to validate the  Cramer's V correlation and Pearson correlation."},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"'''Read the dataset from csv file'''\ndf1 = pd.read_csv('../input/nfl-playing-surface-analytics/InjuryRecord.csv')\ndf2 = pd.read_csv('../input/nfl-playing-surface-analytics/PlayList.csv')\ndf3 = pd.read_csv('../input/nfl-playing-surface-analytics/PlayerTrackData.csv')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"'''Merging the dataframes'''\nmerged_df = df1.merge(df2, on = 'PlayerKey', how = 'left')\nmerged_df.columns","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Exploratory Data Analysis</div>\n<span style='font-family:\"Georgia\"'> <span styel=''>This section will explore the data analysis with the help of graphs and plots. It will help us to know more about the data and for further statistical analysis.   "},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">1. Injured Body Part</font>"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = merged_df['BodyPart'].value_counts().reset_index()\nbold('**KNEE AND ANKLE BODY PART IS MOST FREQUENT INJURIRED PART**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df['index'],\n                y = temp_df['BodyPart'],\n                marker = dict(color = 'rgb(255,0,0)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\", width=500, height=500, xaxis = dict(title = 'Injured Body Part'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Injured body part is a dependent varianle for the analysis. The knees and ankles are the most frequently injured body part, while the heel is the least frequent. \n \n*Image Source: Pinkerton Law Firm* \n\n<img src=\"https://chadpinkerton.com/wp-content/uploads/Mueller-Sports-Medicine-Blog-Most-Common-NFL-Injuries-Infographic.gif\" align=\"left\" width=\"400\" >\n"},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">2. Exploration of Surface, Field and Stadium Type</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"def pie_plot(cnt_srs, colors,title):\n    labels=cnt_srs.index\n    values=cnt_srs.values\n    layout = go.Layout(width=500,height=500)\n    trace = go.Pie(labels=labels, \n                   values=values, \n                   title=title, \n                   hoverinfo='percent+value', \n                   textinfo='percent',\n                   textposition='inside',\n                   hole=0.5,\n                   showlegend=True,\n                   marker=dict(colors=colors,\n                               line=dict(color='#000000',\n                                         width=2)))\n    fig = go.Figure(data = trace, layout = layout)\n    return iplot(fig) \n\nbold('**MORE PLAYER GOT INJURIED ON THE SYNTHETIC SURFACE**')\npie_plot(merged_df['Surface'].value_counts(), ['cyan', 'gold'], 'Surface Type')\n\nbold('**MORE GAMES PLAYED ON NATURAL SURFACE**')\npie_plot(merged_df['FieldType'].value_counts(), ['magenta', 'blue'], 'Field Type')\n\n######################################################################################################################################\ntemp_df = merged_df['StadiumType'].value_counts().reset_index()\n\n# create trace1\nbold('**MORE GAMES PLAYED ON OUTDOOR STADIUMS**')\ntrace1 = go.Bar(\n                y = temp_df['index'],\n                x = temp_df['StadiumType'],\n                orientation=\"h\",            \n                marker = dict(color = 'rgb(0,255,0)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\", width=500, height=500, xaxis = dict(title = 'NO. of Game Played'), yaxis = dict(title = 'Stadium Type'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"The above plots show that 150 injuries out of 57 injuries occurred on the synthetic playing surface, and 48 injuries occurred on the natural surface.  The total number of games played on the natural surface is 156,902, which is more than the 110,103 games played on the synthetic surface."},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"bold('**NUMBER OF NFL REGULAR SEASON DAYS MISSED BY INJURY TYPE**')\nplt.rcParams['font.family'] = \"serif\"\nplt.style.use(\"dark_background\")\nf, axes = plt.subplots (2,2, figsize=(15,12))\nax1 = sns.barplot(x ='BodyPart', y='DM_M1',data=df1,ax=axes[0,0], color = 'royalblue',edgecolor= 'black')\nax2 = sns.barplot(x ='BodyPart', y='DM_M7',data=df1,ax=axes[0,1], color = 'royalblue', edgecolor= 'black')\nax3 = sns.barplot(x ='BodyPart', y='DM_M28',data=df1, ax=axes[1,0], color = 'royalblue', edgecolor= 'black')\nax4 = sns.barplot(x ='BodyPart', y='DM_M42',data=df1, ax=axes[1,1], color = 'royalblue', edgecolor= 'black')\nax1.set(xlabel='Body Part',ylabel='1 and More Days Missed ')\nax2.set(xlabel='Body Part',ylabel='7 and More Days Missed')\nax3.set(xlabel='Body Part',ylabel='28 and More Days Missed')\nax4.set(xlabel='Body Part',ylabel='42 and More Days Missed')\n\nplt.subplots_adjust(wspace=0.4, hspace=0.4)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"* It is obverse each player was missing one and more days when they injured.\n* Foot injuries are more serious than other body parts because players are missing 42 days.   \n* For Knee, Ankle, and Toes body part seven and more days are average missing days.    \n "},{"metadata":{},"cell_type":"markdown","source":"## <font face=\"Impact\">3. Postions and Roster Position</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = merged_df['RosterPosition'].value_counts().reset_index()\nbold('**LR AND WR HAVE HIGHEST ROSTER POSTION**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df['index'],\n                y = temp_df['RosterPosition'],\n                marker = dict(color = 'rgb(153,255,153)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\",width=500, height=500, xaxis = dict(title = 'Roster Position'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Roster Position defined as the official manifest of players on the team. In the NFL, teams are allowed to have fifty-three men on their roster, though only forty-six are allowed to be active for any given game. As we know, **Wide receivers**, for the most part, are known as pass catchers and **Linebacker(LB)** – As the name implies, the Linebackers back the defensive line. Depending on the defensive alignment, there are usually three or four on the field."},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = merged_df['Position'].value_counts().reset_index()\nbold('**MORE PLAYER INJURED ON WR, CB, OLB POSITION**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df['index'],\n                y = temp_df['Position'],\n                marker = dict(color = 'rgb(153,255,153)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\",width=500, height=500 , xaxis = dict(title = 'Positions'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"*Image Source: https://www.forwardprogress.online/*\n\n<img src=\"https://i1.wp.com/www.forwardprogress.online/wp-content/uploads/2018/09/football-template-w-key.png?fit=917%2C367&ssl=1\" align=\"left\" width=\"60%\">"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = merged_df['PositionGroup'].value_counts().reset_index()\nbold('**MORE PLAYER INJURED ON DEFENSIVE BACKS POSITION GROUP**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df['index'],\n                y = temp_df['PositionGroup'],\n                marker = dict(color = 'rgb(153,255,153)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\",width=500, height=500, xaxis = dict(title = 'Position Group'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"*Image Source: https://myfootballmentor.com/*\n\n<img src=\"http://myfootballmentor.com/wp-content/uploads/2011/09/football-O-Defense.jpg\" align=\"left\" width=\"60%\">"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"data1 = merged_df[merged_df[\"BodyPart\"] == \"Ankle\"]\ndata2 = merged_df[merged_df[\"BodyPart\"] == \"Knee\"]\ndata3 = merged_df[merged_df[\"BodyPart\"] == \"Toes\"]\ndata4 = merged_df[merged_df[\"BodyPart\"] == \"Foot\"]\ndata5 = merged_df[merged_df[\"BodyPart\"] == \"Heel\"]\n\ntemp_df1 = data1['Position'].value_counts().reset_index()\ntemp_df2 = data2['Position'].value_counts().reset_index()\ntemp_df3 = data3['Position'].value_counts().reset_index()\ntemp_df4 = data4['Position'].value_counts().reset_index()\ntemp_df5 = data5['Position'].value_counts().reset_index()\n\nbold('**INJURY RISK BY POSITION**')\ntrace1 = go.Bar(\n                x = temp_df1['index'],\n                y = temp_df1['Position'],\n                name=\"Ankle\",\n                marker = dict(color = 'rgb(255,5,97)',\n                             line=dict(color='rgb(0,0,0)',width=1.5)))\n \ntrace2 = go.Bar(\n                x = temp_df2['index'],\n                y = temp_df2['Position'],\n                name = \"Knee\",\n                marker = dict(color = 'rgb(136,18,255)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\n\ntrace3 = go.Bar(\n                x = temp_df3['index'],\n                y = temp_df3['Position'],\n                name = \"Toes\",\n                marker = dict(color = 'rgb(162,255,0)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\ntrace4 = go.Bar(\n                x = temp_df4['index'],\n                y = temp_df4['Position'],\n                name = \"Foot\",\n                marker = dict(color = 'rgb(255,173,10)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\ntrace5 = go.Bar(\n                x = temp_df5['index'],\n                y = temp_df5['Position'],\n                name = \"Heel\",\n                marker = dict(color = 'rgb(255,255,255)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\n\nlayout = go.Layout(template= \"plotly_dark\",width=800,height=500, xaxis = dict(title = 'Position'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1, trace2,trace3,trace4,trace5], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"#Idea given by @jpmiller> https://www.kaggle.com/c/nfl-playing-surface-analytics/discussion/122529#701743\nbold('**SHOWING THE RELATION BETWEEN POSITION AND ROSTER POSITION**')\ntemp_df = pd.crosstab(merged_df.Position, merged_df.RosterPosition)\nplt.rcParams['figure.figsize'] = (14,14)\nsns.set_style(\"white\")\nsns.heatmap(temp_df, cmap=\"YlGnBu\", annot=True,fmt='g', cbar=False)\nplt.xlabel('Roster Positon',fontsize = 20)\nplt.ylabel('Position',fontsize = 20)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"bold('**SHOWING THE COMPRAHENSIVE RELATION BETWEEN POSITION AND ROSTER POSITION WITH BODY PART AND SURFACE TYPE**')\ntemp_df = pd.crosstab([merged_df.Position, merged_df.BodyPart], [merged_df.RosterPosition,merged_df.Surface])\nplt.rcParams['figure.figsize'] = (16,16)\nsns.heatmap(temp_df, cmap=\"YlGnBu\", annot=True,fmt='g', cbar=False)\nplt.xlabel('RosterPosition-Surface',fontsize = 15)\nplt.ylabel('Position-Body Part',fontsize = 15)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":" #### <font color=\"blue\">FINDINGS:</font>\n Most players injured on the position are Wide Receivers, Outside Linebackers, and Cornerbacks with the highest number of knee, ankle injuries. \n\nKnee injuries significantly more than ankle injuries on the position Outside Linebackers, Offensive Tackle, Defensive End, Running Back.  \n\nIn conclusion, Wide Receivers is dangerous position with highest injuries risk because the hits can be especially violent with   players going at full speed. Every position in American football is dangerous, but according the data receiver position is probably the most likely to incur catastrophic injuries. "},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">4. Play Type</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"data1 = merged_df[merged_df[\"Surface\"] == \"Synthetic\"]\ndata2 = merged_df[merged_df[\"Surface\"] == \"Natural\"]\n\ntemp_df1 = data1['PlayType'].value_counts().reset_index()\ntemp_df2 = data2['PlayType'].value_counts().reset_index()\n\nbold('**INJURY RISK BY PLAY TYPE AND SURFACE TYPE**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df1['index'],\n                y = temp_df1['PlayType'],\n                name=\"Synthetic\",\n                marker = dict(color = 'cyan',\n                             line=dict(color='rgb(0,0,0)',width=1.5)))\n# create trace2 \ntrace2 = go.Bar(\n                x = temp_df2['index'],\n                y = temp_df2['PlayType'],\n                name = \"Natural\",\n                marker = dict(color = 'gold',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\n\n\nlayout = go.Layout(template= \"plotly_dark\",width=500,height=500, xaxis = dict(title = 'Play Type'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1, trace2], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"data1 = merged_df[merged_df[\"BodyPart\"] == \"Ankle\"]\ndata2 = merged_df[merged_df[\"BodyPart\"] == \"Knee\"]\ndata3 = merged_df[merged_df[\"BodyPart\"] == \"Toes\"]\ndata4 = merged_df[merged_df[\"BodyPart\"] == \"Foot\"]\ndata5 = merged_df[merged_df[\"BodyPart\"] == \"Heel\"]\n\ntemp_df1 = data1['PlayType'].value_counts().reset_index()\ntemp_df2 = data2['PlayType'].value_counts().reset_index()\ntemp_df3 = data3['PlayType'].value_counts().reset_index()\ntemp_df4 = data4['PlayType'].value_counts().reset_index()\ntemp_df5 = data5['PlayType'].value_counts().reset_index()\n\nbold('**INJURY RISK BY PLAY TYPE AND BODY PART**')\ntrace1 = go.Bar(\n                x = temp_df1['index'],\n                y = temp_df1['PlayType'],\n                name=\"Ankle\",\n                marker = dict(color = 'rgb(255,5,97)',\n                             line=dict(color='rgb(0,0,0)',width=1.5)))\n \ntrace2 = go.Bar(\n                x = temp_df2['index'],\n                y = temp_df2['PlayType'],\n                name = \"Knee\",\n                marker = dict(color = 'rgb(136,18,255)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\n\ntrace3 = go.Bar(\n                x = temp_df3['index'],\n                y = temp_df3['PlayType'],\n                name = \"Toes\",\n                marker = dict(color = 'rgb(162,255,0)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\ntrace4 = go.Bar(\n                x = temp_df4['index'],\n                y = temp_df4['PlayType'],\n                name = \"Foot\",\n                marker = dict(color = 'rgb(255,173,10)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\ntrace5 = go.Bar(\n                x = temp_df5['index'],\n                y = temp_df5['PlayType'],\n                name = \"Heel\",\n                marker = dict(color = 'rgb(255,255,255)',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\n\nlayout = go.Layout(template= \"plotly_dark\",width=800,height=500, xaxis = dict(title = 'Play Type'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1, trace2,trace3,trace4,trace5], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Pass play type is a throwing of the ball in the direction that the offensive team is trying to move, towards the defensive team's goal line. According to the above plot players most involved in pass plays appear to be at increased risk for concussions. Pass and Rush play type players are more injured on the synthentic surface compare to the natural surface. while Punt and Kickoff play type player are more more injured on the natural surface."},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">5. Temperature, Weather</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"merged_df.drop(merged_df[merged_df.Temperature == -999].index, inplace = True)\nmerged_df.reset_index(drop = True, inplace = True)\nimport plotly.figure_factory as ff\nbold('**AVERGAE TEMPERATURE DURING THE SEASON IS 61.46 FAHRENHEIT**')\n\nfig = ff.create_distplot([merged_df['Temperature']],['Temp'],bin_size=0.5,colors=['#94F3E4'])\n\nfig.update_layout(template= \"plotly_dark\",width=500, height=500,yaxis = dict(title = 'Density'))\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = merged_df['Weather'].value_counts()[:10].reset_index()\n\nbold('**MOST OF INJURIES IN CLOUDY AND SUNNY WEATHER**')\n# create trace1\ntrace1 = go.Bar(\n                x = temp_df['index'],\n                y = temp_df['Weather'],\n                marker = dict(color = '#F64E8B',\n                              line=dict(color='rgb(0,0,0)',width=1.5)))\nlayout = go.Layout(template= \"plotly_dark\",width=500, height=500 , xaxis = dict(title = 'Weather'), yaxis = dict(title = 'Count'))\nfig = go.Figure(data = [trace1], layout = layout)\nfig.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">6. Speed</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"bold('**AVERAGE SPEED OF THE PLAYERS IN GROUND IS 1.28 YARDS PER SECOND**')\nplt.style.use(\"dark_background\")\nplt.rcParams['figure.figsize'] = (12,10)\nplt.subplot(211)\nsns.kdeplot(df3['s'], shade = True, color = 'cyan', label = \"Speed\")\nplt.axvline(df3['s'].mean(), color='w', linestyle='dashed', linewidth=3)\nmin_ylim, max_ylim = plt.ylim()\nplt.text(df3['s'].mean()*1.1, max_ylim*0.9, 'Mean: {:.2f}'.format(df3['s'].mean()),fontdict={'size':20},color='yellow')\nplt.title('Average Speed', fontsize = 15)\nplt.xlabel('Speed(Yards Per Second)', fontsize = 15)\nplt.ylabel('Density', fontsize = 15)\n\nplt.rcParams['figure.figsize'] = (12,10)\nplt.subplot(212)\nmerged_df2 = df1.merge(df3, on = 'PlayKey', how = 'left')\nmerged_df2 = merged_df2.merge(df2, on = 'PlayKey', how = 'left')\ntemp_df = merged_df2[merged_df2[\"Surface\"]==\"Synthetic\"]\nax = sns.kdeplot(merged_df2['s'].dropna(), shade = True, label=\"Synthetic\", color = 'lime')\ntemp_df = merged_df2[merged_df2[\"Surface\"]==\"Natural\"]\nax = sns.kdeplot(temp_df['s'].dropna(), shade = True, label=\"Natural\", color = 'hotpink')\nplt.title('Speed Of Player By Surface Type', fontsize = 15)\nplt.xlabel('Speed(Yards Per Second)', fontsize = 15)\nplt.ylabel('Density', fontsize = 15)\n\n\nplt.subplots_adjust(hspace = 0.4)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"bold('**KICKOFF NOT RETURNED PLAY TYPE PLAYERS HAVE MORE AVERAGE SPEED COMPARE TO THE OTHER PLAY TYPE PLAYERS**')\ntemp_df = merged_df2[['s', 'PlayType']].groupby('PlayType').apply(lambda x: x.mean())\ntemp_df.sort_values('s', inplace=True)\ntemp_df.reset_index(inplace=True)\n\n# Draw plot\nfig, ax = plt.subplots(figsize=(13,10), dpi= 80)\nax.hlines(y=temp_df.PlayType, xmin=0.2, xmax=4, color='white', alpha=0.7, linewidth=1, linestyles='dashdot')\nax.scatter(y=temp_df.PlayType, x=temp_df.s,  color='yellow')\n\n# Title, Label, Ticks and Ylim\nax.text(3.2, 7.2, \"$yellow \\; dots \\; are \\; the \\: mean$\", fontdict={'size':16}, color='yellow')\n\nax.set_title('Dot Plot for Speed based on Play Type', fontdict={'size':22})\nax.set_xlabel('Speed(Yards Per Second)', fontdict={'size':18})\nax.set_yticks(temp_df.PlayType)\nax.set_yticklabels(temp_df.PlayType, fontdict={'horizontalalignment': 'right'},fontsize=15)\nax.set_xlim(0.2, 4)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-input":true,"trusted":true},"cell_type":"code","source":"bold('**DB AND TE POSITION PLAYERS HAVE MORE AVERAGE SPEED COMPARE TO THE OTHER POSITION PLAYERS**')\ntemp_df = merged_df2[['s', 'Position']].groupby('Position').apply(lambda x: x.mean())\ntemp_df.sort_values('s', inplace=True)\ntemp_df.reset_index(inplace=True)\n\n# Draw plot\nfig, ax = plt.subplots(figsize=(13,10), dpi= 80)\nax.hlines(y=temp_df.Position, xmin=0.2, xmax=4, color='white', alpha=0.7, linewidth=1, linestyles='dashdot')\nax.scatter(y=temp_df.Position, x=temp_df.s,  color='blue')\n\n# Title, Label, Ticks and Ylim\nax.text(3.2, 15, \"$blue \\; dots \\; are \\; the \\: mean$\", fontdict={'size':16}, color='blue')\n\nax.set_title('Dot Plot for Speed based on Position', fontdict={'size':22})\nax.set_xlabel('Speed(Yards Per Second)', fontdict={'size':18})\nax.set_yticks(temp_df.Position)\nax.set_yticklabels(temp_df.Position, fontdict={'horizontalalignment': 'right'},fontsize=15)\nax.set_xlim(0.2, 4)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":" #### <font color=\"blue\">FINDINGS:</font>\nThe average speed of the player on the ground is 1.28 yards per second. When we compare the speed with a different surface, no significant difference is found, but on the synthetic surface, the player can gain top speed.\n    \nDot Plot for Speed based on Position and Play Type shows that DB position and Kick off retured  play type players have more average speed campared to the other player."},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Statistical Analysis</div>\nIn this section, we have selected the variables for the study are body parts injuries, playing surface, weather conditions, Temperature, PlayType, Position, and StadiumType.We calculated the Cramer's V correlation and Pearson correlation to show the relationship between the selected variable, then We used a logistic regression model to validate the  Cramer's V correlation and Pearson correlation."},{"metadata":{"trusted":true},"cell_type":"code","source":"'''Final data for statistical analysis'''\nfinal_df = merged_df[['BodyPart','Surface', 'Temperature', 'Weather', 'PlayType', 'Position','StadiumType']]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"'''Variable Description'''\ndef description(df):\n    summary = pd.DataFrame(df.dtypes,columns=['dtypes'])\n    summary = summary.reset_index()\n    summary['Name'] = summary['index']\n    summary = summary[['Name','dtypes']]\n    summary['Missing'] = df.isnull().sum().values    \n    summary['Uniques'] = df.nunique().values\n    summary['First Value'] = df.iloc[0].values\n    summary['Second Value'] = df.iloc[1].values\n    summary['Third Value'] = df.iloc[2].values\n    return summary\n\ndisplay(description(final_df))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">1. Feature Engineering</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true,"_kg_hide-output":true},"cell_type":"code","source":"'''Imputing Missing Variable'''\nfinal_df.dropna(inplace=True)\nfinal_df.drop(final_df[final_df.PlayType == '0'].index, inplace = True)\nfinal_df.drop(final_df[final_df.Position == 'Missing Data'].index, inplace = True)\nfinal_df.reset_index(drop = True, inplace = True)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true,"_kg_hide-output":true},"cell_type":"code","source":"'''Grouping the StadiumType variable'''\nfinal_df['StadiumType'].replace(['Outdoor', 'Outdoors', 'Cloudy', 'Heinz Field', 'Outdor', 'Ourdoor', 'Outside', 'Outddors', \n                                 'Outdoor Retr Roof-Open', 'Oudoor', 'Bowl'], 'outdoor', inplace=True)\n\nfinal_df['StadiumType'].replace(['Indoors', 'Indoor', 'Indoor, Roof Closed', 'Indoor, Roof Closed',  'Retractable Roof',\n                                 'Retr. Roof-Closed', 'Retr. Roof - Closed', 'Retr. Roof Closed'], 'indoor_closed',inplace=True)\n\n\nfinal_df['StadiumType'].replace(['Indoor, Open Roof', 'Open', 'Retr. Roof-Open', 'Retr. Roof - Open'],'indoor_open',inplace=True)\n\nfinal_df['StadiumType'].replace(['Dome', 'Domed, closed', 'Closed Dome', 'Domed', 'Dome, closed'],'dome_closed',inplace=True)\n\nfinal_df['StadiumType'].replace(['Domed,Open','Domed, open'],'dome_open',inplace=True)\n\n'''Grouping the Weather variable'''\nfinal_df['Weather'].replace(['10% Chance of Rain','30% Chance of Rain', 'Rainy', 'Rain Chance 40%', 'Showers', 'Cloudy, 50% change of rain', \n                             'Rain likely, temps in low 40s.','Cloudy with periods of rain, thunder possible. Winds shifting to WNW, 10-20 mph.',\n                             'Scattered Showers', 'Cloudy, Rain', 'Rain shower', 'Light Rain', 'Rain'], 'rain',inplace=True)\n\nfinal_df['Weather'].replace(['Clear to Partly Cloudy','Party Cloudy', 'Cloudy, chance of rain','Coudy', 'Cloudy and cold', \n                             'Cloudy, fog started developing in 2nd quarter','Partly Clouidy', 'Mostly Coudy', 'Cloudy and Cool',\n                             'cloudy', 'Partly cloudy', 'Overcast', 'Hazy', 'Mostly cloudy', 'Mostly Cloudy',\n                             'Partly Cloudy', 'Cloudy'],'overcast',inplace=True)\n\nfinal_df['Weather'].replace(['Heat Index 95','Sunny, Windy','Partly clear', 'Sunny and clear', 'Sun & clouds', 'Clear and Sunny','Sunny and cold', 'Sunny Skies', \n                             'Clear and Cool', 'Clear and sunny','Sunny, highs to upper 80s', 'Mostly Sunny Skies', 'Cold',\n                             'Clear and warm', 'Sunny and warm', 'Clear and cold', 'Mostly sunny',\n                             'T: 51; H: 55; W: NW 10 mph', 'Clear Skies', 'Clear skies', 'Partly sunny',\n                             'Fair', 'Partly Sunny', 'Mostly Sunny', 'Clear', 'Sunny'],'clear',inplace=True)\n\nfinal_df['Weather'].replace(['Cloudy, light snow accumulating 1-3\"', 'Heavy lake effect snow', 'Snow'],'snow',inplace=True)\n\nfinal_df['Weather'].replace(['N/A Indoor', 'Indoors', 'Indoor', 'N/A (Indoors)', 'Controlled Climate'],'N/A (Indoors)',inplace=True)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_kg_hide-input":true,"_kg_hide-output":true},"cell_type":"code","source":"\"\"\"Encoding catagorical variable\"\"\"\ncat_var = pd.get_dummies(final_df[['Surface', 'Weather', 'PlayType', 'Position',\n       'StadiumType']], drop_first=True, dtype=float)\n\n\"\"\"Standardizing the numerical variable\"\"\"\nnum_var = final_df['Temperature']\nfrom sklearn.preprocessing import StandardScaler\nscaler = StandardScaler()\nnum_var_scaled = scaler.fit_transform(num_var.values.reshape(-1, 1))\nnum_var_scaled = pd.DataFrame(data = num_var_scaled, columns = ['Temperature'])\n\n\"\"\"Joining encoded cat_var and scaled num_var\"\"\"\nfinal_df_processed = pd.concat([num_var_scaled, cat_var], axis=1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"'''Preview processed data'''\nfinal_df_processed.sample(7)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"\"\"\"Define the output and input variable\"\"\"\ntarget = pd.get_dummies(final_df['BodyPart'], dtype=float)\n\nx = final_df_processed\ny1= target['Ankle']\ny2 = target['Knee']\ny3 = target['Heel']\ny4 = target['Foot']\ny5 = target['Toes']","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"\"\"\"Let's have a final look at data dimension\"\"\"\nprint('Input matrix dimension:', x.shape)\nprint('Output matrix dimension:', y1.shape)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">2. Correlation</font> "},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"# source: https://www.kaggle.com/phaethonprime/eda-and-logistic-regression\ndef cramers_corrected_stat(confusion_matrix):\n    \"\"\" calculate Cramers V statistic for categorical-categorical association.\n        uses correction from Bergsma and Wicher, \n        Journal of the Korean Statistical Society 42 (2013): 323-328\n    \"\"\"\n    chi2 = ss.chi2_contingency(confusion_matrix)[0]\n    n = confusion_matrix.sum().sum()\n    phi2 = chi2/n\n    r,k = confusion_matrix.shape\n    phi2corr = max(0, phi2 - ((k-1)*(r-1))/(n-1))    \n    rcorr = r - ((r-1)**2)/(n-1)\n    kcorr = k - ((k-1)**2)/(n-1)\n    return np.sqrt(phi2corr / min( (kcorr-1), (rcorr-1)))\n\ncols = [ 'BodyPart','Surface', 'Temperature', 'Weather', 'PlayType', 'Position','StadiumType']\ncorrM = np.zeros((len(cols),len(cols)))\n# there's probably a nice pandas way to do this\nfor col1, col2 in itertools.combinations(cols, 2):\n    idx1, idx2 = cols.index(col1), cols.index(col2)\n    corrM[idx1, idx2] = cramers_corrected_stat(pd.crosstab(merged_df[col1], merged_df[col2]))\n    corrM[idx2, idx1] = corrM[idx1, idx2]\n\ncorr = pd.DataFrame(corrM, index=cols, columns=cols)\nsns.set_style(\"white\")\nplt.rcParams['figure.figsize'] = (12,10)\nmask = np.zeros_like(corr, dtype=np.bool)\nmask[np.triu_indices_from(mask)] = True\nsns.heatmap(corr, mask=mask, cmap = 'RdYlGn', square=True, linewidths=.5,annot=True)\nplt.title(\"Cramer V Correlation between Categorical Variables\",fontsize=20)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"In statistics, Cramér's V (sometimes referred to as Cramér's phi and denoted as φc) is a measure of association between two nominal variables, giving a value between 0 and +1 (inclusive). It is based on Pearson's chi-squared statistic and was published by Harald Cramér in 1946 (*Mathematical Methods of Statistics*, Cramér, 1946). Above Cramer's V correlation plot based on the categorical data without any encoding indicates the **weak association** between the selected variable. Temperature and Weather are showing **moderate association** at 0.49. When we compare our dependent variable (BodyPart) with other independent variables only PlayType is showing **no association** but other variables are showing weak association."},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = pd.concat([final_df[['Surface', 'Weather', 'PlayType', 'Position',\n       'StadiumType','Temperature']],target],axis=1)\ncols = [ 'Ankle','Foot','Heel','Knee','Toes','Surface', 'Temperature', 'Weather', 'PlayType', 'Position','StadiumType']\ncorrM = np.zeros((len(cols),len(cols)))\n# there's probably a nice pandas way to do this\nfor col1, col2 in itertools.combinations(cols, 2):\n    idx1, idx2 = cols.index(col1), cols.index(col2)\n    corrM[idx1, idx2] = cramers_corrected_stat(pd.crosstab(temp_df[col1], temp_df[col2]))\n    corrM[idx2, idx1] = corrM[idx1, idx2]\n\ncorr = pd.DataFrame(corrM, index=cols, columns=cols)\nplt.rcParams['figure.figsize'] = (12,10)\nmask = np.zeros_like(corr, dtype=np.bool)\nmask[np.triu_indices_from(mask)] = True\nsns.heatmap(corr, mask=mask, cmap=\"YlGnBu\",square=True, linewidths=.5, annot=True)\nplt.title(\"Cramer V Correlation between Independent Categorical and Dependent Dummy Variables\",fontsize=15)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Now, this plot showing some interesting results, here we encoded the dependent variable (BodyPart) into dummy variables. \n* Strong Association:\n   * Between Temp. and weather at 0.71\n   * Between Ankel and Knee at 0.74\n* Moderate Association:\n   * Between Temp. and Stadium type at 0.5\n   * Between Position and Ankle, Foot at 0.46\n* Weak Association:\n   * Between Position and Knee, Toes, Surface\n   * Between Suface and Ankle and Knee\n\nThere are many other variables have a weak association with dependent variables. Some of the independent variables have no association with dependent variables.      \n"},{"metadata":{"trusted":true,"_kg_hide-input":true},"cell_type":"code","source":"temp_df = pd.concat([x,target],axis=1)\ncorr = temp_df.corr()\nsns.set_style(\"white\")\nplt.rcParams['figure.figsize'] = (20,15)\nmask = np.zeros_like(corr, dtype=np.bool)\nmask[np.triu_indices_from(mask)] = True\nsns.heatmap(corr, mask=mask, cmap='plasma_r',linewidths=.5, vmin=0, vmax=1)\nplt.title(\"Pearson Correlation between Dummy Variables\", fontsize=25)\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"Here, we applied dummy on all the variables than calculated pearson correlation. In statistics, the Pearson correlation coefficient (PCC, pronounced /ˈpɪərsən/), also referred to as Pearson's r, the Pearson product-moment correlation coefficient (PPMCC) or the bivariate correlation, is a measure of the linear correlation between two variables X and Y (*SPSS Tutorials: Pearson Correlation*). It has a value between +1 and −1, where 1 is total positive linear correlation, 0 is no linear correlation, and −1 is total negative linear correlation but in the above plot we ignore the negative value because negative correlation between categorical variable make no sense. \n\nWe can observe that dark color in the plot is showing some correlation between the variables are: \n* Between Temp. and StadiumType_indoor_open, StadiumType_indoor_close, weather_clear\n* Between Ankle and Weather_clear, surface_synthtic, PlayType_pass, StadiumType_outdoor, Position_CB, FS, MLB, WR\n* Between Foot and Weather_clear, Position_DE,T,TE\n* Between Heel and Weather_clear, Weather_show, PlayType_Kickoff, Punt_not_returned,Puntoff_returned, Position_CB\n* Between Kee and Weather_overcast, PlayType_Kickoff, PlayTpe_Punt, Position_DB,DT,ILB, RB,T\n* Between Toes and surface_synthtic, Weather_show, Position_DT, FS, RB, SS"},{"metadata":{},"cell_type":"markdown","source":"<div class=\"alert alert-info\" style=\"margin: 20px\">\"Making the study simple and limited only interprets the two dependent variables Ankle and Knee.\"</div>"},{"metadata":{},"cell_type":"markdown","source":"### <font face=\"Impact\">3. Performing the regression</font> "},{"metadata":{"trusted":true},"cell_type":"code","source":"x1 = sm.add_constant(x)\nnfl_log = sm.Logit(y1,x1)\nresult1 = nfl_log.fit()\nbold('**Logit Regression Results**')\nprint(result1.summary2())\nbold('**Odds Ratios**')\nprint(np.exp(result1.params))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"<font color=\"green\">P-value will allow you to test your null hypothesis. A low p-value (less than 0.05) indicates that you can reject the null hypothesis.</font>\n\n### Interpreting the results (Ankle)\n\nDuring the season, there was a total of 39,382 Ankle injuries. The graphs show that injuries rate on the Synthetic surface is more than the natural surface. The  Logit summary showing some interesting results. **The P-value (P>|z|) of Temperature, PlayType_Field Goal, Position_S have is more than 0.5,** therefore, we accept the null hypothesis that means there is no relationship between Ankle injuries and Temperature, PlayType_Field Goal, Position_S.\n\nTake the exponential of each of the coefficients to generate the odds ratios. This tells you how a 1 unit increase or decrease in a variable affects the odds of being injuried. There is a direct relationship between the coefficients produced by logit and the odds ratios produced by logistic. First, let’s define what is meant by a logit: A logit is defined as the log base e (log) of the odds (https://stats.idre.ucla.edu/). **In our particular example, Surface_Synthetic = 2.105684e+00 which implies that the odds of  Ankle injuries on the synthetic surface is 2.10 times that of natural surface.**\n\n"},{"metadata":{"trusted":true},"cell_type":"code","source":"x1 = sm.add_constant(x)\nnfl_log = sm.Logit(y2,x1)\nresult2 = nfl_log.fit()\nbold('**Logit Regression Results**')\nprint(result2.summary2())\nbold('**Odds Ratios**')\nprint(np.exp(result2.params))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"### Interpreting the results (Knee)\nDuring the season, there was a total of 35,330 Ankle injuries. The graphs show that injuries rate on the Synthetic surface is more than the natural surface. The  Logit summary showing some interesting results. **The P-value (P>|z|) of Temperature, Surface_Synthetic, Weather, PlayType_Kickoff, PlayType_Kickoff Not Returned, PlayType_Kickoff Returned, Stadium, have is less than 0.5,** therefore, we reject the null hypothesis that means there is relationship between knee injuries and Temperature, Surface_Synthetic, Weather, PlayType_Kickoff, PlayType_Kickoff Not Returned, PlayType_Kickoff Returned, Stadium. The P-value (P>|z|) of Positions have is more than 0.5,therefore, we accept the null hypothesis that means there is no relationship between knee injuries and Position.\n\n**Odd Ratio: Surface_Synthetic = 4.788044e-01 which implies that the odds of  Knee injuries on the synthetic surface is 4.78 times that of natural surface.** That means odd of Ankle injuries on the synthetic surface is less than Knee injuries"},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Conclusion</div>\nWe found statistically relationship between injuries of Ankle, Knee and the selected variables. We did not find the statistically relationship between Knee injuries and Positions. Our findings add to the growing body of evidence that playing on artificial turf surfaces is associated with increased rates of specific knee injuries.\n\nDue to the study is limited to an analysis, We recognized the importance of understanding other possible contributing factors and the mechanics of a particular injury and did not draw any conclusions related to the cause of the injuries analyzed."},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Acknowledgment</div>\nI express my sincere appreciation to the Kaggle team and the NFL for giving us the great opportunity to work on this project through this competition. Besides, thanks to the all Kaggle community for their contributions. "},{"metadata":{},"cell_type":"markdown","source":"<a id='bg'></a>\n<div class=\"h2\">Bibliography</div>\n\n* Lee, A. J., & Garraway, W. M. (2000). The influence of environmental factors on rugby football injuries. Journal of sports sciences, 18(2), 91-95.\n* Orchard, J. W., & Powell, J. W. (2003). Risk of knee and ankle sprains under various weather conditions in American football. Medicine & Science in Sports & Exercise, 35(7), 1118-1123.\n* Hershman, E. B., Anderson, R., Bergfeld, J. A., Bradley, J. P., Coughlin, M. J., Johnson, R. J., ... & National Football League Injury and Safety Panel. (2012). An analysis of specific lower extremity injury rates on grass and FieldTurf playing surfaces in National Football League Games: 2000-2009 seasons. The American journal of sports medicine, 40(10), 2200-2205.\n* https://stats.idre.ucla.edu/\n* https://www.playsmartplaysafe.com/"}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":1}