Jeffrey R. Campbell, "Competition in Large Markets", Journal of Applied Econometrics, Vol. 26, No. 7, 2011, pp. 1113-1136. The file c2replication.zip contains all the data and source code necessary for the paper's replication. The root directory contains the following subdirectories: c2 This directory contains most of the Matlab and Stata programs and the LaTeX source files for the paper's construction. Start here when replicating the paper. pss This directory contains Matlab programs that implement the Powell, Stock, and Stoker density-weighted average derivative estimator. CCDB_94 This directory contains a copy of the 1994 County and City Data Book CD. CCDB_94_STATA This directory contains a makefile and a Stata program for converting the county-level records in the 1994 County and City Data book into Stata data sets using dbmscopy. CD_EC92_1I This directory contains a copy of release 1I of the 1992 Economic Census CD. Please note that this disk does not include the miscellaneous subjects data which I use for the left-hand sides of the regressions. EC_92_STATA This directory contains a makefile for converting the 1992 Economic Census data used in the paper into Stata data sets using dbmscopy Original Data The data used for this paper come from several sources. This replication package includes all of the original data sources. 1992 Census of Retail Trade. The paper uses data from the 1992 Census of Retail Trade document RC92-S-4, Miscellaneous Subject Series. The complete data collection procedures for this economic census can be found at 1992 Census. 1992 Census of Service Industries The paper uses msa-level hotel sales observations to measure hotel sales per capita, which proxies for the fraction of restaurant customers in an MSA who are visitors. 1994 County and City Data Book. This contains county-level observations primarily derived from the 1990 Decennial Census. It is the source for most of the regressions' right-hand side variables. BEA Regional Economic Accounts. The BEA measures personal income by state, county and MSA. The information can be found at their web site. I use this to measure per capital personal income by MSA in 1992. Campbell and Hopenhayn (2005) Campbell and Hopenhayn collected MSA-level observations of the median rent of shopping-center space (from the National Research Bureau's Shopping Center Directory) and of the cost per 1,000 exposures of a column-inch in a Sunday newspaper (from Editor and Publisher). This paper uses those observations. Please see that paper for more detail regarding their collection. This replication package includes all of the original data from these sources and the programs used to create the data set used. As per the Journal of Applied Econometrics replication guidelines, the file also includes comma-separated value files containing the data. These are in c2/Data/data92rfp.csv and c2/Data/data92rst.csv The first of these contains the data set for refreshment places and the second that for restaurants. The list below gives the meanings of their first lines' mnemonic variable names. rmsa MSA code in Census data. nestab Number of Establishments - Any Time of Year. nestabend Number of Establishments - End of Year. value Value of Industry Sales. nestabseat Number of Establishments w/ Seats. vseat Value of Sales for Establishments w/ Seats. nseat Number of Seats. n2 Number of Establishments w/ p<$2.00. v2 Sales of Establishments w/ p<$2.00. n499 Number of Establishments w/ $2.00<=p<=$4.99. v499 Sales of Establishments w/ $2.00<=p<=$4.99. n699 Number of Establishments w/ $5.00<=p<=$6.99. v699 Sales of Establishments w/ $5.00<=p<=$6.99. n999 Number of Establishments w/ $7.00<=p<=$9.99. v999 Sales of Establishments w/ $7.00<=p<=$9.99. n1499 Number of Establishments w/ $10.00<=p<=$14.99. v1499 Sales of Establishments w/ $10.00<=p<=$14.99. n2999 Number of Establishments w/ $15.00<=p<=$29.99. v2999 Sales of Establishments w/ $15.00<=p<=$29.99. n30 Number of Establishments w/ p>=$30.00. v30 Sales of Establishments w/ p>=$30.00. rrateprice Response Rate for Pricing Question. rrateseat Response Rate for Seating Question. name MSA name. pop92 1992 Population. yr MSA code in Census data. n Employment mchh Married-Couple Family Households hu Housing Units ssrent Shopping Center Rent hr Median Housing-Unit Rent hv Median Housing-Unit Value rwage Average Retail Wage nprate Newspaper Advertising Rate pinc Per Capita Personal Income pctcol College Attainment Rate pctblk Black Population Percentage pdense Population Density veh Vehicles per Household popgr Population Growth Rate hotel Hotel Revenues students College Students female Female Labor Force Participation Rate poverty Family Poverty Rate elderly Percentage Elderly highinc Percentage High-income Required Software The paper's replication requires that the following software to be installed. Most research institutions have licenses for these programs withe possible exception of dbmscopy. * Stata SE, Version 10.0 or higher. * Matlab, Release 2008b or higher * DBMS/Copy version 8.0. This utility for data conversion was originally created by Conceptual Software, Inc. This was sold to a subsidiary of the SAS institute, which discontinued it. Therefore, it is hard to get if you do not already have it available. At the Federal Reserve Bank of Chicago, we are replacing this program with Circle Systems' StatTransfer. When this is completed, a version of this replication package using that tool will be released. * pdflatex with the packages amsfonts American Mathematical Society fonts package. amsmath American Mathematical Society mathematical package. natbib Specifies author/date reference style. hyperrref and hypernat Enables hyperlinks in the .pdf file. setspace Makes small changes to the default spacing. I do not use any of this package's options, but the paper looks a little better with it. pgf/tikz Used to include .pdf files created by Matlab and to carry out simple mathematical calculations of numbers in the text. pgfplots Enables the \pgfmathprintnumber command for formatting numbers included in the text. rotating Enables the \sidewaystable command. marvosym Makes the marvosym font available. Used to place an envelope next to the corresponding author's name. todonotes Creates the boxed margin and inline notes with details and source information.(Requires pgf/tikz) * bibtex * gnu make I use Stata for basic data management, and Matlab does most of the calculations. The paper's text is written in LaTeX, which I process with pdflatex and bibtex. A set of makefiles brings the whole enterprise together. I include todonotes.sty in the replication file because it is not yet part of the standard TeXLive distribution of TeX and its friends. If you do not have some of the the other required LaTeX packages, I suggest that you or your system administrator download and install the latest TeXLive distribution (for Unix and Mac) or MiKTeX distribution (for Windows). (I have tested the programs with the 2008 release of TeXLive.) Since I use gnu make only to automate the paper's construction, the paper can be reproduced by running the individual files in sequence by hand. Running the programs under Unix These instructions assume that the relevant Unix machine's hard drive already has a copy of c2replication.zip. If this is not the case, Microsoft Windows users can install WinSCP and use it to transfer the file. To begin, log into the machine with your favorite client and start an X-windows session. (This is required because Matlab seems to be finicky about having a graphical output when creating figures, even if it does not display them!) Start a shell, change your working directory to the directory containing the replication file, and then issue these commands. 1. unzip c2replication (Creates the directory c2replication and extracts the replication files to it.) 2. cd c2replication/c2 (Changes the working directory to the base directory of the replication file.) 3. make The last step starts gnu make, which in turn runs all of the Stata and Matlab programs and then processes the results with pdflatex. Upon completion (which should take very little time), the current directory will contain the completed paper, c2.pdf. If something goes wrong in the first step, then you probably do not have permission to write in the current directory. Contact your system administrator or a local Unix expert for help. An error in the last step probably indicates that the machine does not have the required software. If necessary, type Control-C to abort the replication. Then get help from a local expert. On my Linux machine, the commands to start Stata and Matlab are stata-se and matlab. If these are different on your machine, then you will have to change each directory's makefile appropriately before using make. Auditing the paper's results To ensure accuracy, I typed no quantitative result into the paper by hand. Instead, every number is generated by a Matlab program and written to a text file. LaTeX reads these files and places the numbers in the appropriate places. To audit the paper's results, can take one of two approaches. * The replication file contains a version of the program with margin notes giving audit trails, c2audit.pdf. If a result is reported as a spelled number (as at the beginning of a sentence), then the result's margin note also reports the result numerically. You can look up the given result in the text and follow the given trail. (This file can also be replicated with make c2audit.pdf.)This version of the paper also contains several tables in an appendix. These report results summarized in the paper's main text. * Since all numbers are automatically generated, you can open the LaTeX source file c2.tex and find the code generating the number. Inline numbers are created from LaTeX keys manged with the pgfkeys package. For example, the code $\pgfkeysvalueof{/results/table2/deltahat/row 1/column 3}$ places the value of Table 2's first row and third column into the text. Each table was generated by an eponymous Matlab file. All of the figures were created by Figures/figures.m Manifest Below is a list of all files included in the replication package's directory c2. c.bib BibTeX bibliography file. makefile Project's master makefile. This calls makefiles in the project's subdirectories. todonotes.sty LaTeX file for todonotes package. c2.tex Master LaTeX file. c2abstract.tex LaTeX file with paper's abstract . c2audit.tex Master LaTeX file for the version of the paper with audit trails. c2conclusion.tex LaTeX with the paper's conclusion. c2intro.tex LaTeX file with the paper's introduction. c2literature.tex LaTeX file with the paper's literature review. c2model.tex LaTeX file with the paper's model section. c2proof.tex LaTeX file with the paper's proof section. c2results.tex LaTeX file with the paper's results section. c2tables.tex LaTeX file with the input for the paper's tables. /Data/makefile Makefile for the Data directory. /Data/readme Readme file for the Data directory; includes summary of variable names. /Data/data92rfp.m Matlab file that loads the data in data92rfp.csv /Data/data92rst.m Matlab file that loads the data in data92rst.csv /Data/data92rfp.csv Comma separated values file containing the data set used for the Refreshment Places regressions.It has 236 observations. /Data/data92rst.csv Comma separated values file containing the data set used for the Restaurants regressions. It has 237 observations. /Data/data92.do Stata file that links the left-hand side and right-hand side variables. /Data/rc92s04/rc92s04.pdf .pdf file of RC92-S-4, the 1992 Census of Retail Trade, Miscellaneous Subjects volume. /Data/rc92s04/makefile Makefile for the rc92s04 directory. /Data/rc92s04/FinalTable1517.xls XLS file containing data from Tables 15 and 17. /Data/rc92s04/FinalTable1517noheader.xls XLS file containing data from Tables 15 and 17 without header lines giving the variable names. /Data/rc92s04/FinalTable15.xls XLS file used for creating table 15 .dta files. /Data/rc92s04/FinalTable17.xls XLS file used for creating table 17 .dta files . /Data/rhs92/ca1_3msa.exe Self-extracting (on some computer) .zip file containing the BEA's Regional Economic Accounts data on MSA-level Personal Income. /Data/rhs92/makefile Makefile for rhs92 directory. /Data/rhs92/eandp92.xls XLS file that contains newspaper advertising cost data from Campbell and Hopenhayn (2005). /Data/rhs92/shop.xls XLS file that contains original shopping center rent data from Campbell and Hopenhayn (2005) as entered from the printed source.. /Data/rhs92/shopClean.xls XLS file that contains a cleaned version of the shopping center rent data. /Data/rhs92/ederly92.do Stata file that measures the fraction of elderly residents by MSA in 1990. /Data/rhs92/female92.do Stata file that constructs an estimate of female labor force participation by MSA in 1990. /Data/rhs92/highinc92.do Stata file that measures the fraction of high-income households by MSA in 1990. /Data/rhs92/hotel92.do Stata file calculates hotel sales per capita by MSA in 1992. /Data/rhs92/hr92.do Stata file that constructs an estimate of the median rent by MSA in 1990. /Data/rhs92/hu92.do Stata file that aggregates county level data on housing units into MSA-level observations. /Data/rhs92/hv92.do Stata file that aggregates county level data on the values of owner-occupied units into MSA-level observations. /Data/rhs92/mchh92.do Stata file that aggregates county level data from the 1994 CCDB on Married-Couple Family Households. /Data/rhs92/msalst.do Stata file that creates a data-set of MSA codes and names from the 1992 Economic Census file. /Data/rhs92/n92.do Stata file that creates MSA-level total employment data. /Data/rhs92/nprate92.do Stata file that generates the data file nprate.dta from the advertising rate data. /Data/rhs92/pctblk92.do Stata file that generates a data file describing the percentage of the population that is black for each MSA. /Data/rhs92/pctcol92.do Stata file that generates a data file describing the college attainment rate for each MSA. /Data/rhs92/pdense92.do Stata file that forms the population-weighted (across counties) population density measure. /Data/rhs92/pinc92.do Stata file that creates a data file for per-capita personal income for each MSA. /Data/rhs92/pop92.do Stata file that creates a data file the includes population data for each MSA. /Data/rhs92/popgr92.do Stata file that creates a data file containing the population growth for each MSA. /Data/rhs92/poverty92.do Stata file that measures the family poverty rate for each MSA in 1990. /Data/rhs92/rhs92.do Stata file that joins the various data sets with MSA characteristics that reside in this directory. /Data/rhs92/rwage92.do Stata file that measures the average retail wage in 1992. /Data/rhs92/ssrent92.do Stata file that measures median shopping center rent by MSA in 1992 using the shopping center rent data from Campbell and Hopenhayn (2005). /Data/rhs92/students92.do Stata file that constructs the number of college enrollees in 1990 by MSA. /Data/rhs92/veh92.do Stata file that aggregates county-level data on Vehicles per Household to the MSA level. /Figures/makefile Makefile for Figures directory. /Figures/figures.m Matlab file used to create the figures in the paper. /Tables/makefile Makefile for Tables directory. /Tables/stars.m Matlab function which creates a LaTeX string for the stars that indicate an estimate's statistical significance. /Tables/table1.m Matlab file used to create Table 1. /Tables/table2.m Matlab file used to create Table 2. /Tables/table3.m Matlab file used to create Table 3. /Tables/table4.m Matlab file used to create Table 4. /Tables/table5.m Matlab file used to create Table 5. /Tables/table6.m Matlab file used to create Table 6. /Tables/table7.m Matlab file used to create Table 7. /Tables/table8.m Matlab file used to create Table 8. /Tables/zsign.m Matlab file for assigning the string associated with a negative sign. Last modified on September 21, 2009