Basketball players who make several baskets in succession are described as having a hot hand. Fans and players have long believed in the hot hand phenomenon, which refutes the assumption that each shot is independent of the next. However, a 1985 paper by Gilovich, Vallone, and Tversky collected evidence that contradicted this belief and showed that successive shots are independent events. This paper started a great controversy that continues to this day, as you can see by Googling hot hand basketball.
We do not expect to resolve this controversy today. However, in this lab we’ll apply one approach to answering questions like this. The goals for this lab are to (1) think about the effects of independent and dependent events, (2) learn how to simulate shooting streaks in JASP, and (3) to compare a simulation to actual data in order to determine if the hot hand phenomenon appears to be real.
In this lab, we’re going to use some code written in the language R
, which JASP is built on. You won’t be editing the code directly, but we’ll need to add a module to be able to run R code directly in JASP. Click the plus button add check the R (Beta)
button to add the R option to the top menu.
Your investigation will focus on the performance of one player: Kobe Bryant of the Los Angeles Lakers. His performance against the Orlando Magic in the 2009 NBA Finals earned him the title Most Valuable Player and many spectators commented on how he appeared to show a hot hand.
The data file we’ll use is called kobe_basket
, and you can find it data.
This data frame contains 133 observations and 6 variables, where every row records a shot taken by Kobe Bryant. The shot
variable in this dataset indicates whether the shot was a hit (H
) or a miss (M
).
Just looking at the string of hits and misses, it can be difficult to gauge whether or not it seems like Kobe was shooting with a hot hand. One way we can approach this is by considering the belief that hot hand shooters tend to go on shooting streaks. For this lab, we define the length of a shooting streak to be the number of consecutive baskets made until a miss occurs.
For example, in Game 1 Kobe had the following sequence of hits and misses from his nine shot attempts in the first quarter:
\[ \textrm{H M | M | H H M | M | M | M} \]
You can verify this by viewing the first 9 rows of the data in the data viewer.
Within the nine shot attempts, there are six streaks, which are separated by a “|” above. Their lengths are one, zero, two, zero, zero, zero (in order of occurrence).
Counting streak lengths manually for all 133 shots would get tedious, so we’ll use some R code to calculate the lengths of streaks for us. First, click the R (Beta)
icon, and copy the code below into the bottom box:
calc_streak <- function(x){
y <- rep(0,length(x))
y[x == "H"] <- 1
y <- c(0, y, 0)
wz <- which(y == 0)
streak <- diff(wz) - 1
return(streak)
}
Then click Run Code
. You won’t see anything happen other than the code move into the box above it, but the computer now knows how to calculate streak lengths. To calculate the actual streak lengths, copy the following text into the bottom box and click Run Code
.
You will see a list of all the streak lengths from the data set. Note that you’ll likely see a number in brackets show up (like [39]
) - this isn’t an actual streak length, it’s just indicating the 39th value in the list so you can keep track.
You can find some summary information on the streak lengths using the code:
We’ve shown that Kobe had some long shooting streaks, but are they long enough to support the belief that he had a hot hand? What can we compare them to?
To answer these questions, let’s return to the idea of independence. Two processes are independent if the outcome of one process doesn’t effect the outcome of the second. If each shot that a player takes is an independent process, having made or missed your first shot will not affect the probability that you will make or miss your second shot.
A shooter with a hot hand will have shots that are not independent of one another. Specifically, if the shooter makes his first shot, the hot hand model says he will have a higher probability of making his second shot.
Let’s suppose for a moment that the hot hand model is valid for Kobe. During his career, the percentage of time Kobe makes a basket (i.e. his shooting percentage) is about 45%, or in probability notation,
\[ P(\textrm{shot 1 = H}) = 0.45 \]
If he makes the first shot and has a hot hand (not independent shots), then the probability that he makes his second shot would go up to, let’s say, 60%,
\[ P(\textrm{shot 2 = H} \, | \, \textrm{shot 1 = H}) = 0.60 \]
As a result of these increased probabilities, you’d expect Kobe to have longer streaks. Compare this to the skeptical perspective where Kobe does not have a hot hand, where each shot is independent of the next. If he hit his first shot, the probability that he makes the second is still 0.45.
\[ P(\textrm{shot 2 = H} \, | \, \textrm{shot 1 = H}) = 0.45 \]
In other words, making the first shot did nothing to effect the probability that he’d make his second shot. If Kobe’s shots are independent, then he’d have the same probability of hitting every shot regardless of his past shots: 45%.
Now that we’ve phrased the situation in terms of independent shots, let’s return to the question: how do we tell if Kobe’s shooting streaks are long enough to indicate that he has a hot hand? We can compare his streak lengths to someone without a hot hand: an independent shooter.
While we don’t have any data from a shooter we know to have independent shots, that sort of data is very easy to simulate in JASP. In a simulation, you set the ground rules of a random process and then the computer uses random numbers to generate an outcome that adheres to those rules.
As a simple example, you can simulate flipping a fair coin. Open the Distributions
menu, then select Bernoulli
in Discrete. Open the Generate and Display Data
section, and name the new variable sim_coin
. Leave the number of samples as 133 to match our sample size, and click Draw samples
, then return to your data.
Each entry in sim_coin
can be thought of as a hat with two slips of paper in it: one slip says heads
(1) and the other says tails
(0). Each entry draws one slip from the hat and tells us if it was a head or a tail.
Just like when flipping a coin, sometimes you’ll get a heads, sometimes you’ll get a tails, but in the long run, you’d expect to get roughly equal numbers of each.
Create a table using the Descriptives
analysis to determine how many 0’s and how many 1’s there are in your simulation.
We used the default probability that when we “flip” a coin and it lands heads is 0.5. Say we’re trying to simulate an unfair coin that we know only lands heads 20% of the time. We can adjust for this by changing the Probability of success
value in the Bernoulli distribution to 0.2. Do this, and generate a new variable called sim_unfair_coin
and create a table of its counts.
Another way of thinking about this is to think of the outcome space as a bag of 10 chips, where 2 chips are labeled “head” and 8 chips “tail”. Therefore at each draw, the probability of drawing a chip that says “head”" is 20%, and “tail” is 80%.
In a sense, we’ve shrunken the size of the slip of paper that says “heads”, making it less likely to be drawn, and we’ve increased the size of the slip of paper saying “tails”, making it more likely to be drawn. When you simulated the fair coin, both slips of paper were the same size.
Simulating a basketball player who has independent shots uses the same mechanism that you used to simulate a coin flip.
To make a valid comparison between Kobe and your simulated independent shooter, you need to align both their shooting percentage and the number of attempted shots.
sim_basket_01
.Now we will convert the values which are in 0’s and 1’s to be in M’s and H’s to match our original data. Create a new “Computed Column” which is a nominal variable, name it sim_basket
using the formula ifElse(sim_basket_01=1,H,M)
.
Now, return to the R window. To calculate the streak lengths for our new variable, use the code:
to see all the streak lengths and
to see the summary.
You now have the data necessary to compare Kobe to our independent shooter.
Both data sets represent the results of 133 shot attempts, each with the same shooting percentage of 45%. We know that our simulated data is from a shooter that has independent shots. That is, we know the simulated shooter does not have a hot hand.
Using calc_streak
, compute the streak lengths of sim_basket
.
Describe the distribution of streak lengths. What is the typical streak length for this simulated independent shooter with a 45% shooting percentage? How long is the player’s longest streak of baskets in 133 shots?
If you were to run the simulation of the independent shooter a second time, how would you expect its streak distribution to compare to the distribution from the question above? Exactly the same? Somewhat similar? Totally different? Explain your reasoning.
How does Kobe Bryant’s distribution of streak lengths compare to the distribution of streak lengths for the simulated shooter? Using this comparison, do you have evidence that the hot hand model fits Kobe’s shooting patterns? Explain.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.