Many basketball players and fans alike believe in the "hot hand" phenomemon: the idea that making several shots in a row increases a player's chance of making the next shot. Is there really a hot hand in basketball? More generally, in success/failure trials is there a tendency for trials following streaks of successes to be more likely to result in success? This app can be used to perform a statistical test for "hot hand" type behavior in sequences of success/failure trials, such as the shot attempts of a basketball player.

The data consist of a fixed number of success/failure trials with the outcomes recorded in sequence. (The probability that a trial results in success is assumed to be the same for all trials.) The method to input the observed data is controlled by the radio buttions:

**Input results sequence:**Input the observed sequence of trial outcomes itself, with 1 representing success and 0 failure, separated by commas. For example, an entry of 0,1,1,1,0 corresponds to failure on the first trial, success on the second, third, and fourth trials, and failure on the fifth trial. (Click on the References tab for information about some sample data that can be copied into the app.)**Input summary statistics:**Rather than entering the results of each individual trial, the user can enter three summary statistics.- Number of trials
- Total number of successes
- Observed value of the streak statistic (see below)

After entering the results sequence or the summary statistics (number of trials and number of successes), as well as the streak length (see below), click the button to **Accept inputs and initialization simulation**. The initialization process might take a minute; when the "please wait" message disappers, the app is ready to perform repetitions of the simulation (see *Permutation test* below). Note that the Accept inputs button should be pushed whenever these inputs change.

While there is no consensus definition of what constitutes the "hot hand", the term generally refers to a tendency for trials following streaks of successes to be more likely to result in success. Several statistics are used in practice; those included in the app are described below.

For statistics 1 through 4 below, the user must **define the streak length**: How many successes must be observed in a row in order to consider it a hot streak? The minimum possible streak length is 1; the maximum allowed streak length in the app is 7. Note: in applications concerning the hot hand in basketball, 3 is commonly used for the streak length.

In the app, the user can **choose a streak statistic** from the following.

*Proportion of S after streaks of S*. The proportion of success on those trials that are immediately preceded by a streak of successes. For example, if the streak length is 3 and the sequence is 0,1,1,1,**1**,**0**,1,1,1,**1**, trials 5, 6, and 10 are preceded by a streak of 3 successes, and the proportion of success on these trials is 2/3 = 0.6667.*Difference in proportion of S (after streaks of S - other trials).*The difference between the statistic in item 1 and the proportion of success on the remanining trials. In the previous example, 0,1,1,1,**1**,**0**,1,1,1,**1**, the value of the statistic is 2/3 - 6/7 = -0.1905.*Difference in proportion of S (after streaks of S - after streaks of F).*The difference between the statistic in item 1 and the proportion of success on those trials that are immediately preceded by a streak of failures. In the previous example, this statistic cannot be computed since there are no trials which follow a streak of 3 failures. In the sequence 1,0,0,0,0,1,1,1,**1**,**1**, with streak length 3, the value of the statistic is 2/2 - 1/2 = 0.5.*Frequency of S streaks.*The proportion of trials that are immediately preceded by a streak of successes. In the example 0,1,1,1,**1**,**0**,1,1,1,**1**, the value of the statistic is 3/7 = 0.4286. Note, with a streak length of 3 the first 3 trials are not counted in determining the frequency of trials preceded by a streak of successes, and similarly for other values of streak length.*Longest run of S.*The largest number of successes in a row in the observed sequence. In the example 0,1,1,1,1,0,1,1,1,1, the value of the statistic is 4.*Total number of runs.*The total number of runs, of any length, of both success and failure. In the example 0,1,1,1,1,0,1,1,1,1, the value of the statistic is 4. (This statistic is equivalent to the total number of "switches" or "alterations" between S and F if the first trial is counted as the first switch.)

The app can be used to perform a randomization-based hypothesis test of the hot hand phenomenon. The null hypothesis is that there is no hot hand; that is, that the trials are independent. Under the null hypothesis (together with the assumption of constant probability of success on all trials), given the number of successes any possible *ordering* of the successes and failures in the sequence is equally likely. Therefore, to simulate one hypothetical value of the streak statistic under the null hypothesis of no hot hand:

- shuffle the observed successes and failures,
- deal them out in sequence (first trial, second trial, and so on),
- and compute the value of the streak statistic for this hypothetical sequence.

An approximate p-value can be computed by comparing the observed value of the streak statistic relative to its null distribution, by **checking the box for Compute p-value**. Since we are interested if there is evidence of presence of the hot hand, one-sided p-values are computed.

- If total number of runs is selected as the streak statistic, smaller values are stronger evidence to reject the null hypothesis of no hot hand. (In streaky behavior we would expect longer, but fewer, runs of success.)
- For all other streak statistics, larger values of the statistic are stronger evidence to reject the null hypothesis of no hot hand.

As illustrated by the example for streak statistic 3 above, for streak statistics 1 through 4 the value of the statistic cannot be computed for a permutation in which there are no streaks of the specified length. Thus the app distinguishes between the number of repetitions performed and the number of simulated values of the statistic. The latter count is the denominator of the simulated p-value.

Note: The **clear plot** button will simply clear the plot. To rerun the simulation the Accept inputs and initialize simulation button must be pressed first.

The hot hand refers to a tendency for successes to cluster together. The "cold" hand refers to a similar tendency for failures. The app can be used to analyze the cold hand by simply interchanging the roles of success and failure. For example, to assess evidence of the cold hand based on the observed sequence 0,0,0,1,0,0,1, enter the data as 1,1,1,0,1,1,0 and perform a "hot hand" analysis.

The following paper accompanies this app and provides a discussion of the methods upon which the app is based, illustrations of hot hand analyses that can be performed using the app, and suggested activities.

- Ross, K. (2017). “Classroom Investigations of Recent Research Concerning the Hot Hand Phenomenon.”
*Journal of Statistics Education.*25(3).

This data set accompanies the paper. It contains the results from the NBA Three-Point Contest for 2013-2017. For each year, player, and round, the results of all the player's attempts in the round are recorded in sequence, with 1 indicating a made field goal (success) and 0 indicating a miss (failure). (In most cases there are 25 attempts in a round.) The results sequence for a particular player can be copied and pasted into the **Enter observed results sequence** box.

The hot hand analysis which the app performs is based on the methods in a series of papers by Joshua B. Miller and Adam Sanjurjo which have been a subject of much discussion and media coverage.

- Miller, J. B. and Sanjurjo, A. (2014). “A Cold Shower for the Hot Hand Fallacy”. Working paper (Dec 2014).
- — (2015). “Is it a Fallacy to Believe in the Hot Hand in the NBA Three-Point Contest?”. Working paper (Jun 2015).
- — (2016). “Surprised by the Gambler’s and Hot Hand Fallacies? A Truth in the Law of Small Numbers”. Working paper (Aug 2016).
- — (2016). “A Primer and Frequently Asked Questions for ‘Surprised by the Gambler's and Hot Hand Fallacies? A Truth in the Law of Small Numbers’ (Miller and Sanjurjo 2015)”. Working paper (Feb 2016).

The paper accompanying the app also uses data from the following seminal study on the hot hand in basketball, which is referenced numerous times in the Miller and Sanjurjo papers and related literature.

- Gilovich, T., Vallone, R., and Tversky, A. (1985). “The Hot Hand in Basketball: On the Misperception of Random Sequences”.
*Cognitive Psychology*17, 295-314.