2024-04-03

Mean and Standard Deviation of Stats

[1] "Average Games Played"
[1] 45
[1] "Standard Deviation of Games Played"
[1] 26.17843
[1] "Average Goals"
[1] 8.166667
[1] "Standard Deviation of Goals"
[1] 10.42571

Continued Stats

[1] "Average Assists"
[1] 13.76667
[1] "Standard Deviation of Assists"
[1] 14.11207
[1] "Average Points"
[1] 21.93333
[1] "Standard Deviation of Points"
[1] 23.8818

Bar Graph of Players and Points

The graph shows that David Pastrnak is the outlier here as he is more than two standard deviations away from the mean in terms of points.

Scatter Plot of Games Played and Goals

Here, again, David Pastrnak is an outlier in the data as his Goals stat is more than two standard deviations away from the mean.

Graph of Goals Compared to Shots

This graph is meant to display that, in general, more shots equates to more goals.

Math Equations in Latex

[1] "Standard Deviation"

\[ \sigma = \sqrt{\sum(x_i-\bar{x})^2/N} \] \[ \sigma = Population \] \[ x_i = Individual Value \] \[ \bar{x} = Mean \] \[ N = Population Size \]

Latex Code for Variance

[1] "Variance"

\[ S^2 = \frac{\sum(x_i-\bar{x})^2}{n-1} \] \[ S^2 = Sample Variance \] \[ x_i = Individual Value \] \[ \bar{x} = Mean \] \[ n = Observations \]

Code for Bar Graph of Players/Points

Points <- player_stats$P
g <- ggplot(player_stats, aes(x=Player, y = Points, fill = Player)) +
  geom_bar(stat = "identity") +
  theme(axis.text.x = element_text(face = "bold", color = "black",
                                   size = 8, angle = 60, hjust = 0.8))
library(plotly)
ggplotly(g)%>%
  layout(margin = list(l = 150, t = 60)) %>%
  config(g)