The research question I settled on was: What factors are associated with higher offensive production among NHL skaters? I am a big hockey fan and wanted to explore offensive and scoring trends in the league from the 2024-25 NHL season. My objective was to use descriptive statistics and visualizations to determine the relationships between specific metrics and offensive production. My objective for each visualization is as follows:
Identify the NHL skaters with the highest total point production.
Examine how offensive points are distributed across NHL players.
Explore the relationship between shots on goal and goals scored.
Compare points per game between forwards and defensemen.
Investigate the relationship between average time on ice per game and points per game.
Professional hockey generates a large amount of statistical data, but individual statistics do not always tell the full story of a player’s offensive performance. Factors such as games played, ice time, and player position can influence how players compare.
Understanding these factors can benefit NHL teams evaluating talent and player performance, analysts looking for trends, and sports bettors researching player-specific betting markets. By examining statistics such as goals, assists, shots on goal, points per game, and time on ice, this project explores which metrics are associated with higher offensive production.
Using visual analytics, this project aims to uncover patterns and relationships that may not be immediately obvious from traditional statistics. While these relationships cannot guarantee future performance, they can provide useful insights for evaluating NHL players.
The data used in this project was collected using the
fastRhockey R package, which provides access to NHL
statistics. The dataset contains player-level statistics from the
2024–25 NHL season. To focus on regular-season performance, games dated
after April 17, 2025, were excluded.
The original dataset contained individual game statistics, which were cleaned and aggregated into one record per player. Statistics such as goals, assists, points, shots on goal, and time on ice were combined across games. Additional metrics, including points per game and average time on ice per game, were calculated to allow for more meaningful comparisons between players.
The final dataset contained 920 players and 20 variables. RStudio and
the ggplot2 package were used to explore the data and
create visualizations examining scoring rankings, statistical
distributions, relationships between performance metrics, and
differences between player positions.
This visualization simply shows the highest point-earning players during the 2024-25 season. It provides us with a benchmark for comparing offensive production that we are measuring all players against in this entire study.
# Select the top 20 players by total points
top_20_points <- nhl_project %>%
slice_max(order_by = points, n = 20, with_ties = FALSE)
# Create the bar chart
plot_top20 <- ggplot(
top_20_points,
aes(x = reorder(player_name, points), y = points)
) +
geom_col() +
coord_flip() +
labs(
title = "Top 20 NHL Skaters by Total Points",
subtitle = "2024–25 Regular Season",
x = NULL,
y = "Total Points",
caption = "Source: fastRhockey, NHL skater game data"
) +
theme_minimal()
print(plot_top20)
This graph shows the distribution of total points across all NHL skaters during the 2024–25 season. Unlike the previous graph, which focused on the top 20 players, this visualization provides a broader look at offensive production throughout the league. The distribution is heavily skewed to the right, meaning that most players scored a relatively low number of points, while a smaller group of players recorded much higher totals. This highlights how offensive production is concentrated among a relatively small number of NHL players.
# Create a histogram showing the distribution of points
plot_distribution <- ggplot(nhl_project, aes(x = points)) +
geom_histogram(
binwidth = 5,
fill = "steelblue",
color = "white"
) +
labs(
title = "Distribution of NHL Skater Points",
subtitle = "2024–25 Regular Season",
x = "Total Points",
y = "Number of Players",
caption = "Source: fastRhockey, NHL skater game data"
) +
theme_minimal()
print(plot_distribution)
The relationship between shots on goal and goals scored was strongly positive, with a correlation of approximately 0.882. This suggests that players who generate more shots generally score more goals. However, this relationship does not necessarily mean that taking more shots directly causes higher scoring, since players who play more games also have more opportunities to shoot.
# Create a scatterplot showing shots on goal vs. goals
plot_shots_goals <- ggplot(
nhl_project,
aes(x = shots_on_goal, y = goals)
) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", se = TRUE) +
labs(
title = "Relationship Between Shots on Goal and Goals",
subtitle = "2024–25 Regular Season",
x = "Shots on Goal",
y = "Total Goals",
caption = "Source: fastRhockey, NHL skater game data"
) +
theme_minimal()
print(plot_shots_goals)
## `geom_smooth()` using formula = 'y ~ x'
This chart compares points per game between forwards and defensemen during the 2024–25 NHL season. Forwards averaged approximately 0.411 points per game, compared to 0.278 for defensemen, showing higher offensive production among forwards. However, the overlap between the distributions shows that some defensemen produce at levels comparable to forwards.
# Compare points per game between forwards and defensemen
plot_position <- ggplot(
nhl_project,
aes(x = position, y = points_per_game, fill = position)
) +
geom_violin(alpha = 0.65, trim = FALSE, color = NA) +
geom_boxplot(width = 0.15, fill = "white", outlier.shape = NA) +
geom_jitter(width = 0.08, alpha = 0.15, size = 1) +
scale_fill_manual(
values = c("Defenseman" = "steelblue", "Forward" = "darkorange")
) +
labs(
title = "Offensive Production by Player Position",
subtitle = "Points per game, 2024–25 Regular Season",
x = "Player Position",
y = "Points Per Game",
caption = "Source: fastRhockey, NHL skater game data"
) +
theme_minimal() +
theme(
legend.position = "none",
plot.title = element_text(face = "bold"),
panel.grid.minor = element_blank()
)
print(plot_position)
The relationship between average time on ice and points per game was moderately positive, with a correlation of approximately 0.581. Players who receive more ice time generally produce more points per game, although there is considerable variation. Ice time alone does not determine offensive production.
# Examine the relationship between ice time and points per game
plot_toi_points <- ggplot(
nhl_project,
aes(x = toi_minutes_per_game, y = points_per_game)
) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", se = TRUE) +
labs(
title = "Time on Ice vs. Offensive Production",
subtitle = "2024–25 Regular Season",
x = "Average Time on Ice per Game (Minutes)",
y = "Points Per Game",
caption = "Source: fastRhockey, NHL skater game data"
) +
theme_minimal()
print(plot_toi_points)
## `geom_smooth()` using formula = 'y ~ x'
This project explored the factors associated with offensive production among NHL skaters during the 2024–25 season. Through data visualization, several patterns emerged, including a strong relationship between shots on goal and goals scored, higher average points per game among forwards compared to defensemen, and a positive relationship between time on ice and offensive production. The analysis also showed that point production is heavily concentrated among a relatively small group of players.
These findings demonstrate how visual analytics can provide a deeper understanding of player performance beyond traditional statistics. The results could be useful to NHL teams evaluating players, analysts identifying performance trends, and sports bettors researching player statistics. While these relationships do not guarantee future performance, they provide a foundation for more informed evaluations and further exploration of hockey analytics.
ChatGPT was used for code generation for the data filtering and cleaning at the beginning of the process. It was also used to identify related works and inform me on what I could build that was similar yet different to existing models. It was also used for debugging support and grammar and structure checks.