hockey <- read.delim("../Data/Hockey.txt", header=TRUE, sep="\t")
tmp <- strsplit(as.character(hockey$HT), "-")
tmp2 <- sapply(tmp, function(x) as.numeric(x[1])*12+as.numeric(x[2]))
hockey$height <- tmp2
I have been a fanatic of hockey since growing up with it, attending many games. Something really important to do in hockey is to make shots, even if they don’t always successfully enter the net. In fact, this a very big debate in hockey if the amount of shots have anything important to say about the players’ abilities, or if there is some sort of quality about the shots that need to be measured. This Sports Illustrated article has many insights regarding the matter.
There are a variety of classifications of shots that can be made in hockey; however, I specifically chose to do an analysis, studying the amount of shots on goal (one of those classifications of shots made) with the amount of goals successfully made.
Defined by the NHL(National Hockey League): “If a player shoots the puck with the intention of scoring and if that shot would have gone in the net had the goaltender not stopped it, the shot is recorded as a”shot on goal“.
To give a further understanding and explanation, the shot must be on target. If a shot goes over the net, to the side of the net, hits a goal bar or player other than the goalie blocks the shot, then the shot is not considered to be a shot on goal. However, if the shot his a bar, which then hits the goalie and goes into the net, then it is considered a shot on goal.
My question is: “Is there a linear relationship between the amount of shots on goal made and the actual amount of goals made?”
For my investigation, I put together statistics from espn.com using four teams, one from the east coast (Washington), and three from the west coast (Anaheim, Las Vegas, San Jose)
datatable(HockeyStats2018[,c(1,2,3,13,4,5,6,7,8,9,10,11,12,14,15)], options=list(lengthMenu = c(10,10,30)),
extensions = "Responsive")
Specifically from the table, the relationship between “G” and “SOG” are being compared. Please note that this data is taken from the regular season, not including the post-season.
Using a scatterplot, the relationship between shots on goal and goals can be analyzed.
plot(G ~ SOG, data = HockeyStats2018, ylim=c(0, 50), xlim=c(0, 350), main="Relationship between SOG and G", ylab="Succesful Goal Attempts", xlab="Shots On Goal")
Hockey.lm <- lm(G ~ SOG, data=HockeyStats2018)
abline(Hockey.lm)
The Hypotheses to determine the relationship between goals and shots on goal are:
\[ H_0: ß_1 = 0 \] \[ H_a: ß_1 \neq 0 \] With a level of significance of α = .05
B_1 represents the slope in the following equation.
\[ \underbrace{Y_i}_{\text{Goals}} = ß_0 + ß_i \underbrace{x_i}_{\text{Goal based on shots on goal}} + ε_i \]
The equation of the line is based off of the following information:
HockeyStats2018.lm <-lm(G ~ SOG, data = HockeyStats2018)
pander(summary(HockeyStats2018.lm))
| Estimate | Std. Error | t value | Pr(>|t|) | |
|---|---|---|---|---|
| (Intercept) | -0.7087 | 0.6878 | -1.03 | 0.3049 |
| SOG | 0.1063 | 0.006162 | 17.26 | 2.019e-34 |
| Observations | Residual Std. Error | \(R^2\) | Adjusted \(R^2\) |
|---|---|---|---|
| 123 | 5.08 | 0.7111 | 0.7087 |
\[ Y_i = 12.926 + 2.607X_i \] With the p-value = 2.2 x 10^-16. The p-value < .05. This means that the relationship of the two variable is significant.
From the graph, it can be analyzed that the relationship between the shots of goal and successful goals is important; however there is room to question the validity of this.
To help answer those questions of validity, more graphs are provided.
par(mfrow=c(1,2))
plot(Hockey.lm, which=1:2)
par(mfrow = c(1,1)) #This resets your plotting window for future plots.
plot(HockeyStats2018.lm$residuals, main="Residuals vs Order", xlab="",
ylab="Residuals")
In the Residuals vs. Fitted plot, constant variance is questionable as patterns can be seen by it. The normally on the Q-Q Plot shows that it may not be from a normal distribution. In the Residual Vs. Order graph, there should be no trend so that the observations can be determined to be independent or not. The independence appears to be questionable.
There is sufficient evidence to reject the null hypothesis, due to such a significant value of the p-value. There is sufficient evidence to accept the alternative hypothesis that there is a linear relationship between the amount of shots of goal and the amount of successful goal attempts. From my interpretation of the graphs and the validity of the data, the more shots of goal a player makes does correlate to a higher yield of goals made.
From the model, the coefficient \(\beta\) = 2.607 means that every one goal attempt, the amount of shots on goal increases by 2.607 times.
There can still be more room for interpretation to do the fact that not all goal attempts are counted as shots on goal, such as those blocked by a non-goalie player. The quality of the shots attempted and made is another important aspect that should be studied to help create a more concrete understanding of the relationship between shots on goal and goals successfully made.
embed_url("https://www.youtube.com/watch?v=LMlaDJXDipg")