Analysis of Player stats in EPL

Introduction

I chose this dataset because I love to play and watch soccer. The English Premier League is the league I watch the most so I thought it would be cool to analyze it.

Dataset

This Specific data set of the EPL includes stats of players nation of origin, Squad Age Matchs Played, Times they played a full 90 min, Goals, Assists, Combined goals and assists, penalty goals, penalty kicks, expected goals, non penalty goals, expected goals and assists, Prog_Car, Prog_Pas, and Prog_Pas_Rec

Findings

In this report, I have provided a descriptive analysis of the given dataset containing information about football players. We explored basic statistics and visualized the data using histograms, scatterplots, bar charts, boxplots, and density plots. These graphs give us insights into player ages, goal-scoring efficiency, assist rates by position, and the distribution of expected goals.

Tab 1

ggplot(df, aes(x = Age)) +
  geom_histogram(binwidth = 1, fill = "darkred", color = "white") +
  labs(title = "Histogram of Player Ages",
       x = "Age",
       y = "Count")

The histogram appears to have a somewhat right-skewed distribution. This means that there are more players in the younger age groups, with the number of players decreasing as age increases. The peak of the histogram, or the age group with the highest frequency of players, seems to be in the range of around 20 to 25 years old. This suggests that there is a significant number of young players in the dataset moreso than older players.

Tab 2

ggplot(df, aes(x = Goals, y = xG)) +
  geom_point(color = "blue") +
  geom_smooth(method = "lm", se = FALSE, color = "red") +
  labs(title = "Scatterplot of Goals vs. Expected Goals (xG)",
       x = "Goals",
       y = "Expected Goals (xG)")

The scatterplot of “Goals vs. Expected Goals (xG)” allows us to see the relationship between the actual number of goals scored by players and their expected goals (xG) in the dataset.This important because for this you can see if a player is excelling beyond expectation or playing subpar. In this scatterplot you can see that most players are meeting expectation in terms of lower goal counts. The outliers are players that are exceptionally good and scoring a lot.

Tab 3

ggplot(df, aes(x = Goals90)) +
  geom_bar(fill = "green", color = "black", alpha = 0.7) +
  labs(title = "Goals per 90 minutes",
       x = "Goals per 90 minutes",
       y = "Count")

The bar chart visualizes the distribution of goals scored per 90 minutes of play by football players in the dataset. eEach bar represents the amount opf players that had a certain amount of goals every game. This bar chart shows that most players are not scoring and very few averaged more than .5 per game. This can show how hard the league is as most players do not average a lot of goals per game.

Tab 4

ggplot(df, aes(x = Pos, y = Asst90, fill = Pos)) +
  geom_boxplot() +
  labs(title = "Boxplot of Assists per 90 minutes by Position",
       x = "Position",
       y = "Assists per 90 minutes")

The boxplot displays the distribution of assists per 90 minutes played by players across different positions. Median Line (Middle): Represents the median value of assists per 90 minutes for each position.Midfielders typically have higher assists have a wider range of variability. Forwards also have high rates of assists but less variability than midfielders. Than shows that midfielders are moving around the pitch more and are more involved in direct play and there for assisting goals.

Tab 5

ggplot(df, aes(x = xG, fill = factor(Pos))) +
  geom_density(alpha = 0.7) +
  labs(title = "Density Plot of Expected Goals (xG)",
       x = "Expected Goals (xG)",
       y = "Density",
       fill = "Position")

The density plot visualizes the distribution of expected goals (xG) across different player positions.Its hard to see but each color represents a different position.The height of the curve at any point indicates the density of xG values for that position. As you can see goalkeepers have the least amount of expected goals. There is a lot of overlap which indicates that a lot of positions have similar expected goals as forwards obviously would have the highest number of expected goals.