library(tidyverse)
library(openintro)A streak of one would refer to, scoring one continuous shot followed by a miss, while a streak of zero refers to no shots made either in succession or at an overall observation, throughout the 133 observations.
glimpse(kobe_basket)## Rows: 133
## Columns: 6
## $ vs <fct> ORL, ORL, ORL, ORL, ORL, ORL, ORL, ORL, ORL, ORL, ORL, ORL…
## $ game <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ quarter <fct> 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3…
## $ time <fct> 9:47, 9:07, 8:11, 7:41, 7:03, 6:01, 4:07, 0:52, 0:00, 6:35…
## $ description <fct> Kobe Bryant makes 4-foot two point shot, Kobe Bryant misse…
## $ shot <chr> "H", "M", "M", "H", "H", "M", "M", "M", "M", "H", "H", "H"…
kobe_streak <- calc_streak(kobe_basket$shot)Looking at the graph the streak length would vary based on the most likely initial following outcome. In this case, the most common/typical inial length would be a miss/zero. While having a continuous length of 3 shots would be considered the longest basket streak observed.
ggplot(data = kobe_streak, aes( x = length)) + geom_bar()On R, heads came up a total of 19 compares to tails being 81.
coin_outcomes <- c("heads", "tails")
sample(coin_outcomes, size = 1, replace = TRUE)## [1] "tails"
sim_fair_coin <- sample(coin_outcomes, size = 100, replace= TRUE, prob = c (0.2, 0.8))
table(sim_fair_coin)## sim_fair_coin
## heads tails
## 16 84
set.seed(72769) To reflects Kobes results we would require the same sample size, we could also code R similar to excerise 3 to find the likelihood of going on continuous shots if given a 45% chance of success.
shot_outcomes <- c ("H", "M")
sim_basket <- sample(shot_outcomes, size = 133,
replace= TRUE)
shot_outcomes <- calc_streak(sim_basket)
ggplot(data=shot_outcomes, aes(x = length)) + geom_bar()calc_streak(sim_basket)## length
## 1 0
## 2 0
## 3 1
## 4 5
## 5 0
## 6 1
## 7 0
## 8 1
## 9 0
## 10 0
## 11 0
## 12 0
## 13 0
## 14 1
## 15 0
## 16 1
## 17 0
## 18 0
## 19 5
## 20 0
## 21 0
## 22 0
## 23 0
## 24 1
## 25 1
## 26 0
## 27 0
## 28 0
## 29 1
## 30 0
## 31 0
## 32 1
## 33 0
## 34 0
## 35 0
## 36 2
## 37 0
## 38 1
## 39 1
## 40 4
## 41 0
## 42 2
## 43 0
## 44 1
## 45 0
## 46 1
## 47 3
## 48 0
## 49 3
## 50 2
## 51 1
## 52 0
## 53 3
## 54 4
## 55 0
## 56 1
## 57 0
## 58 1
## 59 1
## 60 1
## 61 4
## 62 3
## 63 6
## 64 1
## 65 4
data.frame(sim_basket)## sim_basket
## 1 M
## 2 M
## 3 H
## 4 M
## 5 H
## 6 H
## 7 H
## 8 H
## 9 H
## 10 M
## 11 M
## 12 H
## 13 M
## 14 M
## 15 H
## 16 M
## 17 M
## 18 M
## 19 M
## 20 M
## 21 M
## 22 H
## 23 M
## 24 M
## 25 H
## 26 M
## 27 M
## 28 M
## 29 H
## 30 H
## 31 H
## 32 H
## 33 H
## 34 M
## 35 M
## 36 M
## 37 M
## 38 M
## 39 H
## 40 M
## 41 H
## 42 M
## 43 M
## 44 M
## 45 M
## 46 H
## 47 M
## 48 M
## 49 M
## 50 H
## 51 M
## 52 M
## 53 M
## 54 M
## 55 H
## 56 H
## 57 M
## 58 M
## 59 H
## 60 M
## 61 H
## 62 M
## 63 H
## 64 H
## 65 H
## 66 H
## 67 M
## 68 M
## 69 H
## 70 H
## 71 M
## 72 M
## 73 H
## 74 M
## 75 M
## 76 H
## 77 M
## 78 H
## 79 H
## 80 H
## 81 M
## 82 M
## 83 H
## 84 H
## 85 H
## 86 M
## 87 H
## 88 H
## 89 M
## 90 H
## 91 M
## 92 M
## 93 H
## 94 H
## 95 H
## 96 M
## 97 H
## 98 H
## 99 H
## 100 H
## 101 M
## 102 M
## 103 H
## 104 M
## 105 M
## 106 H
## 107 M
## 108 H
## 109 M
## 110 H
## 111 M
## 112 H
## 113 H
## 114 H
## 115 H
## 116 M
## 117 H
## 118 H
## 119 H
## 120 M
## 121 H
## 122 H
## 123 H
## 124 H
## 125 H
## 126 H
## 127 M
## 128 H
## 129 M
## 130 H
## 131 H
## 132 H
## 133 H
The distribution is much more border compared to Kobe, with the longest streak being up to 4.
ggplot(data=shot_outcomes, aes(x = length)) + geom_bar()Chances are it would see a mix in change but remain fairly similar as small changes could have been through more situational/circumstantial results. The quality of shoots may stay the same but the consistency may be altered slightly based on situations at the time.
Kobes’s distribution compares in terms of how more likely/consistent he is at the very least making it to one streak, while the simulated shooter lacks thats reliability in terms of making it in at least once compared to Kobe. With this in mind, it still would not be significant evidence that the hot hand model fits Kobes shooting pattern, as simply because he’s most reliable/consistent at making at least one time it doesn’t guarantee that after he makes another following shot it would go in. As well as not fitting accurate results and definition of having a hot hand.