Data and code files for the empirical work in “Replicability and Pitfalls in the Interpretation of Resampled Data: A Correction and a Randomization Test for Anwar and Fang” by Dragan Ilić

This is a guide to the STATA data and code files for my article “Replicability and Pitfalls in the Interpretation of Resampled Data: A Correction and a Randomization Test for Anwar and Fang,” appearing in Econ Journal Watch. The replications are based on Shamena Anwar and Hanming Fang’s original resampling algorithm and employ their data, all of which is available online at the American Economic Review website (link). All data and code files below are compressed in the archive IlicDataAndCode.zip (download), which also contains additional graphic files and a readme file that explains the automated replications.

Data files:

iter_30x1000.dta

This file stores the relevant statistics for the average search and search-success rates for each of the 1,000 passes of the automated resampling procedure. This file provides information on the precision of the estimates that a pass with 30 iterations produces and (in combination with iterssr_30x10000.dta) is the basis for the eight graphic files provided in the archive, two of which can be found in the article (Figure 1 and 2).

iter_30x1000_backup.dta

This is a backup of the above file (iter_30x1000.dta).

iteration.dta

This file stores the calculated statistics from the iterations calculated in iteration.do or iterationssr.do.

iterssr_30x10000.dta

This file stores the relevant statistics for the search-success rates for each of the 10,000 passes of the automated resampling procedure. This file provides information on the precision of the estimates that one pass with 30 iterations produces and (in combination with iter_30x1000.dta) is the basis for the eight graphic files provided in the archive, two of which can be found in the article (Figure 1 and 2).

iterssr_30x10000_backup.dta

This is a backup of the above file (iterssr_30x10000.dta).

race.dta

This file is Anwar and Fang’s unaltered data file of all troopers.

traffic searches.dta

This file is Anwar and Fang’s traffic searches file. A slight modification was done: The original traffic.dta file, which is the basis for both traffic stops.dta and traffic searches.dta, contained a few troop observations labelled “a”, “c”, “h”, and “k”. Obviously they were meant to be “A”, “C”, “H”, and “K”. If left uncorrected, however, these observations drop out during the resampling procedure. I have therefore renamed them before creating the files traffic stops.dta and traffic searches.dta using Anwar and Fang’s algorithm. The number of stops and searches reported in Anwar and Fang’s paper are consistent with my modification. As a robustness check, I also ran all analyses with the unaltered troop labels. The results did not change.

traffic stops.dta

This file is Anwar and Fang’s traffic stops file. A same slight modification was done: The original traffic.dta file, which is the basis for both traffic stops.dta and traffic searches.dta, contained a few troop observations labelled “a”, “c”, “h”, and “k”. Obviously they were meant to be “A”, “C”, “H”, and “K”. If left uncorrected, however, these observations drop out during the resampling procedure. I have therefore renamed them before creating traffic stops.dta and traffic searches.dta using Anwar and Fang’s algorithm. The number of stops and searches reported in AF’s paper are consistent with my modification. As a robustness check, I also ran all analyses with the unaltered troop labels. The results did not change.

traffic.dta

This is Anwar and Fang’s unaltered traffic dataset.

troopers.dta

This is Anwar and Fang’s unaltered trooper dataset.

Code files:

delete.do

This file is called during the automated resampling procedure iteration.do and deletes the temporary traffic stop and search sample files after running one iteration of the resampling (when replicating both the search and search-success rates).

deletessr.do

This file is called during the automated resampling procedure iterationssr.do and deletes the temporary traffic search sample files after running one iteration of the resampling (when replicating the search-success rates only).

iter_30x1000.do

This file repeatedly calls the automated resampling procedure iteration.do and runs 1,000 passes with 30 iterations each. One complete run takes about 33 hours. It stores the relevant statistics of each pass via iteration.do in the file iter_30x1000.dta. Note: It overwrites the file iter_30x1000.dta. For this reason, that file is backed up as iter_30x1000_backup.dta.

iteration.do

This file contains Anwar and Fang’s automated resampling procedure. It runs one single pass of Anwar and Fang’s original resampling procedure “officer resample.do” and, for each iteration, calculates the relevant statistics for the search and search-success rates. It executes the resampling n times, where n denotes the number of desired iterations. In Anwar and Fang, n is 30, so if one wishes to conduct one pass of the resampling procedure, the code would be called with the argument “30”, i.e. “do iteration 30”. The results of each iteration are stored in iteration.dta.

iterationssr.do

This file is the same as iteration.do but only calculates the search-success rates.

iterssr_30x10000.do

This file restricts iter_30x1000.do to the calculation of the search-success rates by calling iterationssr.do and raises the number of passes to 10,000. One complete run takes roughly 55 hours. It stores the relevant statistics of each pass via iteration.do in the file iterssr_30x10000.dta. Note: It overwrites the file iter_30x1000.dta. For this reason, that file is backed up as iterssr_30x1000_backup.dta.

officer resample ssr.do

This file restricts officer resample.do to the calculation of the sample search files (and thus the search-success rates only).

officer resample.do

This file is Anwar and Fang’s unaltered resampling code. Running it equals one iteration and creates the resampled stop and search files which are the basis for the search and search-success rates in Anwar and Fang’s Table 1.

traffic searches.do

This file is Anwar and Fang’s unaltered code to create traffic searches.dta.

traffic stops.do

This file is Anwar and Fang’s unaltered code to create traffic stops.dta.

troopers.do

This file is Anwar and Fang’s unaltered code to create troopers.dta.